-
Notifications
You must be signed in to change notification settings - Fork 2
/
CAMshow.m
46 lines (41 loc) · 1.01 KB
/
CAMshow.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
function CAMshow(im,CAM)
imSize = size(im);
if length(imSize)>2
if imSize(3)==1
im=cat(3,im,im,im);
end
elseif length(imSize)==2
im=cat(3,im,im,im);
end
CAM = imresize(CAM,imSize(1:2));
CAM = normalizeImage(CAM);
CAM(CAM<0.2) = 0;
cmap = jet(255).*linspace(0,1,255)';
CAM = ind2rgb(uint8(CAM*255),cmap)*255;
combinedImage = double(rgb2gray(im))/2 + CAM;
combinedImage = normalizeImage(combinedImage)*255;
imshow(uint8(combinedImage));
%## Find which pixels are expressed #### (by Alok)
% H=combinedImage(:,:,1); %let it do for 'R' only
% R=H/255;
% [row,col]=ind2sub(size(R),find(R>Threshold));
% % if FIG==1
% % figure; imshow(R);
% % end
%
% IND=sub2ind(size(R),row,col);
% if FIG==1
% B=ones(size(R));
% B(IND)=R(IND);
% figure;
% subplot(1,2,1); imshow(B);
% title('Area by activation')
%
% C=uint8(ones(size(R))*255);
% im2=im(:,:,1);
% C(IND)=im2(IND);
% subplot(1,2,2); imshow(C)
% title('Genes selected')
% end
%##################################################
end