annotate toolboxes/MIRtoolbox1.3.2/somtoolbox/som_show_gui.m @ 0:cc4b1211e677 tip

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