IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
uip_blmisc_classes_from_clus.m
Go to the documentation of this file.
1 %> @ingroup guigroup
2 %> @file
3 %> @brief Properties Window for the "Classes from cluster" block
5 
6 %> @cond
7 function varargout = uip_blmisc_classes_from_clus(varargin)
8 % Last Modified by GUIDE v2.5 26-Jun-2011 23:55:12
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_blmisc_classes_from_clus_OpeningFcn, ...
15  'gui_OutputFcn', @uip_blmisc_classes_from_clus_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 
30 % --- Executes just before uip_blmisc_classes_from_clus is made visible.
31 function uip_blmisc_classes_from_clus_OpeningFcn(hObject, eventdata, handles, varargin)
32 handles.output.flag_ok = 0;
33 guidata(hObject, handles);
34 gui_set_position(hObject);
35 refresh(handles);
36 
37 % --- Outputs from this function are returned to the command clae.
38 function varargout = uip_blmisc_classes_from_clus_OutputFcn(hObject, eventdata, handles)
39 try
40  uiwait(handles.figure1);
41  handles = guidata(hObject);
42  varargout{1} = handles.output;
43  delete(gcf);
44 catch
45  output.flag_ok = 0;
46  output.params = {};
47  varargout{1} = output;
48 end;
49 
50 
51 %############################################
52 
53 %#########
54 function refresh(handles)
55 listbox_load_from_workspace('irdata_clus', handles.popupmenuData, 0);
56 
57 %############################################
58 %############################################
59 
60 % --- Executes on button press in pushbuttonOK.
61 function pushbuttonOK_Callback(hObject, eventdata, handles)
62 try
63  sdata = listbox_get_selected_1stname(handles.popupmenuData);
64  if isempty(sdata)
65  error('Clusters dataset not specified!');
66  end;
67 
68  handles.output.params = {...
69  'idx_fea', int2str(eval(get(handles.edit_idx_fea, 'String'))), ...
70  'classes_to_remove', mat2str(eval(get(handles.edit_classes_to_remove, 'String'))), ...
71  'data_clus', sdata, ...
72  };
73  handles.output.flag_ok = 1;
74  guidata(hObject, handles);
75  uiresume();
76 catch ME
77  irerrordlg(ME.message, 'Cannot continue');
78 
79 end;
80 
81 
82 % --- Executes on button press in pushbuttonRefreshData.
83 function pushbuttonRefreshData_Callback(hObject, eventdata, handles)
84 refresh(handles);
85 
86 % --- Executes on selection change in popupmenuData.
87 function popupmenuData_Callback(hObject, eventdata, handles)
88 
89 % --- Executes during object creation, after setting all properties.
90 function popupmenuData_CreateFcn(hObject, eventdata, handles)
91 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
92  set(hObject,'BackgroundColor','white');
93 end
94 
95 function edit_idx_fea_Callback(hObject, eventdata, handles)
96 
97 % --- Executes during object creation, after setting all properties.
98 function edit_idx_fea_CreateFcn(hObject, eventdata, handles)
99 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
100  set(hObject,'BackgroundColor','white');
101 end
102 
103 function edit_classes_to_remove_Callback(hObject, eventdata, handles)
104 
105 % --- Executes during object creation, after setting all properties.
106 function edit_classes_to_remove_CreateFcn(hObject, eventdata, handles)
107 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
108  set(hObject,'BackgroundColor','white');
109 end
110 %> @endcond
Assign classes from one data column from an irdata_clus object.
Dataset class - cluster data.
Definition: irdata_clus.m:6
function listbox_get_selected_1stname(in h_listbox)
Base Block class.
Definition: block.m:2
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)