-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathendVrept.m~
53 lines (36 loc) · 1.74 KB
/
endVrept.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
47
48
49
50
51
52
53
%% endVrept.m
%
% Alistair Boettiger Date Begun: 03/01/11
% Levine Lab Functionally Complete: 03/01/11
% Last Modified: 03/01/11
%
function Im_seg = endVrept(folder,name,norm,scale,f)
Ymax = 250;
Nstrength = .7;
load([folder,name]);
age = getage(H,cent);
disp(age);
N_y = length(unique(H.*L1));
N_r = length(unique( H.*(L1&(1-L2).*Filt) ));
N_ectopic = N_r/(N_y+N_r);
% Yellow = both; Green = endogenous no reporter
Iz = uint8(zeros(h,w,3));
Iz(:,:,1) = 255*uint8(L2n1);
Iz(:,:,2) = 1*uint8(Ymax*(L1&L2)) + 255*uint8(L2n1) + Nstrength*handles.In ;
Iz(:,:,3) = Nstrength*handles.In - Iz(:,:,1) - 255*uint8(L2n1) - 1*uint8(Ymax*(L1&L2));
Im_seg = uint8(bsxfun(@times,double(Iz)/255*norm,double(handles.In)));
Im_seg = imresize(Im_seg,scale);
Im_seg = imflip(imflip(Im_seg,f(1)),f(2));
imshow(Im_seg);
% Yellow = both, red = missing
% Iz = uint8(zeros(h,w,3));
% Iz(:,:,1) = 1*uint8(Ymax*(L1&L2))+ 255*uint8(L2n1);
% Iz(:,:,2) = 1*uint8(Ymax*(L1&L2)) + Nstrength*handles.In - 255*uint8(L2n1);
% Iz(:,:,3) = Nstrength*handles.In - Iz(:,:,1);
% Im_seg = uint8(bsxfun(@times,double(Iz)/255*norm,double(handles.In)));
% Green = both, yellow = missing
Iz = uint8(zeros(h,w,3));
Iz(:,:,1) = 255*uint8(L2n1);
Iz(:,:,2) = 1*uint8(Ymax*(L1&L2)) + 255*uint8(L2n1) + Nstrength*handles.In ;
Iz(:,:,3) = Nstrength*handles.In - Iz(:,:,1) - 255*uint8(L2n1) - 1*uint8(Ymax*(L1&L2));
Im_seg = uint8(bsxfun(@times,double(Iz)/255*norm,double(handles.In)));