-
Notifications
You must be signed in to change notification settings - Fork 0
/
scorebudnecks.m
executable file
·120 lines (70 loc) · 2.15 KB
/
scorebudnecks.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
%% CDC10 movie
%
% %% quantify cell cycle phases
%
at_cellCycle(1:128,0);
%% link between nucleus and budnecks
%
%
% %% Import the data
data = xlsread('/Users/charvin/Documents/MATLAB/mysoft/autotrack/scorebudnecks/cdc10-pos1.xls','Feuil1');
% %% Allocate imported array to column variable names
nuc = data(:,1);
bud = data(:,2);
%% plot fluo nuc and budneck
global segmentation ana tabana
ana=[];
for id=1:numel(segmentation.tnucleus)
pix=find(nuc==id);
sca=1;
if numel(pix)==0
continue
end
xn=[segmentation.tnucleus(id).Obj.image];
[xn ix]=sort(xn);
fluo=[segmentation.tnucleus(id).Obj.fluoMean];
fluo=fluo(3:3:end); % select channel 2
fluo=fluo(ix); % sort fluo data with increasing time
fluo=fluo-600; % remove zero fo camera
area=[segmentation.tnucleus(id).Obj.area];
area=area(ix);
fluo=fluo.*area/mean(area);
fluo=(fluo-min(fluo))/(max(fluo)-min(fluo));
figure, plot(sca*xn,fluo,'Color','g','lineWidth',2); hold on;
stats=segmentation.tnucleus(id).mothers;
tabana=[];
for j=1:numel(stats.start)
line([sca*stats.start(j) sca*stats.start(j)],[0 1.5],'Color','b','lineStyle','--','lineWidth',2);
line([sca*(stats.start(j)+stats.G1(j)) sca*(stats.start(j)+stats.G1(j))],[0 1.5],'Color','m','lineStyle','--','lineWidth',2);
tabana=[tabana sca*stats.start(j)];
end
xpl=[];
ypl=[];
for j=pix'
xn=[segmentation.tbudnecks(bud(j)).Obj.image];
[xn ix]=sort(xn);
fluo=[segmentation.tbudnecks(bud(j)).Obj.fluoMean];
fluo=fluo(2:2:end); % select channel 2
fluo=fluo(ix); % sort fluo data with increasing time
fluo=(fluo-min(fluo))/(max(fluo)-min(fluo))+0.5;
xpl=[xpl xn];
ypl=[ypl fluo];
end
set(gca,'FontSize',20);
xlabel('Time (frames)','Fontsize',20);
ylabel('Normalized fluo.','Fontsize',20);
xlim([0 145*sca]);
title([num2str(id)]);
set(gcf,'Position',[100 800 1500 300]);
h1=plot(sca*xpl,ypl,'Color','r','lineWidth',2);
set(h1,'ButtonDownFcn',{@plothit});
pause;
close;
end
function plothit(hObject, eventdata, handles)
global ana tabana
p = get(gca,'CurrentPoint');
p = p(1,1:2);
[mi ix]=min(abs(tabana-p(1)));
ana=[ana mi];
disp('ok');