summaryrefslogtreecommitdiff
path: root/gui_win.m
diff options
context:
space:
mode:
authorMi Zhang <mzhang@email.wm.edu>2012-09-12 16:42:19 -0400
committerMi Zhang <mzhang@email.wm.edu>2012-09-12 16:42:19 -0400
commit7fedb64c474fc8cb3bab62c84801a015fcf275fe (patch)
tree5cb8ae565e6308368f5bf6636b030b6a1b751a45 /gui_win.m
parent82d93fcaf23aa3bc0b81b7b0d8b4677d135dbf33 (diff)
downloadbeam_profiler-7fedb64c474fc8cb3bab62c84801a015fcf275fe.tar.gz
beam_profiler-7fedb64c474fc8cb3bab62c84801a015fcf275fe.zip
first attempt to draw the cross, succeed randomly
Diffstat (limited to 'gui_win.m')
-rw-r--r--gui_win.m38
1 files changed, 33 insertions, 5 deletions
diff --git a/gui_win.m b/gui_win.m
index ea7c947..580cda0 100644
--- a/gui_win.m
+++ b/gui_win.m
@@ -74,6 +74,7 @@ global image_m;
global image_original;
global image_cleaned;
global image_fitted;
+global image_cross;
% Initial values
background_m = 0;
@@ -82,6 +83,7 @@ image_original = 0;
image_cleaned = 0;
image_fitted = 0;
image_name = 'test.png';
+image_cross = 0;
isworking = 0;
% Don`t show ticks for the minor windows
@@ -310,6 +312,7 @@ global isworking;
global image_m;
global background_m;
global image_fitted;
+global image_cross;
if (isworking == 1)
else
@@ -407,6 +410,22 @@ h = plot(fit(tcy,:));
set(h,'Color','blue','LineWidth',2);
hold off;
+%To display the intersection
+max1=max(image_m(:));
+image_cross=image_m;
+
+for y=1:480
+ image_cross(y,tcx) = max1;
+end;
+
+for x=1:640
+ image_cross(tcy,x) = max1;
+end;
+image_m=image_cross;
+
+display_stuff(handles);
+
+
%Here we plot the ideal fitted image
@@ -742,6 +761,7 @@ global image_m;
global image_original;
global image_cleaned;
global image_fitted;
+global image_cross;
if get(handles.radiobutton7,'Value')
image_m=image_original;
display_stuff(handles);
@@ -750,18 +770,26 @@ else
if image_cleaned == 0
set(handles.radiobutton7,'Value',1);
else
- image_m=image_cleaned;
- display_stuff(handles);
+ if image_cross == 0;
+ image_m=image_cleaned;
+ display_stuff(handles);
+ else
+ image_m = image_cross;
+ display_stuff(handles);
+ end;
end;
else
if get(handles.radiobutton9,'Value')
if image_fitted == 0
set(handles.radiobutton7,'Value',1);
- image_m=image_original;
- display_stuff(handles);
+ if image_m == 0
+ else
+ image_m = image_original;
+ display_stuff(handles);
+ end;
else
image_m=image_fitted;
- display_stuff(handles);
+ display_stuff(handles);
end;
end;
end;