Skip to content
Newer
Older
100644 45 lines (39 sloc) 1.55 KB
3c8cdeb Moved plotting from duplicate dot finding step into freestanding fxns…
Alistair Boettiger authored
1 %% DepthDots
2 % Alistair Boettiger Date Begun: 02/07/11
3 % Levine Lab Last Modified: 02/07/11
4 %
5 %% Description
6 % Written for im_singlemolecule.fig
7 %
8 %% Inputs
9 % In Image of nuclei (downscaled for speed)
10 % Cell_bnd bw image of cell boundaries
11 % inds_Z indices of pixels at centroids of localized mRNA transcripts
12 % h,w height and width of original image
13
14 function DepthDots(In,Cell_bnd,inds_Z,h,w)
15
16 % depth color coding of mRNA transcripts
17 hn = size(In,1);
18 Zs = length(inds_Z);
19
20 In = imresize(In,h/hn,'nearest'); % resize nuclei up to image size.
21 In = uint8(double(In)/2^16*255); % convert to uint8
22 Cell_bnd = uint8(255*imresize(Cell_bnd,h/hn,'nearest'));% resize boundary labels
23
24 % Add nuclei and cell boundaries to the image
25 Idot = cell(1,Zs);
26 Ib = uint8(zeros(h,w,3));
27 Ib(:,:,1) = Cell_bnd;
28 Ib(:,:,2) = Cell_bnd;
29 Ib(:,:,3) = In + Cell_bnd;
30 Iv = Ib;
31 col = spring(Zs); % colormap for depth coding
32 for z=1:Zs;
33 I1 = false(h,w);
34 I1(inds_Z{z}) = 1; % place all dots on array
35 % Paint different color for dots of each z-plane.
36 Iv(:,:,1) = Iv(:,:,1) + uint8(col(z,1)*I1*255);
37 Iv(:,:,2) =Iv(:,:,2) + uint8(col(z,2)*I1*255);
38 Iv(:,:,3) = Iv(:,:,3) + uint8(col(z,3)*I1*255);
39 Idot{z} = I1;
40 end
41 figure(7); clf; colormap(col);
42 colordef black; set(gcf,'color','k');
43 imshow(Iv); colorbar; caxis([1,Zs]);
44
45
Something went wrong with that request. Please try again.