Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "Graphic User Interface Review of Lecture 1 to Lecture 6 C.F. Lu."— Presentation transcript:

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

2 LECTURE 1 Basic idea of GUI

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

4 Your Good Friends in 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 Function if …elseif…end

6 LECTURE 2 Callback property

7 Your Good Friends in 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

9 LECTURE 3 Popup uicontrol & filters

10 Your Good Friends in 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

11

12 Your Good Friends in filtering filter array – smooth high pass conv2(image,filter,’same’)

13 LECTURE 4 ROI rubber band & correlation

14 Your Good Friends in 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

15

16 Your Good Friends in ROI rubber band pt1 = get(axes, ‘CurrentPoint’) pt1 = pt1(1,1:2) Axes location  Matrix index – x  col – y  row x y (reversed) (x, y) (row, col)

17 LECTURE 5 Tag & UserData properties

18 Your Good Friends in 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’)

19 LECTURE 6 Slider & re-contrast with histogram

20 Your Good Friends in slider bar uicontrol(‘Style’,’slider’,… ‘Min’, 1,’Max’, 100,… ‘SliderStep’,[ 1 10],… ‘Value’,20) get(handle_slider,’value’) – round(get(handle_slider,’value’))

21 Your Good Friends in 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’,…)

22 Your Good Friends in re-contrast Image=image-newmin; Image=image/(newmax-newmin); newminnewmax

23 THE END Thanks for your attention^^


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

Similar presentations


Ads by Google