Skip to content

Commit a233e98

Browse files
Merge pull request #15 from DIDSR/qigong
merge from qigong to master
2 parents 8ef914a + 1bd6d7a commit a233e98

File tree

7 files changed

+78
-8
lines changed

7 files changed

+78
-8
lines changed

GUI.fig

-45 Bytes
Binary file not shown.

GUI.m

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ function GUI_OpeningFcn(hObj, eventdata, handles, varargin)
195195

196196
% save myData
197197
handles.myData = myData;
198+
handles.reticle = 1;
198199
settings = myData.settings;
199200
guidata(handles.GUI, handles)
200201

@@ -431,7 +432,11 @@ function Initiate_GUI_Elements(handles)
431432
'BackgroundColor',myData.settings.BG_color,...
432433
'ForegroundColor',myData.settings.FG_color,...
433434
'Visible', 'off');
434-
435+
set (handles.Reticlebutton,...
436+
'FontSize', myData.settings.FontSize,...
437+
'BackgroundColor',myData.settings.BG_color,...
438+
'ForegroundColor',myData.settings.FG_color,...
439+
'Visible', 'off');
435440

436441
% Update handles.GUI
437442
guidata(handles.GUI, handles);
@@ -707,16 +712,23 @@ function ResetViewButtonPressed(hObj, eventdata, handles) %#ok<DEFNU>
707712

708713
myData = handles.myData;
709714
taskinfo = myData.tasks_out{myData.iter};
710-
711715
% Redraw the Image from the Temporary Image Folder
712-
taskimage_load(hObj);
716+
%taskimage_load(hObj);
713717
handles = guidata(hObj);
714718

715719
switch myData.mode_desc
716720
case 'MicroRT'
717721

718722
target_pos = [taskinfo.stage_x, taskinfo.stage_y];
723+
currentNextStatus = get(handles.NextButton,'enable');
724+
set(handles.NextButton,'enable','off');
725+
set(handles.Fast_Register_Button,'enable','off');
726+
set(handles.Best_Register_Button,'enable','off');
719727
handles.myData.stage = stage_move(handles.myData.stage,target_pos,handles.myData.stage.handle);
728+
set(handles.NextButton,'enable',currentNextStatus);
729+
set(handles.Fast_Register_Button,'enable','on');
730+
set(handles.Best_Register_Button,'enable','on');
731+
720732
end
721733

722734
% myData.tasks_out{myData.iter} = taskinfo;
@@ -1127,3 +1139,31 @@ function Best_Register_Button_Callback(hObject, eventdata, handles)
11271139
error_show(ME)
11281140
end
11291141
end
1142+
1143+
1144+
1145+
1146+
% --- Executes on button press in Reticlebutton.
1147+
function Reticlebutton_Callback(hObject, eventdata, handles)
1148+
% hObject handle to Reticlebutton (see GCBO)
1149+
% eventdata reserved - to be defined in a future version of MATLAB
1150+
% handles structure with handles and user data (see GUIDATA)
1151+
if handles.reticle == 1
1152+
handles.reticle = 0;
1153+
set(handles.Reticlebutton,'String','Show reticle');
1154+
else
1155+
handles.reticle = 1;
1156+
set(handles.Reticlebutton,'String','Hide reticle');
1157+
end
1158+
guidata(handles.GUI, handles);
1159+
taskimage_load(hObject);
1160+
handles = guidata(hObject);
1161+
st = dbstack;
1162+
taskinfo = handles.myData.tasks_out{handles.myData.iter};
1163+
taskinfo.calling_function = st(1).name;
1164+
handles.myData.taskinfo = taskinfo;
1165+
guidata(handles.GUI, handles);
1166+
taskinfo.task_handle(handles.GUI);
1167+
%set(handles.NextButton,'Enable', 'off');
1168+
1169+
end

sample_inputfiles/tissue40x-8B-axioplan2i.dapsi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ BODY
6262
start
6363
finish
6464
radio1of4,1st0001,-1,1,038459,16192,219,219,219,219,Qtext_radio1of1,1,1,Q_Op1,Q_Op2,Q_Op3,Q_Op4
65-
count,2nd0001,-1,1,027728,11381,439,439,439,439,Qtext_count,1,1,description
65+
count,2nd0001,-1,1,027728,11381,439,439,439,439,Qtext_count,1,1,Please count mitotic in this area
6666
slider,3rd0001,-1,1,19220,49879,658,658,658,658,Qtext_slider,1,1,Q_Op1,Q_Op2,Q_Op3,Q_Op4
6767
mark1,4th0001,-1,1,041163,33208,878,878,878,878,Qtext_select_region,1,1,Q_Op1,Q_Op2,Q_Op3,Q_Op4
6868
mark1_out,5th0001,-1,1,041163,33208,1097,1097,1097,1097,Qtext_select_region,1,1,Q_Op1,Q_Op2,Q_Op3,Q_Op4

tasks/task_mark1.m

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,20 @@ function task_mark1(hObj)
169169
% Pack the results
170170
myData.tasks_out{handles.myData.iter} = taskinfo;
171171

172+
173+
case 'Reticlebutton_Callback' % keep mark result after hide/show reticle
174+
if handles.panning_Zooming_Tool.markexists==1
175+
textROIX= get(handles.textROIX);
176+
textROIY= get(handles.textROIY);
177+
x = str2num(textROIX.String);
178+
y = str2num(textROIY.String);
179+
handles.panning_Zooming_Tool.mark = rectangle('Position',...
180+
[x-40,y-40,80,80],'Curvature',[1,1],...
181+
'LineWidth',4,'LineStyle','--','EdgeColor','r','Tag','mark');
182+
handles.panning_Zooming_Tool.markexists=1;
183+
end
184+
185+
172186
case {'NextButtonPressed', ...
173187
'PauseButtonPressed',...
174188
'Backbutton_Callback'} % Clean up the task elements

tasks/task_mark1_out.m

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,20 @@ function task_mark1_out(hObj)
170170
% Pack the results
171171
myData.tasks_out{handles.myData.iter} = taskinfo;
172172

173+
174+
case 'Reticlebutton_Callback' % keep mark result after hide/show reticle
175+
if handles.panning_Zooming_Tool.markexists==1
176+
textROIX= get(handles.textROIX);
177+
textROIY= get(handles.textROIY);
178+
x = str2num(textROIX.String);
179+
y = str2num(textROIY.String);
180+
handles.panning_Zooming_Tool.mark = rectangle('Position',...
181+
[x-40,y-40,80,80],'Curvature',[1,1],...
182+
'LineWidth',4,'LineStyle','--','EdgeColor','r','Tag','mark');
183+
handles.panning_Zooming_Tool.markexists=1;
184+
end
185+
186+
173187
case {'NextButtonPressed', ...
174188
'PauseButtonPressed',...
175189
'Backbutton_Callback'} % Clean up the task elements

tasks/taskimage_load.m

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@ function taskimage_load(hObj)
2121
if ~isnan(handles.ImX)
2222

2323
% Apply reticle mask
24-
handles.ImX = reticle_apply_mask(...
25-
handles.ImX,...
26-
settings.scan_mask);
24+
if handles.reticle == 1
25+
handles.ImX = reticle_apply_mask(...
26+
handles.ImX,...
27+
settings.scan_mask);
28+
end
2729
temp=size(handles.ImX);
2830
imageydim=temp(1);
2931
imagexdim=temp(2);

tasks/taskmgt_default.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function taskmgt_default(handles, on_off)
3636
set(handles.PauseButton, 'Visible',on_off);
3737
set(handles.ResumeButton, 'Visible', on_off, ...
3838
'Enable', 'off');
39-
39+
set(handles.Reticlebutton, 'Visible', on_off);
4040
if handles.myData.iter > 2
4141
set(handles.Backbutton,'visible',on_off);
4242
end

0 commit comments

Comments
 (0)