-
Notifications
You must be signed in to change notification settings - Fork 1
/
getbeads.m
41 lines (38 loc) · 965 Bytes
/
getbeads.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
function getbeads (fvec, outpath)
for i=1:length(fvec)
fname = [fvec(i).folder '/' fvec(i).name]
load(fname);
if exist('Xvolume','var')
xy = squeeze(sum(Xvolume,3));
elseif exist('XguessSAVE1','var')
xy = squeeze(sum(XguessSAVE1,3));
else
disp('WTF?! Unknown data name.');
keyboard
end
figure(1);
dynamic_range = round(log2(max(max(xy))));
imagesc(xy,[0 2^dynamic_range]);
daspect([1,1,1]);
xlabel('x');
ylabel('y');
colorbar();
xycoords = [];
hold on;
while (1)
a = ginput(1)
if a(1)<50 & a(2) <50
break;
end
xycoords = [xycoords;a];
plot(a(1),a(2),'k*');
end
hold off;
fout = [outpath fvec(i).name(1:end-4) '_bead_xy.mat']
save(fout,'xycoords');
fout = [outpath fvec(i).name(1:end-4) '_bead_xy.png']
ff=getframe(gcf);
[X, map] = frame2im(ff);
imwrite(X, fout);
end
end