IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
uip_reptt_bag.m
Go to the documentation of this file.
1 %> @ingroup guigroup
2 %> @file
3 %> @brief Properties Window to create a Cascade Block
4 %> @image html Screenshot-uip_reptt_bag.png
5 %>
6 %> <b>SGS</b> - see reptt_bag::sgs
7 %>
8 %> <b>Number of bagging repetitions</b> - see reptt_bag::no_bagreps
9 %>
10 %> @sa reptt_bag, reptt, uip_reptt.m
11 
12 %> @cond
13 function varargout = uip_reptt_bag(varargin)
14 % Begin initialization code - DO NOT EDIT
15 gui_Singleton = 0;
16 gui_State = struct('gui_Name', mfilename, ...
17  'gui_Singleton', gui_Singleton, ...
18  'gui_OpeningFcn', @uip_reptt_bag_OpeningFcn, ...
19  'gui_OutputFcn', @uip_reptt_bag_OutputFcn, ...
20  'gui_LayoutFcn', [] , ...
21  'gui_Callback', []);
22 if nargin && ischar(varargin{1})
23  gui_State.gui_Callback = str2func(varargin{1});
24 end
25 
26 if nargout
27  [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
28 else
29  gui_mainfcn(gui_State, varargin{:});
30 end
31 % End initialization code - DO NOT EDIT
32 
33 % --- Executes just before uip_reptt_bag is made visible.
34 function uip_reptt_bag_OpeningFcn(hObject, eventdata, handles, varargin)
35 handles.output.flag_ok = 0;
36 guidata(hObject, handles);
37 gui_set_position(hObject);
38 listbox_load_from_workspace('sgs', handles.popupmenu_sgs, 0);
39 
40 
41 % --- Outputs from this function are returned to the command line.
42 function varargout = uip_reptt_bag_OutputFcn(hObject, eventdata, handles)
43 try
44  uiwait(handles.figure1);
45  handles = guidata(hObject); % Handles is not a handle(!), so gotta retrieve it again to see changes in .output
46  varargout{1} = handles.output;
47  delete(gcf);
48 catch
49  output.flag_ok = 0;
50  output.params = {};
51  varargout{1} = output;
52 end;
53 
54 
55 
56 % --- Executes on button press in pushbuttonOk.
57 function pushbuttonOk_Callback(hObject, eventdata, handles)
58 try
59  ssgs = listbox_get_selected_1stname(handles.popupmenu_sgs);
60  if isempty(ssgs)
61  error('SGS not specified!');
62  end;
63 
64  other = uip_reptt();
65  if other.flag_ok
66  handles.output.params = [other.params, {...
67  'sgs', ssgs, ...
68  'no_bagreps', int2str(eval(get(handles.edit_no_bagreps, 'String'))) ...
69  }];
70  handles.output.flag_ok = 1;
71  guidata(hObject, handles);
72  uiresume();
73  end;
74 catch ME
75  irerrordlg(ME.message, 'Cannot continue');
76 
77 end;
78 
79 % --- Executes on selection change in popupmenu_sgs.
80 function popupmenu_sgs_Callback(hObject, eventdata, handles)
81 local_show_description(handles, handles.popupmenu_sgs);
82 
83 % --- Executes during object creation, after setting all properties.
84 function popupmenu_sgs_CreateFcn(hObject, eventdata, handles)
85 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
86  set(hObject,'BackgroundColor','white');
87 end
88 
89 function edit_no_bagreps_Callback(hObject, eventdata, handles)
90 
91 % --- Executes during object creation, after setting all properties.
92 function edit_no_bagreps_CreateFcn(hObject, eventdata, handles)
93 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
94  set(hObject,'BackgroundColor','white');
95 end
96 %> @endcond
Property no_bagreps
Number of bagging repetitions.
Definition: reptt_bag.m:43
Base Sub-dataset Generation Specification (SGS) class.
Definition: sgs.m:6
REPTT for bagging classifiers.
Definition: reptt_bag.m:35
function listbox_get_selected_1stname(in h_listbox)
Property sgs
Definition: reptt_bag.m:40
function listbox_load_from_workspace(in classname, in h_list, in flag_blank, in string_empty, in input)
function gui_set_position(in hObject)
REPeated Train-Test.
Definition: reptt.m:8
function irerrordlg(in errorstring, in dlgname)