Mercurial > hg > camir-aes2014
comparison toolboxes/MIRtoolbox1.3.2/somtoolbox/som_show_gui.m @ 0:e9a9cd732c1e tip
first hg version after svn
author | wolffd |
---|---|
date | Tue, 10 Feb 2015 15:05:51 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:e9a9cd732c1e |
---|---|
1 function fig = som_show_gui(input,varargin) | |
2 | |
3 %SOM_SHOW_GUI A GUI for using SOM_SHOW and associated functions. | |
4 % | |
5 % h = som_show_gui(sM); | |
6 % | |
7 % Input and output arguments: | |
8 % sM (struct) a map struct: the SOM to visualize | |
9 % h (scalar) a handle to the GUI figure | |
10 % | |
11 % This is a graphical user interface to make the usage of SOM_SHOW and | |
12 % associated functions somewhat easier for beginning users of the SOM | |
13 % Toolbox. | |
14 % | |
15 % How to use the GUI: | |
16 % 1. Start the GUI by giving command som_show_gui(sM); | |
17 % 2. Build a list of visualization planes using the buttons | |
18 % ('Add components', etc.) on the right | |
19 % - the options associated with each of the planes can be | |
20 % modified by selecting a plane from the list, and pressing | |
21 % the 'Plane options' button | |
22 % - the controls below the list apply to all planes | |
23 % - the subplot grid size can be controlled using the 'subplots' | |
24 % field on top right corner, e.g. '4 3' to get 4 times 3 grid | |
25 % 3. To visualize the planes, press the 'Visualize' button on the bottom. | |
26 % 4. To add hits, labels, trajectories (or comets) to the | |
27 % visualization, or clear them, or reset the colorbars, | |
28 % see the tools available from the 'Tools' menu. | |
29 % - the arguments to those tools are either given in the tool, | |
30 % or read from the workspace ('Select variable' buttons) | |
31 % - the tools always apply to the latest figure created | |
32 % by the GUI | |
33 % 5. To quit, press the 'Close' button on the bottom. | |
34 % | |
35 % Known bugs: | |
36 % - Especially when using the adding tools, you can easily | |
37 % give arguments which do not fit each other, and this | |
38 % results in a lengthy (and often cryptic) error message. | |
39 % In such a case, check the arguments you are giving to see | |
40 % if there's something wrong with them. See function | |
41 % SOM_SHOW_ADD for more information on how the options | |
42 % can be set. | |
43 % - The default values in the adding tools may not be | |
44 % very reasonable: you may have to try out different | |
45 % values for e.g. markersize before getting the kind of | |
46 % result you want. | |
47 % | |
48 % SOM_SHOW_GUI has two subfunctions: VIS_SHOW_GUI_COMP and | |
49 % VIS_SHOW_GUI_TOOL. These are for internal use of SOM_SHOW_GUI. | |
50 % | |
51 % See also SOM_SHOW, SOM_SHOW_ADD, SOM_SHOW_CLEAR, SOM_RECOLORBAR. | |
52 | |
53 % Copyright (c) 2000 by Roman Feldman and Juha Vesanto | |
54 % Contributed to SOM Toolbox on August 22nd, 2000 | |
55 % http://www.cis.hut.fi/projects/somtoolbox/ | |
56 | |
57 % Version 2.0beta roman 160800 juuso 220800 | |
58 | |
59 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
60 % MAIN % | |
61 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
62 | |
63 warning off; | |
64 if (nargin < 1) | |
65 errordlg({'Make sure you have SOM as input argument'; ''; ... | |
66 'example: som_show_gui(sMap)'},'Error in SOM_VIS: input arguments'); | |
67 return | |
68 end | |
69 | |
70 if isstruct(input) | |
71 fig_h = create_main_gui(input); | |
72 if (nargout > 0) fig = fig_h; end | |
73 return; | |
74 | |
75 elseif ischar(input) | |
76 action = lower(input); | |
77 | |
78 % | |
79 udata = get(varargin{1},'UserData'); | |
80 plot_array = udata.plot_array; | |
81 l = length(plot_array); | |
82 list1_h = udata.h(1); | |
83 | |
84 if (strcmp(action,'')) | |
85 errordlg('','Error in SOM_VIS: input arguments'); | |
86 return; | |
87 | |
88 %%%%%%%%%%%%%%%%%%%% | |
89 % add_selected_comp | |
90 % | |
91 elseif (strcmp(action,'add_selected_comp')) | |
92 if isempty(plot_array(1).string), tmp = 1; else tmp = l+1; end | |
93 [sel,ok] = listdlg('ListString',udata.sM.comp_names,... | |
94 'Name','Component selection',... | |
95 'PromptString','Select components to add'); | |
96 if ok & ~isempty(sel), | |
97 for i=1:length(sel), | |
98 plot_array(tmp+i-1).string = udata.sM.comp_names{sel(i)}; | |
99 plot_array(tmp+i-1).args = {'comp' sel(i)}; | |
100 udata.property{tmp+i-1} = {0}; | |
101 end | |
102 set(list1_h,'Value',tmp+i-1, ... | |
103 'String',{plot_array(:).string}); | |
104 end | |
105 | |
106 udata.plot_array = plot_array; | |
107 set(varargin{1},'UserData',udata); | |
108 | |
109 %%%%%%%%%%%%%%%%%%%% | |
110 % add_all_comps | |
111 % | |
112 elseif (strcmp(action,'add_all_comps')) | |
113 if (strcmp(plot_array(1).string,'')) | |
114 tmp = 1; | |
115 else | |
116 tmp = l+1; | |
117 end | |
118 indx = length(udata.sM.comp_names); | |
119 for (i=1:indx) | |
120 plot_array(tmp+i-1).string = udata.sM.comp_names{i}; | |
121 plot_array(tmp+i-1).args = {'comp' i}; | |
122 udata.property{tmp+i-1} = {0}; | |
123 end | |
124 % update list | |
125 set(list1_h,'Value',tmp+indx-1, ... | |
126 'String',{plot_array(:).string}); | |
127 | |
128 udata.plot_array = plot_array; | |
129 set(varargin{1},'UserData',udata); | |
130 | |
131 %%%%%%%%%%%%%%%%%%%% | |
132 % add_u_matrix | |
133 % | |
134 elseif (strcmp(action,'add_u_matrix')) | |
135 if (strcmp(plot_array(1).string,'')) | |
136 tmp = 1; | |
137 else | |
138 tmp = l+1; | |
139 end | |
140 plot_array(tmp).string = 'U-matrix'; | |
141 plot_array(tmp).args = {'umat' 'all'}; | |
142 udata.property{tmp} = {0 'U-matrix' 1:length(udata.sM.comp_names)}; | |
143 % update list | |
144 set(list1_h,'Value',tmp, ... | |
145 'String',{plot_array(:).string}); | |
146 | |
147 udata.plot_array = plot_array; | |
148 set(varargin{1},'UserData',udata); | |
149 | |
150 %%%%%%%%%%%%%%%%%%%% | |
151 % add_colorplane | |
152 % | |
153 elseif (strcmp(action,'add_colorplane')) | |
154 if (strcmp(plot_array(1).string,'')) | |
155 tmp = 1; | |
156 else | |
157 tmp = l+1; | |
158 end | |
159 plot_array(tmp).string = 'color plane'; | |
160 c = som_colorcode(udata.sM); | |
161 plot_array(tmp).args = {'color' c}; | |
162 udata.property{tmp} = {0 'Color code' {'rgb1' 'rgb2' 'rgb3' 'rgb4' 'hsv' '-variable-'} 1}; | |
163 % update list | |
164 set(list1_h,'Value',tmp, ... | |
165 'String',{plot_array(:).string}); | |
166 | |
167 udata.plot_array = plot_array; | |
168 set(varargin{1},'UserData',udata); | |
169 | |
170 %%%%%%%%%%%%%%%%%%%% | |
171 % add_empty | |
172 % | |
173 elseif (strcmp(action,'add_empty')) | |
174 if (strcmp(plot_array(1).string,'')) | |
175 tmp = 1; | |
176 else | |
177 tmp = l+1; | |
178 end | |
179 plot_array(tmp).string = 'empty plane'; | |
180 plot_array(tmp).args = {'empty' ''}; | |
181 udata.property{tmp} = {''}; | |
182 % update list | |
183 set(list1_h,'Value',tmp, ... | |
184 'String',{plot_array(:).string}); | |
185 | |
186 udata.plot_array = plot_array; | |
187 set(varargin{1},'UserData',udata); | |
188 | |
189 %%%%%%%%%%%%%%%%%%%% | |
190 % remove | |
191 % | |
192 elseif (strcmp(action,'remove')) | |
193 rm_indx = get(list1_h,'Value'); | |
194 rm_l = length(rm_indx); | |
195 % rebuild array | |
196 incl_inds = setdiff(1:length(plot_array),rm_indx); | |
197 if isempty(incl_inds), | |
198 clear plot_array; | |
199 plot_array(1).args = {}; | |
200 plot_array(1).string = ''; | |
201 udata.property = {}; | |
202 udata.property{1} = {}; | |
203 else | |
204 plot_array = plot_array(incl_inds); | |
205 udata.property = udata.property(incl_inds); | |
206 end | |
207 set(list1_h,'Value',length(plot_array), ... | |
208 'String',{plot_array(:).string}); | |
209 | |
210 udata.plot_array = plot_array; | |
211 set(varargin{1},'UserData',udata); | |
212 | |
213 %%%%%%%%%%%%%%%%%%%% | |
214 % remove_all | |
215 % | |
216 elseif (strcmp(action,'remove_all')) | |
217 plot_array = []; | |
218 plot_array(1).args = {}; | |
219 plot_array(1).string = ''; | |
220 udata.property = {}; | |
221 set(list1_h,'Value',1, ... | |
222 'String',{plot_array(:).string}); | |
223 | |
224 udata.plot_array = plot_array; | |
225 set(varargin{1},'UserData',udata); | |
226 | |
227 %%%%%%%%%%%%%%%%%%%% | |
228 % more_options | |
229 % | |
230 elseif (strcmp(action,'more_options')) | |
231 vis_show_gui_comp(varargin{1},get(list1_h,'Value'),'init'); | |
232 | |
233 %%%%%%%%%%%%%%%%%%%% | |
234 % close | |
235 % | |
236 elseif (strcmp(action,'close')) | |
237 close(varargin{1}); | |
238 | |
239 %%%%%%%%%%%%%%%%%%%% | |
240 % visualize | |
241 % | |
242 elseif (strcmp(action,'visualize')) %% s = {k k.^2}; plot(s{:}); | |
243 current_fig = varargin{1}; | |
244 figure; | |
245 args = [{udata.sM} plot_array(:).args]; | |
246 % edge | |
247 tmp = get(udata.h(2),'UserData'); | |
248 i = get(udata.h(2),'Value'); | |
249 args = [args {'edge' tmp{i}}]; | |
250 % bar | |
251 tmp = get(udata.h(3),'UserData'); | |
252 i = get(udata.h(3),'Value'); | |
253 args = [args {'bar' tmp{i}}]; | |
254 % norm | |
255 tmp = get(udata.h(4),'UserData'); | |
256 i = get(udata.h(4),'Value'); | |
257 args = [args {'norm' tmp{i}}]; | |
258 % size | |
259 tmp = get(udata.h(5),'String'); | |
260 args = [args {'size' eval(tmp)}]; | |
261 % colormap | |
262 tmp = get(udata.h(6),'String'); | |
263 if ~isempty(tmp) | |
264 args = [args {'colormap' eval(tmp)}]; | |
265 end | |
266 % footnote | |
267 tmp = get(udata.h(7),'String'); | |
268 args = [args {'footnote' tmp}]; | |
269 % subplots | |
270 tmp = get(udata.h(8),'String'); | |
271 if ~(strcmp(tmp,'default') | isempty(tmp)) | |
272 tmp2 = sscanf(tmp,'%i %i'); | |
273 if length(tmp2)<2, tmp2 = sscanf(tmp,'%ix%i'); end | |
274 if length(tmp2)<2, tmp = eval(tmp); | |
275 else tmp = tmp2'; | |
276 end | |
277 if length(tmp)<2, tmp(2) = 1; end | |
278 if tmp(1)*tmp(2)<length(get(udata.h(1),'string')), | |
279 close(varargin{1}); | |
280 errordlg('Too small subplot size', ... | |
281 'Error in SOM_VIS: subplot size'); | |
282 return; | |
283 end | |
284 args = [args {'subplots' tmp}]; | |
285 end | |
286 | |
287 som_show(args{:}); | |
288 | |
289 % udata.vis_h = varargin{1}; | |
290 % first refresh plot info | |
291 udata.vis_h = setdiff( ... | |
292 udata.vis_h, ... | |
293 setdiff(udata.vis_h,get(0,'children'))); | |
294 udata.vis_h = [udata.vis_h gcf]; | |
295 set(current_fig,'UserData',udata); | |
296 | |
297 else | |
298 ; | |
299 end | |
300 | |
301 else | |
302 errordlg({'Make sure you have SOM as input argument'; ''; ... | |
303 'example: som_show_gui(sMap)'},'Error in SOM_VIS: input arguments'); | |
304 end | |
305 | |
306 | |
307 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
308 % ---------------------- SUBFUNCTIONS ----------------------- % | |
309 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
310 | |
311 | |
312 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
313 % CREATE_MAIN_GUI % | |
314 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
315 | |
316 function fig_h = create_main_gui(sM) | |
317 | |
318 oldFigNumber=watchon; | |
319 | |
320 % init variables | |
321 FIGURENAME = 'SOM_SHOW_GUI'; | |
322 plot_array = []; | |
323 plot_array(1).args = {}; | |
324 plot_array(1).string = ''; | |
325 | |
326 % colors | |
327 fig_color = [0.8 0.8 0.8]; | |
328 bg_color1 = [0.701960784313725 0.701960784313725 0.701960784313725]; | |
329 bg_color2 = [0.9 0.9 0.9]; | |
330 | |
331 %%%% positions %%%%% | |
332 %--------- figure | |
333 fig_i = [0.02 0.25]; | |
334 fig_s = [0.24 0.55]; | |
335 %--------- | |
336 ue = 0.02; | |
337 th = 0.03; | |
338 hint_text_pos = [0.05 0.94 0.8 th]; | |
339 big_frame_pos = [ue 0.38 (1-2*ue) 0.56]; | |
340 planes_listbox_text_pos = [0.07 0.87 0.3 th]; | |
341 planes_listbox_pos = [(ue+0.03) 0.395 0.46 0.47]; | |
342 subplots_text_pos = [0.53 0.885 0.2 th]; | |
343 subplots_pos = [0.73 0.88 0.22 0.05]; ah = 0.045; d = (planes_listbox_pos(4) - 10*ah)/7; | |
344 add_components_pos = [0.53 (sum(planes_listbox_pos([2 4]))-ah) 0.42 ah]; tmp = add_components_pos(2)-(d+ah); | |
345 add_all_components_pos = [0.53 tmp 0.42 ah]; tmp = add_all_components_pos(2)-(d+ah); | |
346 add_u_matrix_pos = [0.53 tmp 0.42 ah]; tmp = add_u_matrix_pos(2)-(d+ah); | |
347 add_colorplane_pos = [0.53 tmp 0.42 ah]; tmp = add_colorplane_pos(2)-(d+ah); | |
348 add_empty_pos = [0.53 tmp 0.42 ah]; tmp = add_empty_pos(2)-2*(d+ah)+d; | |
349 remove_pos = [0.53 tmp 0.42 ah]; tmp = remove_pos(2)-(d+ah); | |
350 remove_all_pos = [0.53 tmp 0.42 ah]; tmp = remove_all_pos(2)-2*(d+ah)+d; | |
351 plane_options_pos = [0.53 tmp 0.42 ah]; | |
352 ph = 0.041; | |
353 dd = (ph-th)/2; | |
354 tmp = big_frame_pos(2) - (planes_listbox_pos(2)-big_frame_pos(2)) - ph; | |
355 ie1 = 0.25; | |
356 tw = 0.21; | |
357 iw = 0.28; | |
358 unit_edges_text_pos = [ue (tmp+dd) tw th]; | |
359 unit_edges_pos = [ie1 tmp iw ph]; tmp = unit_edges_pos(2)-(d+ph) - d; | |
360 unit_sizes_text_pos = [ue (tmp+dd) tw th]; | |
361 unit_sizes_pos = [ie1 tmp iw ph]; tmp = unit_sizes_pos(2)-(d+ph) - d; | |
362 colorbar_dir_text_pos = [ue (tmp+dd) tw th]; | |
363 colorbar_dir_pos = [ie1 tmp iw ph]; tmp2 = sum(colorbar_dir_pos([1 3])); | |
364 colorbar_norm_text_pos = [(tmp2) (tmp+dd) 0.11 th]; | |
365 colorbar_norm_pos = [(1-ue-(iw+0.06)) tmp (iw+0.06) ph]; tmp = colorbar_norm_pos(2)-(d+ph) - d; | |
366 colormap_text_pos = [ue (tmp+dd) tw th]; | |
367 colormap_pos = [ie1 tmp iw ph]; tmp = colormap_pos(2)-(d+ph) - d; | |
368 footnote_text_pos = [ue (tmp+dd) tw th]; | |
369 footnote_pos = [ie1 tmp (1-ue-ie1) ph]; | |
370 tmp = planes_listbox_pos(2)-big_frame_pos(2); | |
371 tmp2 = ah+2*tmp; | |
372 little_frame_pos = [ue tmp (1-2*ue) tmp2]; tmp2 = little_frame_pos(2)+tmp; | |
373 ddd = 0.1; | |
374 bw = (little_frame_pos(3)-2*0.03-ddd)/2; | |
375 visualize_pos = [(ue+0.03) tmp2 bw ah]; | |
376 close_pos = [(sum(visualize_pos([1 3]))+ddd) tmp2 bw ah]; | |
377 | |
378 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
379 % main figure | |
380 % | |
381 fig_h = figure( ... | |
382 'Units','normalized', ... | |
383 'Color',fig_color, ... | |
384 'PaperPosition',[18 180 576 432], ... | |
385 'PaperType','A4', ... | |
386 'PaperUnits','normalized', ... | |
387 'Position',[fig_i fig_s], ... | |
388 'ToolBar','none', ... | |
389 'NumberTitle','off', ... | |
390 'Name',FIGURENAME, ... | |
391 'Visible','off'); | |
392 | |
393 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
394 % hint text | |
395 % | |
396 uicontrol( ... | |
397 'Units','normalized', ... | |
398 'BackgroundColor',fig_color, ... | |
399 'HorizontalAlignment','left', ... | |
400 'Position',hint_text_pos, ... | |
401 'String','Add planes and then visualize', ... | |
402 'Style','text'); | |
403 | |
404 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
405 % planes listbox | |
406 % | |
407 uicontrol( ... | |
408 'Units','normalized', ... | |
409 'Position',big_frame_pos, ... | |
410 'Style','frame'); | |
411 | |
412 uicontrol( ... | |
413 'Units','normalized', ... | |
414 'BackgroundColor',bg_color1, ... | |
415 'HorizontalAlignment','left', ... | |
416 'Position',planes_listbox_text_pos, ... | |
417 'String','Planes', ... | |
418 'Style','text'); | |
419 | |
420 list1_h = uicontrol( ... | |
421 'Units','normalized', ... | |
422 'BackgroundColor',bg_color2, ... | |
423 'Position',planes_listbox_pos, ... | |
424 'String',{plot_array(:).string}, ... | |
425 'Style','listbox', ... | |
426 'Max',2, ... | |
427 'Value',1); | |
428 | |
429 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
430 % edit subplots | |
431 % | |
432 uicontrol( ... | |
433 'Units','normalized', ... | |
434 'BackgroundColor',bg_color1, ... | |
435 'HorizontalAlignment','center', ... | |
436 'Position',subplots_text_pos, ... | |
437 'String','subplots', ... | |
438 'Style','text'); | |
439 | |
440 edit4_h = uicontrol( ... | |
441 'Units','normalized', ... | |
442 'BackgroundColor',bg_color2, ... | |
443 'Position',subplots_pos, ... | |
444 'FontSize',14, ... | |
445 'String','', ... | |
446 'Style','edit'); | |
447 | |
448 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
449 % pushbutton 'Add components' | |
450 % | |
451 uicontrol( ... | |
452 'Units','normalized', ... | |
453 'BackgroundColor',bg_color1, ... | |
454 'HorizontalAlignment','left', ... | |
455 'Position',add_components_pos, ... | |
456 'String',' Add components', ... | |
457 'Callback',['som_show_gui(''add_selected_comp'',' mat2str(gcf) ')']); | |
458 | |
459 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
460 % pushbutton 'Add all components' | |
461 % | |
462 uicontrol( ... | |
463 'Units','normalized', ... | |
464 'HorizontalAlignment','left', ... | |
465 'Position',add_all_components_pos, ... | |
466 'String',' Add all components', ... | |
467 'Callback',['som_show_gui(''add_all_comps'',' mat2str(gcf) ')']); | |
468 | |
469 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
470 % pushbutton 'Add U-matrix' | |
471 % | |
472 uicontrol( ... | |
473 'Units','normalized', ... | |
474 'HorizontalAlignment','left', ... | |
475 'Position',add_u_matrix_pos, ... | |
476 'String',' Add U-matrix', ... | |
477 'Callback',['som_show_gui(''add_u_matrix'',' mat2str(gcf) ')']); | |
478 | |
479 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
480 % pushbutton 'Add colorplane' | |
481 % | |
482 uicontrol( ... | |
483 'Units','normalized', ... | |
484 'HorizontalAlignment','left', ... | |
485 'Position',add_colorplane_pos, ... | |
486 'String',' Add colorplane', ... | |
487 'Callback',['som_show_gui(''add_colorplane'',' mat2str(gcf) ')']); | |
488 | |
489 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
490 % pushbutton 'Add empty' | |
491 % | |
492 uicontrol( ... | |
493 'Units','normalized', ... | |
494 'HorizontalAlignment','left', ... | |
495 'Position',add_empty_pos, ... | |
496 'String',' Add empty', ... | |
497 'Callback',['som_show_gui(''add_empty'',' mat2str(gcf) ')']); | |
498 | |
499 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
500 % pushbutton 'Remove' | |
501 % | |
502 uicontrol( ... | |
503 'Units','normalized', ... | |
504 'HorizontalAlignment','left', ... | |
505 'Position',remove_pos, ... | |
506 'String',' Remove', ... | |
507 'Callback',['som_show_gui(''remove'',' mat2str(gcf) ')']); | |
508 | |
509 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
510 % creat pushbutton 'Remove all' | |
511 % | |
512 uicontrol( ... | |
513 'Units','normalized', ... | |
514 'BackgroundColor',bg_color1, ... | |
515 'HorizontalAlignment','left', ... | |
516 'Position',remove_all_pos, ... | |
517 'String',' Remove all', ... | |
518 'Callback',['som_show_gui(''remove_all'',' mat2str(gcf) ')']); | |
519 | |
520 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
521 % pushbutton 'Plane options' | |
522 % | |
523 uicontrol( ... | |
524 'Units','normalized', ... | |
525 'Position',plane_options_pos, ... | |
526 'String',' Plane options', ... | |
527 'Callback',['som_show_gui(''more_options'',' mat2str(gcf) ')']); | |
528 | |
529 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
530 % popupmenu unitedges | |
531 % | |
532 uicontrol( ... | |
533 'Units','normalized', ... | |
534 'BackgroundColor',fig_color, ... | |
535 'HorizontalAlignment','left', ... | |
536 'Position',unit_edges_text_pos, ... | |
537 'String','unit edges are', ... | |
538 'Style','text'); | |
539 | |
540 popup1_h = uicontrol( ... | |
541 'Units','normalized', ... | |
542 'Max',2, ... | |
543 'Min',1, ... | |
544 'Position',unit_edges_pos, ... | |
545 'UserData',{'off' 'on'}, ... | |
546 'String',{'off' 'on'}, ... | |
547 'Style','popupmenu', ... | |
548 'Value',1); | |
549 | |
550 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
551 % unit sizes edit | |
552 % | |
553 uicontrol( ... | |
554 'Units','normalized', ... | |
555 'BackgroundColor',fig_color, ... | |
556 'HorizontalAlignment','left', ... | |
557 'Position',unit_sizes_text_pos, ... | |
558 'String','unit sizes', ... | |
559 'Style','text'); | |
560 | |
561 edit1_h = uicontrol( ... | |
562 'Units','normalized', ... | |
563 'BackgroundColor',bg_color2, ... | |
564 'Position',unit_sizes_pos, ... | |
565 'FontSize',12, ... | |
566 'String','1', ... | |
567 'Style','edit'); | |
568 | |
569 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
570 % popupmenu colorbardir | |
571 % | |
572 uicontrol( ... | |
573 'Units','normalized', ... | |
574 'BackgroundColor',fig_color, ... | |
575 'HorizontalAlignment','left', ... | |
576 'Position',colorbar_dir_text_pos, ... | |
577 'String','colorbar is', ... | |
578 'Style','text'); | |
579 | |
580 popup2_h = uicontrol( ... | |
581 'Units','normalized', ... | |
582 'Max',3, ... | |
583 'Min',1, ... | |
584 'Position',colorbar_dir_pos, ... | |
585 'UserData', {'vert' 'horiz' 'none'}, ... | |
586 'String','vert| horiz| none', ... | |
587 'Style','popupmenu', ... | |
588 'Value',1); | |
589 | |
590 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
591 % popupmenu colorbarnorm | |
592 % | |
593 uicontrol( ... | |
594 'Units','normalized', ... | |
595 'BackgroundColor',fig_color, ... | |
596 'HorizontalAlignment','left', ... | |
597 'Position',colorbar_norm_text_pos, ... | |
598 'String',' and ', ... | |
599 'Style','text'); | |
600 | |
601 popup3_h = uicontrol( ... | |
602 'Units','normalized', ... | |
603 'Max',2, ... | |
604 'Min',1, ... | |
605 'Position',colorbar_norm_pos, ... | |
606 'UserData', {'d' 'n'}, ... | |
607 'String',{'denormalized','normalized'}, ... | |
608 'Style','popupmenu', ... | |
609 'Value',1); | |
610 | |
611 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
612 % colormap edittext | |
613 % | |
614 uicontrol( ... | |
615 'Units','normalized', ... | |
616 'BackgroundColor',fig_color, ... | |
617 'HorizontalAlignment','left', ... | |
618 'Position',colormap_text_pos, ... | |
619 'String','colormap', ... | |
620 'Style','text'); | |
621 | |
622 edit2_h = uicontrol( ... | |
623 'Units','normalized', ... | |
624 'BackgroundColor',bg_color2, ... | |
625 'Position',colormap_pos, ... | |
626 'FontSize',12, ... | |
627 'String','', ... | |
628 'Style','edit'); | |
629 | |
630 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
631 % footnote edittext | |
632 % | |
633 uicontrol( ... | |
634 'Units','normalized', ... | |
635 'BackgroundColor',fig_color, ... | |
636 'HorizontalAlignment','left', ... | |
637 'Position',footnote_text_pos, ... | |
638 'String','footnote', ... | |
639 'Style','text'); | |
640 | |
641 edit3_h = uicontrol( ... | |
642 'Units','normalized', ... | |
643 'BackgroundColor',bg_color2, ... | |
644 'Position',footnote_pos, ... | |
645 'FontSize',12, ... | |
646 'String',sM.name, ... | |
647 'Style','edit'); | |
648 | |
649 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
650 % pushbutton 'Visualize' | |
651 % | |
652 uicontrol( ... | |
653 'Units','normalized', ... | |
654 'Position',little_frame_pos, ... | |
655 'Style','frame'); | |
656 | |
657 uicontrol( ... | |
658 'Units','normalized', ... | |
659 'Position',visualize_pos, ... | |
660 'String','Visualize', ... | |
661 'Callback',['som_show_gui(''visualize'',' mat2str(gcf) ')']); | |
662 | |
663 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
664 % pushbutton 'Close' | |
665 % | |
666 uicontrol( ... | |
667 'Units','normalized', ... | |
668 'BackgroundColor',bg_color1, ... | |
669 'Position',close_pos, ... | |
670 'String','Close', ... | |
671 'Callback',['som_show_gui(''close'',' mat2str(gcf) ')']); | |
672 | |
673 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
674 % menus | |
675 % | |
676 uimenu('Parent',fig_h','Label',' ','Enable','off'); | |
677 m = uimenu('Parent',fig_h,'Label','Tools'); | |
678 a = uimenu('Parent',m,'Label','Add'); | |
679 s = strcat('vis_show_gui_tool(',mat2str(gcf),',''add_label'')'); | |
680 uimenu('Parent',a,'Label','label','Callback',s); | |
681 s = strcat('vis_show_gui_tool(',mat2str(gcf),',''add_hit'')'); | |
682 uimenu('Parent',a,'Label','hit','Callback',s); | |
683 s = strcat('vis_show_gui_tool(',mat2str(gcf),',''add_traj'')'); | |
684 uimenu('Parent',a,'Label','traj','Callback',s); | |
685 s = strcat('vis_show_gui_tool(',mat2str(gcf),',''add_comet'')'); | |
686 uimenu('Parent',a,'Label','comet','Callback',s); | |
687 s = ['vis_show_gui_tool(',mat2str(gcf),',''clear'')']; | |
688 c = uimenu('Parent',m,'Label','Clear','Separator','on','callback',s); | |
689 s = strcat('vis_show_gui_tool(',mat2str(gcf),',''recolorbar'')'); | |
690 r = uimenu('Parent',m,'Label','Recolorbar','Separator','on', ... | |
691 'Callback',s); | |
692 | |
693 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
694 % end | |
695 % | |
696 | |
697 ud.sM = sM; | |
698 ud.plot_array = plot_array; | |
699 ud.property = {}; | |
700 ud.vis_h = []; | |
701 ud.h = [list1_h popup1_h popup2_h popup3_h ... | |
702 edit1_h edit2_h edit3_h edit4_h]; | |
703 | |
704 watchoff(oldFigNumber); | |
705 set(fig_h,'Visible','on', ... | |
706 'UserData', ud, ... | |
707 'handlevisibility','off'); | |
708 |