Skip to content

Commit 50cb255

Browse files
authored
Add files via upload
1 parent 01503a5 commit 50cb255

File tree

5 files changed

+517
-0
lines changed

5 files changed

+517
-0
lines changed

changeImage.m

+118
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
function changeImage(key)
2+
3+
% advances to the next image when a key is pressed
4+
%
5+
% SYNOPSIS changeImage(key)
6+
%
7+
% Alexandre Matov, 11-Mar-2004
8+
9+
handles = guidata(findobj('Name','manTrack'));
10+
switch key
11+
case 1
12+
if handles.no>1 & handles.no<41
13+
handles.no = handles.no - 1;
14+
flag = -1;
15+
if ishandle(handles.neighborPlot)
16+
delete(handles.neighborPlot);
17+
end
18+
if ~isempty(handles.neighborPlot)
19+
handles.neighborPlot = [];
20+
end
21+
else
22+
msgbox('there are 40 images in the stack (min number 1 and max number 40)')
23+
return
24+
end
25+
case 2
26+
if handles.no>0 & handles.no<40
27+
handles.no = handles.no + 1;
28+
flag = 1;
29+
if ishandle(handles.neighborPlot)
30+
delete(handles.neighborPlot);
31+
end
32+
if ~isempty(handles.neighborPlot)
33+
handles.neighborPlot = [];
34+
end
35+
else
36+
msgbox('there are 40 images in the stack (min number 1 and max number 40)')
37+
return
38+
end
39+
end
40+
fh = findall(0, 'Name', 'Spindle');
41+
if handles.no>0 & handles.no<41
42+
handles.image = Gauss2D(double(imread(char(handles.listImages(handles.no)))), 1);
43+
else
44+
msgbox('there are 40 images in the stack')
45+
return
46+
end
47+
figure(fh)
48+
set(handles.title,'String',['Frame ',num2str(handles.no)]);
49+
guidata(findobj('Name', 'manTrack'), handles);
50+
set(findobj('Type','image'),'CData', handles.image);
51+
refresh(fh);
52+
hold on
53+
delete(handles.currentSp);
54+
haSp=plot(handles.candsR.Lmax(2), handles.candsR.Lmax(1), 'r*');%initial speckle
55+
56+
% Next, plot all the detected speckles. First, load in the cands structure
57+
if isunix == 1
58+
temp_cands_fname = strcat('/unc/manTrackWT2s/speckles/cands0', num2str(handles.no+50), '.mat');
59+
else
60+
temp_cands_fname = strcat('U:\manTrackWT2s\speckles\cands0', num2str(handles.no+50), '.mat');
61+
end
62+
load(temp_cands_fname); % Load in the new cand structure.
63+
cands=cands(find([cands.status]==1)); % do not consider the insignificant ones!!
64+
65+
[temp0 length] = size(cands);
66+
% find the previous point that has already been recorded.
67+
if ~isempty(handles.speckleCo)
68+
list = sort([handles.speckleCo(:,1);handles.noInit]);
69+
if handles.no > list(end)
70+
indx = find(handles.speckleCo(:,1)==list(end));
71+
elseif handles.no < list(1)
72+
indx = find(handles.speckleCo(:,1)==list(1));
73+
else
74+
indx = find(handles.speckleCo(:,1)==(handles.no));
75+
if isempty(indx)
76+
indx = find(handles.speckleCo(:,1)==(handles.no-flag*1));
77+
if isempty(indx)
78+
indx = find(handles.speckleCo(:,1)==(handles.no-flag*2));
79+
end
80+
end
81+
end
82+
% indx = find(handles.speckleCo(:, 1) == (handles.no - 1)); % Find saved coordinate ????flag*
83+
else
84+
indx = []; % No previous saved coordinate.
85+
end % indx can be improved - dont in one for loop!!
86+
RADIUS = 30;
87+
handles.neighbors.length = 0;
88+
if (handles.no == handles.noInit)
89+
handles.currentSp = haSp;
90+
guidata(findobj('Name','manTrack'),handles);
91+
return;
92+
end
93+
if isempty(indx) % Previous point is the first speckle
94+
previous_point = handles.candsR;
95+
for i = 1 : length
96+
temp0 = (cands(i).Lmax - previous_point.Lmax).^2;
97+
if (temp0 < RADIUS^2)
98+
handles.neighbors.length = handles.neighbors.length + 1;
99+
handles.neighbors.points(handles.neighbors.length, 1:2) = cands(i).Lmax(1:2);
100+
handles.neighborPlot(end + 1, 1) = plot(cands(i).Lmax(2), cands(i).Lmax(1), 'g.');
101+
set(handles.neighborPlot(end, 1),'ButtonDownFcn','plotSpeckle');
102+
end
103+
end
104+
else
105+
previous_point_coordinate = [handles.speckleCo(indx, 3) handles.speckleCo(indx, 2)];
106+
for i = 1 : length
107+
temp0 = (cands(i).Lmax - previous_point_coordinate).^2;
108+
if (temp0 < RADIUS^2)
109+
handles.neighbors.length = handles.neighbors.length + 1;
110+
handles.neighbors.points(handles.neighbors.length, 1:2) = cands(i).Lmax(1:2);
111+
handles.neighborPlot(end + 1, 1) = plot(cands(i).Lmax(2), cands(i).Lmax(1), 'g.');
112+
set(handles.neighborPlot(end, 1),'ButtonDownFcn','plotSpeckle');
113+
end
114+
end
115+
end
116+
handles.tempCands = cands;
117+
handles.currentSp = haSp;
118+
guidata(findobj('Name','manTrack'),handles);

deleteSpeckle.m

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
function deleteSpeckle
2+
3+
% allows to review a trajectory and delete a manually selected speckle
4+
% within it
5+
%
6+
% SYNOPSIS deleteSpeckle
7+
%
8+
% Alexandre Matov, 11-Mar-2004
9+
10+
% delete the speckle (cands) index from the trajectory
11+
delSpeck=questdlg('Would you like to delete this entry?','Delete entry','Yes','No','Yes');
12+
switch delSpeck
13+
case 'Yes'
14+
ha = gcbo;
15+
handles=guidata(findobj('Name','manTrack'));
16+
indxD = find(handles.hPlot == ha);
17+
delete(handles.hPlot(indxD));
18+
handles.hPlot(indxD) = [];
19+
delete(handles.textB(indxD));
20+
handles.textB(indxD) = [];
21+
delete(handles.near(indxD));
22+
handles.near(indxD)=[];
23+
handles.speckleCo(indxD,:) = [];
24+
guidata(findobj('Name','manTrack'),handles);
25+
case 'No'
26+
return;
27+
end % switch

manTrack.fig

8.75 KB
Binary file not shown.

0 commit comments

Comments
 (0)