3 %> @brief Properties Window
for @ref
vis_image
4 %> @image html Screenshot-uip_dataio_txt_dpt.png
13 function varargout = uip_dataio_txt_dpt(varargin)
14 % Last Modified by GUIDE v2.5 08-Jul-2013 09:00:06
16 % Begin initialization code - DO NOT EDIT
18 gui_State =
struct(
'gui_Name', mfilename, ...
19 'gui_Singleton', gui_Singleton, ...
20 'gui_OpeningFcn', @uip_dataio_txt_dpt_OpeningFcn, ...
21 'gui_OutputFcn', @uip_dataio_txt_dpt_OutputFcn, ...
22 'gui_LayoutFcn', [] , ...
24 if nargin && ischar(varargin{1})
25 gui_State.gui_Callback = str2func(varargin{1});
29 [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
31 gui_mainfcn(gui_State, varargin{:});
33 % End initialization code - DO NOT EDIT
36 % --- Executes just before uip_dataio_txt_dpt is made visible.
38 % varargin{1} is expected to be a
dataio object, with filename already set
39 function uip_dataio_txt_dpt_OpeningFcn(hObject, eventdata, handles, varargin)
40 % Ignores what is usually a
block that is passed to the GUI handles.input.
block = varargin{1};
43 % % % % % Tries to load spectra only (not image map)
47 handles.ds = varargin{1}.load();
51 set(handles.uipanel_transpose,
'SelectionChangeFcn', ...
52 @(hObject, eventdata) uip_dataio_txt_dpt(
'uipanel_transpose_SelectionChangeFcn',hObject,eventdata,guidata(hObject))); % Have to set
this by hand because GUIDE does not
do that automatically
53 handles.output.flag_ok = 0;
54 guidata(hObject, handles);
55 update_direction(handles);
56 handles = guidata(hObject);
57 update_dimensions(handles);
60 %#################################################################################################
63 function preview(handles)
66 irerrordlg('Dataset not specified!', 'Cannot preview');
69 height = handles.heights(get(handles.popupmenu_dim, 'Value'));
71 ds.direction = handles.direction;
72 % if handles.flag_transpose
73 % ds.height = ds.no/height;
74 % ds = ds.transpose2();
79 %disp('Calculating area...')
85 u.flag_set_position = 0;
87 cla(handles.axes1, 'reset');
94 function params = get_params(handles)
95 if isempty(handles.heights)
98 s_height = int2str(handles.heights(get(handles.popupmenu_dim, 'Value')));
101 'height', s_height, ...
102 'direction', [
'''', handles.direction, ''''], ...
107 % Called whenever the checkbox is checked/unchecked
108 function update_dimensions(handles)
110 if isempty(handles.ds)
111 strs = {
'(dataset not provided)'};
117 if ds.no/i == floor(ds.no/i)
118 heights(end+1) = i; %
#ok<*AGROW>
119 strs{end+1} = sprintf(
'%3d x %3d', ds.no/i, i);
123 handles.heights = heights;
124 set(handles.popupmenu_dim,
'Value', 1);
125 set(handles.popupmenu_dim,
'String', strs);
126 guidata(handles.figure1, handles);
129 % Updates intrnal flag_transpose
130 function update_direction(handles)
131 handles.direction =
iif(get(handles.radiobutton_hor, 'Value'), 'hor', 'ver');
132 guidata(handles.figure1, handles);
136 %
#################################################################################################
139 % --- Outputs from
this function are returned to the command clae.
140 function varargout = uip_dataio_txt_dpt_OutputFcn(hObject, eventdata, handles)
142 uiwait(handles.figure1);
143 handles = guidata(hObject);
144 varargout{1} = handles.output;
149 varargout{1} = output;
152 % --- Executes on button press in pushbuttonOK.
153 function pushbuttonOK_Callback(hObject, eventdata, handles)
155 handles.output.params = get_params(handles);
156 handles.output.flag_ok = 1;
157 guidata(hObject, handles);
164 function uipanel_transpose_SelectionChangeFcn(hObject, eventdata, handles)
165 update_direction(handles);
167 % --- Executes on selection change in popupmenu_dim.
168 function popupmenu_dim_Callback(hObject, eventdata, handles)
170 % --- Executes during
object creation, after setting all properties.
171 function popupmenu_dim_CreateFcn(hObject, eventdata, handles)
172 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
173 set(hObject,'BackgroundColor','white');
176 function edit_idx_fea_Callback(hObject, eventdata, handles)
178 % --- Executes during
object creation, after setting all properties.
179 function edit_idx_fea_CreateFcn(hObject, eventdata, handles)
180 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
181 set(hObject,'BackgroundColor','white');
184 % --- Executes on button press in pushbutton_preview.
185 function pushbutton_preview_Callback(hObject, eventdata, handles)
187 function uipanel_transpose_ButtonDownFcn(hObject, eventdata, handles)
Property mode
=0. 0: feature; 1: class; 2: y
Property idx_fea
=1. Index of feature in case mode is 0.
function iif(in cond, in x1, in x2)
Dataset loader/saver common class.
function gui_set_position(in hObject)
Property no
=-1. Number of observations.
function irerrordlg(in errorstring, in dlgname)