From ae7f69346a37dd19c14b14ef2a2a3c8583f64a8c Mon Sep 17 00:00:00 2001 From: Mi Zhang Date: Thu, 13 Sep 2012 16:34:24 -0400 Subject: draw crosssections --- gui_win.m | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'gui_win.m') diff --git a/gui_win.m b/gui_win.m index 7f99f0e..d599f41 100644 --- a/gui_win.m +++ b/gui_win.m @@ -803,8 +803,11 @@ function checkbox2_Callback(hObject, eventdata, handles) global image_display; global image_cross; global image_negative; +global image_original; [sizey sizex] = size(image_display); image_cross=image_display; + + if get(handles.checkbox2,'Value') if image_display == 0 set(handles.checkbox2,'Value',0) @@ -814,6 +817,21 @@ if get(handles.checkbox2,'Value') y0=round(y0); max2 = max(image_display(:)); + % Here we draw crossections + hold off; + axes(handles.ysection); + h = plot(image_display(:,x0)); + hold on; + set(h,'Color','red','LineWidth',2); + + + hold off; + axes(handles.xsection); + h = plot(image_display(y0,:)); + set(h,'Color','red','LineWidth',2); + + + %draw cross on the image for y=1:sizey image_cross(y,x0) = max(max2,image_display(y,x0)); @@ -831,6 +849,9 @@ else display_stuff(handles); end; + + + % Hint: get(hObject,'Value') returns toggle state of checkbox2 -- cgit v1.2.3