summaryrefslogtreecommitdiff
path: root/gui_win.m
diff options
context:
space:
mode:
Diffstat (limited to 'gui_win.m')
-rw-r--r--gui_win.m303
1 files changed, 162 insertions, 141 deletions
diff --git a/gui_win.m b/gui_win.m
index d76772d..e17e9d0 100644
--- a/gui_win.m
+++ b/gui_win.m
@@ -22,7 +22,7 @@ function varargout = gui_win(varargin)
% Edit the above text to modify the response to help gui_win
-% Last Modified by GUIDE v2.5 12-Sep-2012 18:53:14
+% Last Modified by GUIDE v2.5 17-Sep-2012 11:55:33
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
@@ -64,7 +64,7 @@ handles.output = hObject;
guidata(hObject, handles);
% Set color of the strart button to green
-set(handles.togglebutton1,'BackgroundColor','Green');
+set(handles.button2start,'BackgroundColor','Green');
% Declare global variables
global background_m;
@@ -87,9 +87,9 @@ image_cross = 0;
isworking = 0;
% Don`t show ticks for the minor windows
-set(handles.axes6,'PlotBoxAspectRatio',[4 3 1],'DataAspectRatio',[1 1 1],'YTick',[],'XTick',[]);
-set(handles.xsection,'PlotBoxAspectRatio',[4 3 1],'DataAspectRatio',[1 1 1],'YTick',[],'XTick',[]);
-set(handles.ysection,'PlotBoxAspectRatio',[4 3 1],'DataAspectRatio',[1 1 1],'YTick',[],'XTick',[]);
+set(handles.backgrounddisplay,'PlotBoxAspectRatio',[4 3 1],'DataAspectRatio',[1 1 1],'YTick',[],'XTick',[]);
+set(handles.xsectiondisplay,'PlotBoxAspectRatio',[4 3 1],'DataAspectRatio',[1 1 1],'YTick',[],'XTick',[]);
+set(handles.ysectiondisplay,'PlotBoxAspectRatio',[4 3 1],'DataAspectRatio',[1 1 1],'YTick',[],'XTick',[]);
@@ -115,7 +115,7 @@ function grabimage(handles)
global image_name;
global image_display;
global image_original;
-run_string = horzcat('grabNimages_1394cam.exe -s ',num2str(get(handles.edit2,'String')),' -n ',num2str(get(handles.edit3,'String')));
+run_string = horzcat('grabNimages_1394cam.exe -s ',num2str(get(handles.readshutterspeed,'String')),' -n ',num2str(get(handles.readnumber,'String')));
system(run_string);
img=imread(image_name);
image_display=double(img);
@@ -132,19 +132,19 @@ global background_m;
% If we need to substract the background, we do it
% background_m is a global variable
-if get(handles.togglebutton2,'Value') > 0
+if get(handles.button2substract,'Value') > 0
m = image_display - background_m;
else
m = image_display;
end;
% Read the tolerance value from the GUI
-tol = str2num(get(handles.edit1,'String'));
+tol = str2num(get(handles.readtolerance,'String'));
% Display what we have before doing fit
-axes(handles.original_image);
+axes(handles.image2display);
imagesc(m);
-set(handles.original_image,'PlotBoxAspectRatio',[4 3 1],'DataAspectRatio',[1 1 1]);
+set(handles.image2display,'PlotBoxAspectRatio',[4 3 1],'DataAspectRatio',[1 1 1]);
drawnow;
@@ -154,13 +154,13 @@ drawnow;
% This function is executed when START button is pressed.
% We do different stuff depending on the radiobutton selection
-% --- Executes on button press in togglebutton1.
-function togglebutton1_Callback(hObject, eventdata, handles)
-% hObject handle to togglebutton1 (see GCBO)
+% --- Executes on button press in button2start.
+function button2start_Callback(hObject, eventdata, handles)
+% hObject handle to button2start (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
-% Hint: get(hObject,'Value') returns toggle state of togglebutton1
+% Hint: get(hObject,'Value') returns toggle state of button2start
global isworking;
global image_display;
@@ -168,16 +168,16 @@ global image_cleaned;
global image_fitted;
image_cleaned = 0;
image_fitted = 0;
-set(handles.checkbox2,'Value',0);
-set(handles.radiobutton7,'Value',1);
+set(handles.showcross,'Value',0);
+set(handles.chooseoriginal,'Value',1);
if image_display > 0
image_display = image_original;
display_stuff(handles);
end;
isworking =1;
% Paint the button and change text
-set(handles.togglebutton1,'BackgroundColor','Red');
-set(handles.togglebutton1,'String','STOP');
+set(handles.button2start,'BackgroundColor','Red');
+set(handles.button2start,'String','STOP');
drawnow; % needed to draw this before doing fit
@@ -185,7 +185,7 @@ drawnow; % needed to draw this before doing fit
% This is for the single run
-if get(handles.radiobutton2,'Value')
+if get(handles.button2singlerun,'Value')
% Grab an image from camera
grabimage(handles);
@@ -199,8 +199,8 @@ end;
% This executes when we do the continious run
% Same as the single fit exept that we have a while cycle
-if get(handles.radiobutton3,'Value')
- while get(handles.togglebutton1,'Value') > 0
+if get(handles.button2comtinuousrun,'Value')
+ while get(handles.button2start,'Value') > 0
grabimage(handles);
display_stuff(handles);
end;
@@ -209,9 +209,9 @@ end;
% Paint it back
-set(handles.togglebutton1,'Value',0);
-set(handles.togglebutton1,'BackgroundColor','Green');
-set(handles.togglebutton1,'String','START');
+set(handles.button2start,'Value',0);
+set(handles.button2start,'BackgroundColor','Green');
+set(handles.button2start,'String','START');
drawnow;
isworking =0;
@@ -222,16 +222,16 @@ isworking =0;
% Also here we check if we want to choose a file from a the file-open
% dialog
-% --- Executes when selected object is changed in uipanel1.
-function uipanel1_SelectionChangeFcn(hObject, eventdata, handles)
-% hObject handle to the selected object in uipanel1
+% --- Executes when selected object is changed in workstylechoise.
+function workstylechoise_SelectionChangeFcn(hObject, eventdata, handles)
+% hObject handle to the selected object in workstylechoise
% eventdata structure with the following fields (see UIBUTTONGROUP)
% EventName: string 'SelectionChanged' (read only)
% OldValue: handle of the previously selected object or empty if none was selected
% NewValue: handle of the currently selected object
% handles structure with handles and user data (see GUIDATA)
-set(handles.togglebutton1,'Value',0);
+set(handles.button2start,'Value',0);
global isworking;
global image_display;
global image_original;
@@ -241,8 +241,8 @@ global image_fitted;
image_cleaned = 0;
image_fitted = 0;
isworking =1;
-set(handles.radiobutton7,'Value',1);
-set(handles.checkbox2,'Value',0);
+set(handles.chooseoriginal,'Value',1);
+set(handles.showcross,'Value',0);
if image_display > 0
image_display = image_original;
display_stuff(handles);
@@ -250,11 +250,11 @@ end;
% This calls a file-open dialog and runs the beam profiler on the choosen
% file
-if get(handles.radiobutton4,'Value')
- set(handles.checkbox2,'Value',0);
- set(handles.togglebutton1,'Value',1);
- set(handles.togglebutton1,'BackgroundColor','Red');
- set(handles.togglebutton1,'String','STOP');
+if get(handles.button2loadimage,'Value')
+ set(handles.showcross,'Value',0);
+ set(handles.button2start,'Value',1);
+ set(handles.button2start,'BackgroundColor','Red');
+ set(handles.button2start,'String','STOP');
drawnow;
if ~isstr(pathname) % undefined variables are 0
@@ -272,10 +272,10 @@ if get(handles.radiobutton4,'Value')
end;
- set(handles.radiobutton4,'Value',0);
- set(handles.togglebutton1,'BackgroundColor','Green');
- set(handles.togglebutton1,'Value',0);
- set(handles.togglebutton1,'String','START');
+ set(handles.button2loadimage,'Value',0);
+ set(handles.button2start,'BackgroundColor','Green');
+ set(handles.button2start,'Value',0);
+ set(handles.button2start,'String','START');
end;
isworking =0;
@@ -283,28 +283,35 @@ isworking =0;
% Executes when we press Clean button
-% --- Executes on button press in pushbutton10.
-function pushbutton10_Callback(hObject, eventdata, handles)
-% hObject handle to pushbutton10 (see GCBO)
+% --- Executes on button press in button2clean.
+function button2clean_Callback(hObject, eventdata, handles)
+% hObject handle to button2clean (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global isworking;
global image_display;
global image_cleaned;
global image_negative;
+global background_m;
+
+%If background subtraction is on
+if get(handles.button2substract,'Value') > 0
+ image_display = image_display - background_m;
+end;
+
if (isworking == 1)
else
isworking = 1;
- set(handles.pushbutton10,'String','Working');
- if get(handles.checkbox2,'Value')
- set(handles.checkbox2,'Value',0);
+ set(handles.button2clean,'String','Working');
+ if get(handles.showcross,'Value')
+ set(handles.showcross,'Value',0);
image_display=image_display+image_negative;
end;
%read the attenuation from the GUI
- filter = str2num(get(handles.edit4,'String'));
- radius = str2num(get(handles.edit5,'String'));
+ filter = str2num(get(handles.readstrength,'String'));
+ radius = str2num(get(handles.readrange,'String'));
%clean the image with the stripe eraser
[image_cleaned,~]=stripeeraser(image_display,radius,filter);
@@ -312,8 +319,8 @@ else
image_display=image_cleaned;
display_stuff(handles);
- set(handles.pushbutton10,'String','Clean');
- set(handles.radiobutton8,'Value',1);
+ set(handles.button2clean,'String','Clean');
+ set(handles.choosecleaned,'Value',1);
end;
isworking = 0;
@@ -322,9 +329,9 @@ isworking = 0;
% Executes when we press Fit button
-% --- Executes on button press in pushbutton8.
-function pushbutton8_Callback(hObject, eventdata, handles)
-% hObject handle to pushbutton8 (see GCBO)
+% --- Executes on button press in button2fit.
+function button2fit_Callback(hObject, eventdata, handles)
+% hObject handle to button2fit (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
@@ -337,9 +344,9 @@ global image_cross;
if (isworking == 1)
else
isworking = 1;
-set(handles.pushbutton8,'String','Working');
+set(handles.button2fit,'String','Working');
-axes(handles.original_image);
+axes(handles.image2display);
[x,y] = ginput(1);
cx = x(1);
cy = y(1);
@@ -347,7 +354,7 @@ cy = y(1);
% If we need to substract the background, we do it
% background_m is a global variable
-if get(handles.togglebutton2,'Value') > 0
+if get(handles.button2substract,'Value') > 0
m = image_display - background_m;
else
m = image_display;
@@ -355,7 +362,7 @@ end;
% Read the tolerance value from the GUI
-tol = str2num(get(handles.edit1,'String'));
+tol = str2num(get(handles.readtolerance,'String'));
% Here we do our fit. Output is a vector with gauss parameters
@@ -372,7 +379,7 @@ theta = p(6);
background=p(7);
% Display them into the table in GUI
-set(handles.uitable1,'Data',p')
+set(handles.fitparameters,'Data',p')
% This is for drawing fitted gaussian
[sizey sizex] = size(m);
@@ -414,7 +421,7 @@ end;
% Here we draw crossections
hold off;
-axes(handles.ysection);
+axes(handles.ysectiondisplay);
h = plot(m(:,tcx));
hold on;
set(h,'Color','red','LineWidth',2);
@@ -422,7 +429,7 @@ h = plot(fit(:,tcx));
set(h,'Color','blue','LineWidth',2);
hold off;
-axes(handles.xsection);
+axes(handles.xsectiondisplay);
h = plot(m(tcy,:));
set(h,'Color','red','LineWidth',2);
hold on;
@@ -449,7 +456,7 @@ end;
-set(handles.pushbutton8,'String','Fit');
+set(handles.button2fit,'String','Fit');
end;
isworking = 0;
@@ -460,20 +467,20 @@ isworking = 0;
%background substraction
%here we only toggle on/off
-% --- Executes on button press in togglebutton2.
-function togglebutton2_Callback(hObject, eventdata, handles)
-% hObject handle to togglebutton2 (see GCBO)
+% --- Executes on button press in button2substract.
+function button2substract_Callback(hObject, eventdata, handles)
+% hObject handle to button2substract (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
-% Hint: get(hObject,'Value') returns toggle state of togglebutton2
+% Hint: get(hObject,'Value') returns toggle state of button2substract
-if get(handles.togglebutton2,'Value') > 0
+if get(handles.button2substract,'Value') > 0
- set(handles.togglebutton2,'String','ON');
+ set(handles.button2substract,'String','ON');
else
- set(handles.togglebutton2,'String','OFF');
+ set(handles.button2substract,'String','OFF');
end;
@@ -483,9 +490,9 @@ end;
%image saving
-% --- Executes on button press in pushbutton3.
-function pushbutton3_Callback(hObject, eventdata, handles)
-% hObject handle to pushbutton3 (see GCBO)
+% --- Executes on button press in button2save.
+function button2save_Callback(hObject, eventdata, handles)
+% hObject handle to button2save (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global image_name;
@@ -493,7 +500,7 @@ global image_display;
%fname_to_save = horzcat(pwd,filesep,'saved_images',filesep,datestr(now, 'yyyy_mm_dd_HHMMSS'),'.png');
fname_to_save = horzcat('Z:\beam_profier images',filesep,datestr(now, 'yyyy_mm_dd_HHMMSS'),'.png');
-set(handles.text12,'String',horzcat('Image saved to: ',fname_to_save));
+set(handles.picsavepath,'String',horzcat('Image saved to: ',fname_to_save));
image_to_save=uint16(image_display);
imwrite(image_to_save,fname_to_save,'png','bitdepth',16);
@@ -504,9 +511,9 @@ imwrite(image_to_save,fname_to_save,'png','bitdepth',16);
% This executes when we want to grab the background from the camera
-% --- Executes on button press in pushbutton4.
-function pushbutton4_Callback(hObject, eventdata, handles)
-% hObject handle to pushbutton4 (see GCBO)
+% --- Executes on button press in Grabfromcamera.
+function Grabfromcamera_Callback(hObject, eventdata, handles)
+% hObject handle to Grabfromcamera (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
@@ -517,18 +524,18 @@ isworking =1;
grabimage(handles);
background_m = image_display;
-axes(handles.axes6);
+axes(handles.backgrounddisplay);
imagesc(background_m);
-set(handles.axes6,'PlotBoxAspectRatio',[4 3 1],'DataAspectRatio',[1 1 1],'YTick',[],'XTick',[]);
+set(handles.backgrounddisplay,'PlotBoxAspectRatio',[4 3 1],'DataAspectRatio',[1 1 1],'YTick',[],'XTick',[]);
drawnow;
isworking =0;
% This executes when we want to choose the background from a file
-% --- Executes on button press in pushbutton5.
-function pushbutton5_Callback(hObject, eventdata, handles)
-% hObject handle to pushbutton5 (see GCBO)
+% --- Executes on button press in readfromfile.
+function readfromfile_Callback(hObject, eventdata, handles)
+% hObject handle to readfromfile (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
@@ -545,9 +552,9 @@ else
img=imread(fullfile(pathname,filename));
background_m = double(img);
- axes(handles.axes6);
+ axes(handles.backgrounddisplay);
imagesc(background_m);
- set(handles.axes6,'PlotBoxAspectRatio',[4 3 1],'DataAspectRatio',[1 1 1],'YTick',[],'XTick',[]);
+ set(handles.backgrounddisplay,'PlotBoxAspectRatio',[4 3 1],'DataAspectRatio',[1 1 1],'YTick',[],'XTick',[]);
drawnow;
end;
@@ -597,18 +604,18 @@ end
-function edit2_Callback(hObject, eventdata, handles)
-% hObject handle to edit2 (see GCBO)
+function readshutterspeed_Callback(hObject, eventdata, handles)
+% hObject handle to readshutterspeed (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
-% Hints: get(hObject,'String') returns contents of edit2 as text
-% str2double(get(hObject,'String')) returns contents of edit2 as a double
+% Hints: get(hObject,'String') returns contents of readshutterspeed as text
+% str2double(get(hObject,'String')) returns contents of readshutterspeed as a double
% --- Executes during object creation, after setting all properties.
-function edit2_CreateFcn(hObject, eventdata, handles)
-% hObject handle to edit2 (see GCBO)
+function readshutterspeed_CreateFcn(hObject, eventdata, handles)
+% hObject handle to readshutterspeed (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
@@ -620,18 +627,18 @@ end
-function edit3_Callback(hObject, eventdata, handles)
-% hObject handle to edit3 (see GCBO)
+function readnumber_Callback(hObject, eventdata, handles)
+% hObject handle to readnumber (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
-% Hints: get(hObject,'String') returns contents of edit3 as text
-% str2double(get(hObject,'String')) returns contents of edit3 as a double
+% Hints: get(hObject,'String') returns contents of readnumber as text
+% str2double(get(hObject,'String')) returns contents of readnumber as a double
% --- Executes during object creation, after setting all properties.
-function edit3_CreateFcn(hObject, eventdata, handles)
-% hObject handle to edit3 (see GCBO)
+function readnumber_CreateFcn(hObject, eventdata, handles)
+% hObject handle to readnumber (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
@@ -642,18 +649,18 @@ if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgr
end
-function edit1_Callback(hObject, eventdata, handles)
-% hObject handle to edit1 (see GCBO)
+function readtolerance_Callback(hObject, eventdata, handles)
+% hObject handle to readtolerance (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
-% Hints: get(hObject,'String') returns contents of edit1 as text
-% str2double(get(hObject,'String')) returns contents of edit1 as a double
+% Hints: get(hObject,'String') returns contents of readtolerance as text
+% str2double(get(hObject,'String')) returns contents of readtolerance as a double
% --- Executes during object creation, after setting all properties.
-function edit1_CreateFcn(hObject, eventdata, handles)
-% hObject handle to edit1 (see GCBO)
+function readtolerance_CreateFcn(hObject, eventdata, handles)
+% hObject handle to readtolerance (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
@@ -665,12 +672,12 @@ end
% --- Executes during object creation, after setting all properties.
-function original_image_CreateFcn(hObject, eventdata, handles)
-% hObject handle to original_image (see GCBO)
+function image2display_CreateFcn(hObject, eventdata, handles)
+% hObject handle to image2display (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
-% Hint: place code in OpeningFcn to populate original_image
+% Hint: place code in OpeningFcn to populate image2display
% --- Executes on button press in checkbox1.
@@ -690,18 +697,18 @@ function pushbutton7_Callback(hObject, eventdata, handles)
-function edit4_Callback(hObject, eventdata, handles)
-% hObject handle to edit4 (see GCBO)
+function readstrength_Callback(hObject, eventdata, handles)
+% hObject handle to readstrength (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
-% Hints: get(hObject,'String') returns contents of edit4 as text
-% str2double(get(hObject,'String')) returns contents of edit4 as a double
+% Hints: get(hObject,'String') returns contents of readstrength as text
+% str2double(get(hObject,'String')) returns contents of readstrength as a double
% --- Executes during object creation, after setting all properties.
-function edit4_CreateFcn(hObject, eventdata, handles)
-% hObject handle to edit4 (see GCBO)
+function readstrength_CreateFcn(hObject, eventdata, handles)
+% hObject handle to readstrength (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
@@ -713,18 +720,18 @@ end
-function edit5_Callback(hObject, eventdata, handles)
-% hObject handle to edit5 (see GCBO)
+function readrange_Callback(hObject, eventdata, handles)
+% hObject handle to readrange (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
-% Hints: get(hObject,'String') returns contents of edit5 as text
-% str2double(get(hObject,'String')) returns contents of edit5 as a double
+% Hints: get(hObject,'String') returns contents of readrange as text
+% str2double(get(hObject,'String')) returns contents of readrange as a double
% --- Executes during object creation, after setting all properties.
-function edit5_CreateFcn(hObject, eventdata, handles)
-% hObject handle to edit5 (see GCBO)
+function readrange_CreateFcn(hObject, eventdata, handles)
+% hObject handle to readrange (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
@@ -736,32 +743,32 @@ end
% --- If Enable == 'on', executes on mouse press in 5 pixel border.
-% --- Otherwise, executes on mouse press in 5 pixel border or over radiobutton4.
-function radiobutton4_ButtonDownFcn(hObject, eventdata, handles)
-% hObject handle to radiobutton4 (see GCBO)
+% --- Otherwise, executes on mouse press in 5 pixel border or over button2loadimage.
+function button2loadimage_ButtonDownFcn(hObject, eventdata, handles)
+% hObject handle to button2loadimage (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --------------------------------------------------------------------
-function uipanel1_ButtonDownFcn(hObject, eventdata, handles)
-% hObject handle to uipanel1 (see GCBO)
+function workstylechoise_ButtonDownFcn(hObject, eventdata, handles)
+% hObject handle to workstylechoise (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes during object creation, after setting all properties.
-function uipanel4_CreateFcn(hObject, eventdata, handles)
-% hObject handle to uipanel4 (see GCBO)
+function displaychoise_CreateFcn(hObject, eventdata, handles)
+% hObject handle to displaychoise (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
%Choose imgae to display
-% --- Executes when selected object is changed in uipanel4.
-function uipanel4_SelectionChangeFcn(hObject, eventdata, handles)
-% hObject handle to the selected object in uipanel4
+% --- Executes when selected object is changed in displaychoise.
+function displaychoise_SelectionChangeFcn(hObject, eventdata, handles)
+% hObject handle to the selected object in displaychoise
% eventdata structure with the following fields (see UIBUTTONGROUP)
% EventName: string 'SelectionChanged' (read only)
% OldValue: handle of the previously selected object or empty if none was selected
@@ -771,22 +778,22 @@ global image_display;
global image_original;
global image_cleaned;
global image_fitted;
-set(handles.checkbox2,'Value',0);
-if get(handles.radiobutton7,'Value')
+set(handles.showcross,'Value',0);
+if get(handles.chooseoriginal,'Value')
image_display=image_original;
display_stuff(handles);
else
- if get(handles.radiobutton8,'Value')
+ if get(handles.choosecleaned,'Value')
if image_cleaned == 0
- set(handles.radiobutton7,'Value',1);
+ set(handles.chooseoriginal,'Value',1);
else
image_display=image_cleaned;
display_stuff(handles);
end;
else
- if get(handles.radiobutton9,'Value')
+ if get(handles.choosefitted,'Value')
if image_fitted == 0
- set(handles.radiobutton7,'Value',1);
+ set(handles.chooseoriginal,'Value',1);
if image_display == 0
else
image_display = image_original;
@@ -803,22 +810,26 @@ end;
%To show the cross on the screen
-% --- Executes on button press in checkbox2.
-function checkbox2_Callback(hObject, eventdata, handles)
-% hObject handle to checkbox2 (see GCBO)
+% --- Executes on button press in showcross.
+function showcross_Callback(hObject, eventdata, handles)
+% hObject handle to showcross (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global image_display;
global image_cross;
global image_negative;
global image_original;
+global background_m;
+if get(handles.button2substract,'Value') > 0
+ image_display = image_display - background_m;
+end;
[sizey sizex] = size(image_display);
image_cross=image_display;
-if get(handles.checkbox2,'Value')
+if get(handles.showcross,'Value')
if image_display == 0
- set(handles.checkbox2,'Value',0)
+ set(handles.showcross,'Value',0)
else
[x0,y0]=ginput(1);
x0=round(x0);
@@ -827,14 +838,14 @@ if get(handles.checkbox2,'Value')
% Here we draw crossections
hold off;
- axes(handles.ysection);
+ axes(handles.ysectiondisplay);
h = plot(image_display(:,x0));
hold on;
set(h,'Color','red','LineWidth',2);
hold off;
- axes(handles.xsection);
+ axes(handles.xsectiondisplay);
h = plot(image_display(y0,:));
set(h,'Color','red','LineWidth',2);
@@ -860,12 +871,22 @@ end;
-% Hint: get(hObject,'Value') returns toggle state of checkbox2
+% Hint: get(hObject,'Value') returns toggle state of showcross
% --- If Enable == 'on', executes on mouse press in 5 pixel border.
-% --- Otherwise, executes on mouse press in 5 pixel border or over pushbutton8.
-function pushbutton8_ButtonDownFcn(hObject, eventdata, handles)
-% hObject handle to pushbutton8 (see GCBO)
+% --- Otherwise, executes on mouse press in 5 pixel border or over button2fit.
+function button2fit_ButtonDownFcn(hObject, eventdata, handles)
+% hObject handle to button2fit (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
+
+
+% --- Executes on key press with focus on button2comtinuousrun and none of its controls.
+function button2comtinuousrun_KeyPressFcn(hObject, eventdata, handles)
+% hObject handle to button2comtinuousrun (see GCBO)
+% eventdata structure with the following fields (see UICONTROL)
+% Key: name of the key that was pressed, in lower case
+% Character: character interpretation of the key(s) that was pressed
+% Modifier: name(s) of the modifier key(s) (i.e., control, shift) pressed
+% handles structure with handles and user data (see GUIDATA)