IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
uip_as_fsel_grades.m
Go to the documentation of this file.
1 %> @ingroup guigroup
2 %> @file uip_as_fsel_grades.m
3 %> @brief Properties Window for @ref as_fsel_grades
4 %> @sa as_fsel_grades
5 
6 %> @cond
7 function varargout = uip_as_fsel_grades(varargin)
8 % Last Modified by GUIDE v2.5 26-Aug-2012 13:53:09
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_as_fsel_grades_OpeningFcn, ...
15  'gui_OutputFcn', @uip_as_fsel_grades_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_as_fsel_grades is made visible.
30 function uip_as_fsel_grades_OpeningFcn(hObject, eventdata, handles, varargin)
31 if nargin >= 5
32  handles.inputobj = varargin{2};
33 else
34  handles.inputobj = [];
35 end;
36 
37 if numel(varargin) < 3
38  handles.input.flag_needs_fsg = 0;
39 else
40  handles.input.flag_needs_fsg = varargin{3};
41 end;
42 handles.output.flag_ok = 0;
43 guidata(hObject, handles);
44 gui_set_position(hObject);
45 refresh(handles);
46 
47 % --- Outputs from this function are returned to the command clae.
48 function varargout = uip_as_fsel_grades_OutputFcn(hObject, eventdata, handles)
49 try
50  uiwait(handles.figure1);
51  handles = guidata(hObject);
52  varargout{1} = handles.output;
53  delete(gcf);
54 catch %#ok<*CTCH>
55  output.flag_ok = 0;
56  output.params = {};
57  varargout{1} = output;
58 end;
59 
60 %############################################
61 
62 %#########
63 function refresh(handles)
64 listbox_load_from_workspace('peakdetector', handles.popupmenuPeakdetector, 1);
65 
66 
67 %#########
68 function view1(handles)
69 cla(handles.axes1, 'reset');
70 axes(handles.axes1); %#ok<MAXES>
71 hold off;
72 
73 input = handles.inputobj;
74 
75 if isempty(input)
76  msgbox('Cannot draw, input not specified!', 'Information');
77 else
78  evalin('base', ['global TEMP; TEMP = as_fsel_grades(); TEMP = TEMP.setbatch(', params2str(get_params(handles)), ');']);
79  global TEMP; %#ok<*TLEV>
80  log = TEMP.use(input);
81  log.draw([], 1);
82  clear TEMP;
83 end;
84 
85 
86 %#########
87 function params = get_params(handles)
88 
89 types = {'none', 'nf', 'threshold'};
90 sortmodes = {'grade', 'index'};
91 
92 spd = listbox_get_selected_1stname(handles.popupmenuPeakdetector);
93 if isempty(spd)
94  spd = '[]';
95 end;
96 
97 params = {...
98 'type', ['''' types{get(handles.popupmenuType, 'Value')} ''''], ...
99 'nf_select', int2str(eval(get(handles.editNf, 'String'))), ...
100 'threshold', get(handles.editThreshold, 'String'), ...
101 'peakdetector', spd, ...
102 'sortmode', ['''' sortmodes{get(handles.popupmenu_sortmode, 'Value')} ''''], ...
103 };
104 
105 
106 
107 
108 %############################################
109 function pushbuttonOk_Callback(hObject, eventdata, handles)
110 try
111  handles.output.params = get_params(handles);
112  handles.output.flag_ok = 1;
113  guidata(hObject, handles);
114  uiresume();
115 catch ME
116  irerrordlg(ME.message, 'Cannot continue');
117 end;
118 
119 
120 function pushbutton_preview_Callback(hObject, eventdata, handles) %#ok<*INUSL>
121 view1(handles);
122 
123 %############################################
124 %############################################
125 
126 
127 
128 
129 function editVariables_CreateFcn(hObject, eventdata, handles) %#ok<*DEFNU,*INUSD>
130 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
131  set(hObject,'BackgroundColor','white');
132 end
133 function popupmenuType_Callback(hObject, eventdata, handles)
134 function popupmenuType_CreateFcn(hObject, eventdata, handles)
135 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
136  set(hObject,'BackgroundColor','white');
137 end
138 function editNf_Callback(hObject, eventdata, handles)
139 function editNf_CreateFcn(hObject, eventdata, handles)
140 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
141  set(hObject,'BackgroundColor','white');
142 end
143 function editThreshold_Callback(hObject, eventdata, handles)
144 function editThreshold_CreateFcn(hObject, eventdata, handles)
145 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
146  set(hObject,'BackgroundColor','white');
147 end
148 function popupmenuFsg_Callback(hObject, eventdata, handles)
149 function popupmenuFsg_CreateFcn(hObject, eventdata, handles)
150 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
151  set(hObject,'BackgroundColor','white');
152 end
153 function popupmenuPeakdetector_Callback(hObject, eventdata, handles)
154 function popupmenuPeakdetector_CreateFcn(hObject, eventdata, handles)
155 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
156  set(hObject,'BackgroundColor','white');
157 end
158 function popupmenu_fsg_Callback(hObject, eventdata, handles)
159 function popupmenu_fsg_CreateFcn(hObject, eventdata, handles)
160 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
161  set(hObject,'BackgroundColor','white');
162 end
163 function checkbox_flag_optimize_Callback(hObject, eventdata, handles)
164 function popupmenu_sortmode_Callback(hObject, eventdata, handles)
165 function popupmenu_sortmode_CreateFcn(hObject, eventdata, handles)
166 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
167  set(hObject,'BackgroundColor','white');
168 end
169 function popupmenu_input_Callback(hObject, eventdata, handles)
170 function popupmenu_input_CreateFcn(hObject, eventdata, handles)
171 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
172  set(hObject,'BackgroundColor','white');
173 end
174 %> @endcond
function params2str(in params, in flag_o)
Peak Detector.
Definition: peakdetector.m:6
function listbox_get_selected_1stname(in h_listbox)
function setbatch(in o, in params)
function listbox_load_from_workspace(in classname, in h_list, in flag_blank, in string_empty, in input)
function gui_set_position(in hObject)
function irerrordlg(in errorstring, in dlgname)
Feature Selection based on a "grades" vector.