/
at_testNucleusFluo.m
executable file
·90 lines (70 loc) · 1.98 KB
/
at_testNucleusFluo.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
function [fr arr arr2]=at_testNucleusFluo(nucleusindex,frames,channel,display)
% check that sigma gaussian increase linsearly with time == size of nucleus
% whereas gaussian height is related to histone content
% however, since nucleus moves in 3D, it is better to integrate sigma since
% the total energy in the gaussian may be constant whatever the focus point
% is
global segmentation
arr=[]; fr=[]; arr2=[]; bac=[];
tnucleus=segmentation.tnucleus(nucleusindex);
tfra=[tnucleus.Obj.image];
[fra ia ib]=intersect(frames,tfra);
if display
hdisplay=figure;
end
tic;
for i=1:length(ib)
obfra=ib(i);
fra=frames(ia(i));
nucleus=tnucleus.Obj(obfra);
img=phy_loadTimeLapseImage(segmentation.position,fra,channel,'non retreat'); % channel
[fluo area bckgrd]=at_measureNucleusFluo(nucleus,img,2);
arr=[arr fluo];
bac=[bac bckgrd];
arr2=[arr2 nucleus.area*nucleus.fluoMean(2)];
fr=[fr fra];
% if display
%
% subplot(1,3,3); plot(fr,arr/1000,'Color','b','LineWidth',2,'Marker','o');
% xlim([frames(1) frames(end)+1]);
% ylim([0 200]);
% set(gca,'FontSize',20);
% xlabel('Time (frames)');
% ylabel('Total fluo (A.U)')
% %pause(0.3);
%
% % image export
% % strname=num2str(i);
% %
% % while numel(strname)<6
% % strname=['0' strname];
% % end
% %
% % f=exist('movietemp');
% % if f~=7
% % mkdir('movietemp');
% % end
% %
% % str=['movietemp/frame-' strname '.png'];
% %
% % myExportFig(str);
%
% %clf(hdisplay);
% end
%close;
end
toc
% movie export
% if display
%
% framerate=10;
% encoder='mjpeg'; % mpeg4
%
% ax=get(hdisplay,'Position');
% %ax(3)=1600;
% %ax(4)=500;
% %close
%
% eval(['!/usr/local/bin/mencoder "mf://movietemp/*.png" -mf fps=' num2str(framerate) ' -o test.avi -ovc lavc -lavcopts vcodec=' encoder ' -oac copy -vf scale=' num2str(round(ax(3))) ':' num2str(round(ax(4)))]);
% end
figure, plot(fr,arr); figure; plot(fr, arr2,'Color','r'); figure, plot(fr,bac,'Color','g');