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