1 / 23

Graphic User Interface

Graphic User Interface. Review of Lecture 1 to Lecture 6 C.F. Lu. Basic idea of GUI. LECTURE 1. Example: grandmom = figure; mom = axes( ‘parent’ ,grandmom); child = image( ‘parent’ ,mom);. Root. Figures. UI controls. Axes. UI Menus. Images. Lines. Patches. Surfaces. Texts.

victorsnow
Download Presentation

Graphic User Interface

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Graphic User Interface Review of Lecture 1 to Lecture 6 C.F. Lu

  2. Basic idea of GUI LECTURE 1

  3. Example: grandmom = figure; mom = axes(‘parent’,grandmom); child = image(‘parent’,mom); Root Figures UI controls Axes UI Menus Images Lines Patches Surfaces Texts Lighting

  4. Your Good Friendsin command window • help • help function_name, ex:help min • set • set(handle), ex: set(uicontrol) • get • get(handle), ex: get(axes)

  5. Structure of the GUI Functionif …elseif…end

  6. Callback property LECTURE 2

  7. Your Good Friendsin Callback • global • global variables, ex:global handle Data • uicontrol • uicontrol(‘Callback’, ‘function_name(“action”)’) ex: uicontrol(‘Callback’,’GUI(“quit”)’) • if…elseif…end • elseif strcmp(action, ’quit’)

  8. Popup uicontrol & filters LECTURE 3

  9. Your Good Friendsin popup uicontrol • uicontrol(‘Style’,…,’String’,…,’Callback’,…) • ex: uicontrol(‘Style’, ’popup’,… ’String’, ‘ I love you | I hate you’,… ‘Callback’, ‘GUI(“pop”)’) • switch…case…end • ex: switch get(handle.pop,’value’) case 1 fprintf(‘Thank you. You are a good man.’) case 2 fprintf(‘Really? Me too.’) end

  10. Your Good Friendsin filtering • filter array • smooth high pass • conv2(image,filter,’same’)

  11. ROI rubber band & correlation LECTURE 4

  12. Your Good Friendsin ROI rubber band • set(image, ’ButtonDownFcn’,…) set(figure, ’WindowButtonMotionFcn’,…) set(figure, ’WindowButtonUpFcn’,…) • set(line, ‘color’, ’b’ , ’lineStyle’, ‘--’,… ‘Xdata’, [pt1(1) pt2(1) pt2(1) pt1(1) pt1(1)],… ‘Ydata’, [pt1(2) pt1(2) pt2(2) pt2(2) pt1(2)],… ‘EraseMode’,’xor’) pt1 pt2

  13. Your Good Friendsin ROI rubber band • pt1 = get(axes, ‘CurrentPoint’) pt1 = pt1(1,1:2) • Axes location  Matrix index • x  col • y  row (x, y) (row, col) x y (reversed)

  14. Tag & UserData properties LECTURE 5

  15. Your Good Friendsin information communication • global  handles and variables • Tag property  handles • set(axes, ’Tag’, ’sub1’) • sub1=findobj(gcf, ’Tag’, ‘sub1’) • UserData property  variables • set(gcf, ’UserData’, Data) • Data = get(gcf, ’UserData’)

  16. Slider & re-contrast with histogram LECTURE 6

  17. Your Good Friendsin slider bar • uicontrol(‘Style’,’slider’,… ‘Min’, 1,’Max’, 100,… ‘SliderStep’,[ 1 10],… ‘Value’,20) • get(handle_slider,’value’) • round(get(handle_slider,’value’))

  18. Your Good Friendsin axes & line • Set(axes, ’Xlim’,[0 100], ‘Ylim’, [0 1000],… ‘XColor’, ’blue’, ’YColor’, ’red’,… ‘XTickmode’, ’manual’,… ‘XTick’,[0:10:100]) • set(line, ’ButtonDownFcn’,…) set(figure, ’WindowButtonMotionFcn’,…) set(figure, ’WindowButtonUpFcn’,…)

  19. Your Good Friendsin re-contrast • Image=image-newmin; • Image=image/(newmax-newmin); newmin newmax

  20. THE END Thanks for your attention^^

More Related