IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
uip_vis_image.m
Go to the documentation of this file.
1 %> @ingroup guigroup
2 %> @file
3 %> @brief Properties Window for @ref vis_image
4 %> @image html Screenshot-uip_vis_image.png
5 %>
6 %> <b>Mode</b> - see vis_image::mode
7 %>
8 %> <b>Index of feature</b> - see vis_image::idx_fea
9 %>
10 %> @sa vis_image
11 
12 %> @cond
13 function varargout = uip_vis_image(varargin)
14 % Last Modified by GUIDE v2.5 11-Jun-2011 02:11:13
15 
16 % Begin initialization code - DO NOT EDIT
17 gui_Singleton = 1;
18 gui_State = struct('gui_Name', mfilename, ...
19  'gui_Singleton', gui_Singleton, ...
20  'gui_OpeningFcn', @uip_vis_image_OpeningFcn, ...
21  'gui_OutputFcn', @uip_vis_image_OutputFcn, ...
22  'gui_LayoutFcn', [] , ...
23  'gui_Callback', []);
24 if nargin && ischar(varargin{1})
25  gui_State.gui_Callback = str2func(varargin{1});
26 end
27 
28 if nargout
29  [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
30 else
31  gui_mainfcn(gui_State, varargin{:});
32 end
33 % End initialization code - DO NOT EDIT
34 
35 
36 % --- Executes just before uip_vis_image is made visible.
37 function uip_vis_image_OpeningFcn(hObject, eventdata, handles, varargin)
38 handles.input.block = varargin{1};
39 if nargin > 4
40  handles.input.data = varargin{2};
41 else
42  handles.input.data = [];
43 end;
44 handles.output.flag_ok = 0;
45 guidata(hObject, handles);
46 gui_set_position(hObject);
47 
48 %#################################################################################################
49 
50 %#########
51 function preview(handles)
52 data = handles.input.data;
53 if isempty(data)
54  irerrordlg('Dataset not specified!', 'Cannot preview');
55 end;
56 o = handles.input.block;
57 eval(['o = o.setbatch(', params2str(get_params(handles)), ');']);
58 o.flag_set_position = 0;
59 cla(handles.axes1, 'reset');
60 axes(handles.axes1);
61 o = o.use(data);
62 title('');
63 
64 %#########
65 function params = get_params(handles)
66 
67 params = {...
68 'mode', int2str(get(handles.popupmenu_mode, 'Value')-1), ...
69 'idx_fea', int2str(eval(get(handles.edit_idx_fea, 'String'))) ...
70 };
71 
72 
73 
74 %#################################################################################################
75 
76 
77 % --- Outputs from this function are returned to the command clae.
78 function varargout = uip_vis_image_OutputFcn(hObject, eventdata, handles)
79 try
80  uiwait(handles.figure1);
81  handles = guidata(hObject);
82  varargout{1} = handles.output;
83  delete(gcf);
84 catch
85  output.flag_ok = 0;
86  output.params = {};
87  varargout{1} = output;
88 end;
89 
90 % --- Executes on button press in pushbuttonOK.
91 function pushbuttonOK_Callback(hObject, eventdata, handles)
92 try
93  handles.output.params = get_params(handles);
94  handles.output.flag_ok = 1;
95  guidata(hObject, handles);
96  uiresume();
97 catch ME
98  irerrordlg(ME.message, 'Cannot continue');
99 
100 end;
101 
102 % --- Executes on selection change in popupmenu_mode.
103 function popupmenu_mode_Callback(hObject, eventdata, handles)
104 
105 % --- Executes during object creation, after setting all properties.
106 function popupmenu_mode_CreateFcn(hObject, eventdata, handles)
107 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
108  set(hObject,'BackgroundColor','white');
109 end
110 
111 function edit_idx_fea_Callback(hObject, eventdata, handles)
112 
113 % --- Executes during object creation, after setting all properties.
114 function edit_idx_fea_CreateFcn(hObject, eventdata, handles)
115 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
116  set(hObject,'BackgroundColor','white');
117 end
118 
119 % --- Executes on button press in pushbutton_preview.
120 function pushbutton_preview_Callback(hObject, eventdata, handles)
121 preview(handles);
122 %> @endcond
Property mode
=0. 0: feature; 1: class; 2: y
Definition: vis_image.m:10
function params2str(in params, in flag_o)
function setbatch(in o, in params)
Base Block class.
Definition: block.m:2
Property idx_fea
=1. Index of feature in case mode is 0.
Definition: vis_image.m:13
function gui_set_position(in hObject)
Image map.
Definition: vis_image.m:4
function irerrordlg(in errorstring, in dlgname)