IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
uip_estlog_rightwrong.m
Go to the documentation of this file.
1 %> @ingroup guigroup
2 %> @file
3 %> @brief Properties Window for @ref estlog_rightwrong
4 %>
5 %> <b>Title</b> Title needs to be a valid MATLAB field name (if the log will be ever used to build a @ref sovalues). A default random title is automatically generated.
6 %>
8 
9 %> @cond
10 function varargout = uip_estlog_rightwrong(varargin)
11 % Begin initialization code - DO NOT EDIT
12 gui_Singleton = 0;
13 gui_State = struct('gui_Name', mfilename, ...
14  'gui_Singleton', gui_Singleton, ...
15  'gui_OpeningFcn', @uip_estlog_rightwrong_OpeningFcn, ...
16  'gui_OutputFcn', @uip_estlog_rightwrong_OutputFcn, ...
17  'gui_LayoutFcn', [] , ...
18  'gui_Callback', []);
19 if nargin && ischar(varargin{1})
20  gui_State.gui_Callback = str2func(varargin{1});
21 end
22 
23 if nargout
24  [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
25 else
26  gui_mainfcn(gui_State, varargin{:});
27 end
28 % End initialization code - DO NOT EDIT
29 
30 % --- Executes just before uip_estlog_rightwrong is made visible.
31 function uip_estlog_rightwrong_OpeningFcn(hObject, eventdata, handles, varargin)
32 handles.output.flag_ok = 0;
33 guidata(hObject, handles);
34 gui_set_position(hObject);
35 set(handles.edit_title, 'string', sprintf('rightwrong%03d', randi([1, 999])));
36 
37 
38 % --- Outputs from this function are returned to the command line.
39 function varargout = uip_estlog_rightwrong_OutputFcn(hObject, eventdata, handles) %#ok<*INUSL>
40 try
41  uiwait(handles.figure1);
42  handles = guidata(hObject); % Handles is not a handle(!), so gotta retrieve it again to see changes in .output
43  varargout{1} = handles.output;
44  delete(gcf);
45 catch %#ok<*CTCH>
46  output.flag_ok = 0;
47  output.params = {};
48  varargout{1} = output;
49 end;
50 
51 
52 
53 % --- Executes on button press in pushbuttonOk.
54 function pushbuttonOk_Callback(hObject, eventdata, handles)
55 try
56  handles.output.params = {...
57  'title', ['''', get(handles.edit_title, 'String'), ''''], ...
58  'flag_support', int2str(get(handles.checkbox_flag_support, 'Value')), ...
59  'estlabels', get(handles.edit_estlabels, 'String'), ...
60  'idx_rate', int2str(get(handles.popupmenu_idx_rate, 'Value')), ...
61  };
62  handles.output.flag_ok = 1;
63  guidata(hObject, handles);
64  uiresume();
65 catch ME
66  irerrordlg(ME.message, 'Cannot continue');
67 
68 end;
69 
70 function checkbox_flag_support_Callback(hObject, eventdata, handles) %#ok<*INUSD,*DEFNU>
71 function edit_title_Callback(hObject, eventdata, handles)
72 function edit_title_CreateFcn(hObject, eventdata, handles)
73 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
74  set(hObject,'BackgroundColor','white');
75 end
76 
77 function edit_estlabels_Callback(hObject, eventdata, handles)
78 function edit_estlabels_CreateFcn(hObject, eventdata, handles)
79 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
80  set(hObject,'BackgroundColor','white');
81 end
82 
83 %#####
84 function pushbutton_pick_Callback(hObject, eventdata, handles)
85 ouch = ask_dataset([], 'Dataset to pick class labels from', 0);
86 if ouch.flag_ok
87  set(handles.edit_estlabels, 'String', [ouch.params{2}, '.classlabels']);
88 end;
89 
90 %-----------------------------------------------------------------------------------------------------
91 
92 function popupmenu_idx_rate_Callback(hObject, eventdata, handles)
93 function popupmenu_idx_rate_CreateFcn(hObject, eventdata, handles)
94 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
95  set(hObject,'BackgroundColor','white');
96 end
97 %> @endcond
Records (1)x([rejected, right, wrong]) hits.
function gui_set_position(in hObject)
function irerrordlg(in errorstring, in dlgname)
function ask_dataset(in varargin)