IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
uip_subsetsprocessor.m
Go to the documentation of this file.
1 %> @ingroup guigroup
2 %> @file uip_subsetsprocessor.m
3 %> @brief Properties Window for @ref subsetsprocessor
4 %> @sa subsetsprocessor
5 
6 %> @cond
7 function varargout = uip_subsetsprocessor(varargin)
8 % Last Modified by GUIDE v2.5 07-Aug-2012 23:08:36
9 
10 % Begin initialization code - DO NOT EDIT
11 gui_Singleton = 1;
12 gui_State = struct('gui_Name', mfilename, ...
13  'gui_Singleton', gui_Singleton, ...
14  'gui_OpeningFcn', @uip_subsetsprocessor_OpeningFcn, ...
15  'gui_OutputFcn', @uip_subsetsprocessor_OutputFcn, ...
16  'gui_LayoutFcn', [] , ...
17  'gui_Callback', []);
18 if nargin && ischar(varargin{1})
19  gui_State.gui_Callback = str2func(varargin{1});
20 end
21 
22 if nargout
23  [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
24 else
25  gui_mainfcn(gui_State, varargin{:});
26 end
27 % End initialization code - DO NOT EDIT
28 
29 % --- Executes just before uip_subsetsprocessor is made visible.
30 function uip_subsetsprocessor_OpeningFcn(hObject, eventdata, handles, varargin)
31 if nargin >= 5
32  handles.inputlog = varargin{2};
33 else
34  handles.inputlog = [];
35 end;
36 if numel(varargin) < 3
37  handles.input.flag_needs_fsg = 0;
38 else
39  handles.input.flag_needs_fsg = varargin{3};
40 end;
41 handles.output.flag_ok = 0;
42 guidata(hObject, handles);
43 gui_set_position(hObject);
44 
45 % --- Outputs from this function are returned to the command clae.
46 function varargout = uip_subsetsprocessor_OutputFcn(hObject, eventdata, handles)
47 try
48  uiwait(handles.figure1);
49  handles = guidata(hObject);
50  varargout{1} = handles.output;
51  delete(gcf);
52 catch ME %#ok<NASGU>
53  output.flag_ok = 0;
54  output.params = {};
55  varargout{1} = output;
56 end;
57 
58 %############################################
59 
60 
61 %#########
62 function view1(handles)
63 cla(handles.axes1, 'reset');
64 axes(handles.axes1); %#ok<MAXES>
65 hold off;
66 
67 input = handles.inputlog;
68 
69 if isempty(input)
70  msgbox('Cannot draw, input not specified!', 'Information');
71 else
72  try
73  set(handles.text_wait, 'String', 'Wait...', 'ForegroundColor', [0, 0, .8]);
74  o = subsetsprocessor();
75  eval(['o = o.setbatch(', params2str(get_params(handles)), ');']);
76  set(handles.text_wait, 'String', 'Ok', 'ForegroundColor', [0, 0.7, 0]);
77  log_hist = o.use(input);
78  log_hist.draw_stackedhists([], {[], .80*[1, 1, 1]}, def_peakdetector(), 0);
79  catch ME
80  set(handles.text_wait, 'String', '');
81  send_error(ME); % irerrordlg(ME.message, 'Error');
82  end;
83 end;
84 
85 
86 %#########
87 function params = get_params(handles)
88 nf4gradesmodes = {'fixed', 'stability'};
89 snf4gradesmode = nf4gradesmodes{get(handles.popupmenu_nf4gradesmode, 'Value')};
90 stabilitytypes = {'kun'};
91 sstabilitytype = stabilitytypes{get(handles.popupmenu_stabilitytype, 'Value')};
92 params = {...
93  'nf4gradesmode', ['''' snf4gradesmode ''''], ...
94  'stabilitytype', ['''' sstabilitytype ''''], ...
95  'nf4grades', int2str(eval(get(handles.edit_nf4grades, 'String'))), ...
96  'minhits_perc', num2str(eval(get(handles.edit_minhits_perc, 'String'))), ...
97  'stabilitythreshold', num2str(eval(get(handles.edit_stabilitythreshold, 'String'))), ...
98  };
99 
100 
101 %############################################
102 %############################################
103 
104 
105 % --- Executes on button press in pushbuttonOk.
106 function pushbuttonOk_Callback(hObject, eventdata, handles) %#ok<*INUSL,*DEFNU>
107 try
108  handles.output.params = get_params(handles);
109  handles.output.flag_ok = 1;
110  guidata(hObject, handles);
111  uiresume();
112 catch ME
113  irerrordlg(ME.message, 'Cannot continue');
114 end;
115 
116 function pushbutton_preview_Callback(hObject, eventdata, handles)
117 view1(handles);
118 
119 %############################################
120 %############################################
121 
122 function editVariables_Callback(hObject, eventdata, handles) %#ok<*INUSD>
123 
124 % --- Executes during object creation, after setting all properties.
125 function editVariables_CreateFcn(hObject, eventdata, handles)
126 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
127  set(hObject,'BackgroundColor','white');
128 end
129 
130 % --- Executes on selection change in popupmenu_nf4gradesmode.
131 function popupmenu_nf4gradesmode_Callback(hObject, eventdata, handles)
132 
133 % --- Executes during object creation, after setting all properties.
134 function popupmenu_nf4gradesmode_CreateFcn(hObject, eventdata, handles)
135 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
136  set(hObject,'BackgroundColor','white');
137 end
138 
139 function edit_nf4grades_Callback(hObject, eventdata, handles)
140 
141 % --- Executes during object creation, after setting all properties.
142 function edit_nf4grades_CreateFcn(hObject, eventdata, handles)
143 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
144  set(hObject,'BackgroundColor','white');
145 end
146 
147 function edit_minhits_perc_Callback(hObject, eventdata, handles)
148 
149 % --- Executes during object creation, after setting all properties.
150 function edit_minhits_perc_CreateFcn(hObject, eventdata, handles)
151 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
152  set(hObject,'BackgroundColor','white');
153 end
154 
155 function popupmenuFsg_Callback(hObject, eventdata, handles)
156 
157 function popupmenuFsg_CreateFcn(hObject, eventdata, handles)
158 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
159  set(hObject,'BackgroundColor','white');
160 end
161 
162 function popupmenuPeakdetector_Callback(hObject, eventdata, handles)
163 
164 function popupmenuPeakdetector_CreateFcn(hObject, eventdata, handles)
165 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
166  set(hObject,'BackgroundColor','white');
167 end
168 
169 function popupmenu_fsg_Callback(hObject, eventdata, handles)
170 
171 function popupmenu_fsg_CreateFcn(hObject, eventdata, handles)
172 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
173  set(hObject,'BackgroundColor','white');
174 end
175 function checkbox_flag_optimize_Callback(hObject, eventdata, handles)
176 function popupmenu_sortmode_Callback(hObject, eventdata, handles)
177 function popupmenu_sortmode_CreateFcn(hObject, eventdata, handles)
178 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
179  set(hObject,'BackgroundColor','white');
180 end
181 function popupmenu_input_Callback(hObject, eventdata, handles)
182 function popupmenu_input_CreateFcn(hObject, eventdata, handles)
183 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
184  set(hObject,'BackgroundColor','white');
185 end
186 function popupmenu_stabilitytype_Callback(hObject, eventdata, handles)
187 function popupmenu_stabilitytype_CreateFcn(hObject, eventdata, handles)
188 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
189  set(hObject,'BackgroundColor','white');
190 end
191 function edit_stabilitythreshold_Callback(hObject, eventdata, handles)
192 function edit_stabilitythreshold_CreateFcn(hObject, eventdata, handles)
193 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
194  set(hObject,'BackgroundColor','white');
195 end
196 %> @endcond
Generated by subsetsprocessor, carries a histogram.
Definition: log_hist.m:2
function send_error(in ME)
function params2str(in params, in flag_o)
function def_peakdetector(in out)
function setbatch(in o, in params)
function gui_set_position(in hObject)
Processor of a set of subsets of features.
function irerrordlg(in errorstring, in dlgname)