wolffd@0: function sompak_init_gui() wolffd@0: wolffd@0: %SOMPAK_INIT_GUI A GUI for using SOM_PAK initialization programs from Matlab. wolffd@0: % wolffd@0: % sompak_init_gui wolffd@0: % wolffd@0: % Launches a GUI which allows the use of SOM_PAK initialization wolffd@0: % programs (randinit and lininit) from Matlab. Notice that to use this wolffd@0: % function, the SOM_PAK programs must be in your search path, or the wolffd@0: % variable 'SOM_PAKDIR' which is a string containing the program path, wolffd@0: % must be defined in the workspace. SOM_PAK programs can be found wolffd@0: % from: http://www.cis.hut.fi/research/som_lvq_pak.shtml wolffd@0: % wolffd@0: % See also SOMPAK_INIT, SOMPAK_GUI, SOMPAK_SAMMON_GUI, wolffd@0: % SOMPAK_TRAIN_GUI, SOM_GUI. wolffd@0: wolffd@0: % Contributed to SOM Toolbox vs2, February 2nd, 2000 wolffd@0: % Copyright (c) by Juha Parhankangas wolffd@0: % http://www.cis.hut.fi/projects/somtoolbox/ wolffd@0: wolffd@0: % Juha Parhankangas 050100 wolffd@0: wolffd@0: h=findobj(get(0,'Children'),'Tag','InitGUI'); wolffd@0: wolffd@0: if ~isempty(h) wolffd@0: figure(h); wolffd@0: return; wolffd@0: end wolffd@0: wolffd@0: a = figure('Color',[0.8 0.8 0.8], ... wolffd@0: 'PaperType','a4letter', ... wolffd@0: 'Position',[483 407 172 440], ... wolffd@0: 'Tag','InitGUI'); wolffd@0: b = uicontrol('Parent',a, ... wolffd@0: 'Units','points', ... wolffd@0: 'BackgroundColor',[0.701961 0.701961 0.701961], ... wolffd@0: 'Callback','close gcf',... wolffd@0: 'FontWeight','demi', ... wolffd@0: 'Position',[8 20 50 20], ... wolffd@0: 'String','CLOSE', ... wolffd@0: 'Tag','Pushbutton1'); wolffd@0: b = uicontrol('Parent',a, ... wolffd@0: 'Units','points', ... wolffd@0: 'BackgroundColor',[0.701961 0.701961 0.701961], ... wolffd@0: 'Callback','sompak_rb_control init_ok', ... wolffd@0: 'FontWeight','demi', ... wolffd@0: 'Position',[86 20 50 20], ... wolffd@0: 'String','OK', ... wolffd@0: 'Tag','Pushbutton2'); wolffd@0: b = uicontrol('Parent',a, ... wolffd@0: 'Units','points', ... wolffd@0: 'BackgroundColor',[0.701961 0.701961 0.701961], ... wolffd@0: 'Position',[8 50 130 300], ... wolffd@0: 'Style','frame', ... wolffd@0: 'Tag','Frame1'); wolffd@0: b = uicontrol('Parent',a, ... wolffd@0: 'Units','points', ... wolffd@0: 'BackgroundColor',[0.8 0.8 0.8], ... wolffd@0: 'Position',[12 54 122 40], ... wolffd@0: 'Style','frame', ... wolffd@0: 'Tag','Frame2'); wolffd@0: b = uicontrol('Parent',a, ... wolffd@0: 'Units','points', ... wolffd@0: 'BackgroundColor',[0.8 0.8 0.8], ... wolffd@0: 'FontWeight','demi', ... wolffd@0: 'Position',[45.5 78 55 12], ... wolffd@0: 'String','INIT TYPE', ... wolffd@0: 'Style','text', ... wolffd@0: 'Tag','StaticText1'); wolffd@0: b = uicontrol('Parent',a, ... wolffd@0: 'Callback','sompak_rb_control linear',... wolffd@0: 'Units','points', ... wolffd@0: 'BackgroundColor',[0.701961 0.701961 0.701961], ... wolffd@0: 'Position',[14 56 17 16], ... wolffd@0: 'Style','radiobutton', ... wolffd@0: 'Tag','LINEAR', ... wolffd@0: 'Value',1); wolffd@0: wolffd@0: udata.inittype = 'linear'; wolffd@0: wolffd@0: b = uicontrol('Parent',a, ... wolffd@0: 'Callback','sompak_rb_control rand',... wolffd@0: 'Units','points', ... wolffd@0: 'BackgroundColor',[0.701961 0.701961 0.701961], ... wolffd@0: 'Position',[73 56 17 16], ... wolffd@0: 'Style','radiobutton', ... wolffd@0: 'Tag','RANDOM'); wolffd@0: b = uicontrol('Parent',a, ... wolffd@0: 'Units','points', ... wolffd@0: 'BackgroundColor',[0.8 0.8 0.8], ... wolffd@0: 'FontWeight','demi', ... wolffd@0: 'HorizontalAlignment','left', ... wolffd@0: 'Position',[33 58 30 12], ... wolffd@0: 'String','Linear', ... wolffd@0: 'Style','text', ... wolffd@0: 'Tag','StaticText2'); wolffd@0: b = uicontrol('Parent',a, ... wolffd@0: 'Units','points', ... wolffd@0: 'BackgroundColor',[0.8 0.8 0.8], ... wolffd@0: 'FontWeight','demi', ... wolffd@0: 'HorizontalAlignment','left', ... wolffd@0: 'Position',[91 58 37 12], ... wolffd@0: 'String','Random', ... wolffd@0: 'Style','text', ... wolffd@0: 'Tag','StaticText3'); wolffd@0: b = uicontrol('Parent',a, ... wolffd@0: 'Units','points', ... wolffd@0: 'BackgroundColor',[0.8 0.8 0.8], ... wolffd@0: 'Position',[12 96 122 40], ... wolffd@0: 'Style','frame', ... wolffd@0: 'Tag','Frame3'); wolffd@0: b = uicontrol('Parent',a, ... wolffd@0: 'Units','points', ... wolffd@0: 'BackgroundColor',[0.8 0.8 0.8], ... wolffd@0: 'FontWeight','demi', ... wolffd@0: 'Position',[36.4235 118.588 74 12], ... wolffd@0: 'String','NEIGHBORHOOD', ... wolffd@0: 'Style','text', ... wolffd@0: 'Tag','StaticText4'); wolffd@0: b = uicontrol('Parent',a, ... wolffd@0: 'Callback','sompak_rb_control bubble',... wolffd@0: 'Units','points', ... wolffd@0: 'BackgroundColor',[0.701961 0.701961 0.701961], ... wolffd@0: 'Position',[14 98 17 16], ... wolffd@0: 'Style','radiobutton', ... wolffd@0: 'Tag','BUBBLE', ... wolffd@0: 'Value',1); wolffd@0: wolffd@0: udata.neigh='bubble'; wolffd@0: wolffd@0: b = uicontrol('Parent',a, ... wolffd@0: 'Callback','sompak_rb_control gaussian',... wolffd@0: 'Units','points', ... wolffd@0: 'BackgroundColor',[0.701961 0.701961 0.701961], ... wolffd@0: 'Position',[73 98 17 16], ... wolffd@0: 'Style','radiobutton', ... wolffd@0: 'Tag','GAUSSIAN'); wolffd@0: b = uicontrol('Parent',a, ... wolffd@0: 'Units','points', ... wolffd@0: 'BackgroundColor',[0.8 0.8 0.8], ... wolffd@0: 'FontWeight','demi', ... wolffd@0: 'HorizontalAlignment','left', ... wolffd@0: 'Position',[33 100 32 12], ... wolffd@0: 'String','Bubble', ... wolffd@0: 'Style','text', ... wolffd@0: 'Tag','StaticText5'); wolffd@0: b = uicontrol('Parent',a, ... wolffd@0: 'Units','points', ... wolffd@0: 'BackgroundColor',[0.8 0.8 0.8], ... wolffd@0: 'FontWeight','demi', ... wolffd@0: 'HorizontalAlignment','left', ... wolffd@0: 'Position',[89.5 100 43 12], ... wolffd@0: 'String','Gaussian', ... wolffd@0: 'Style','text', ... wolffd@0: 'Tag','StaticText6'); wolffd@0: b = uicontrol('Parent',a, ... wolffd@0: 'Units','points', ... wolffd@0: 'BackgroundColor',[0.8 0.8 0.8], ... wolffd@0: 'Position',[12 138 122 40], ... wolffd@0: 'Style','frame', ... wolffd@0: 'Tag','Frame4'); wolffd@0: b = uicontrol('Parent',a, ... wolffd@0: 'Units','points', ... wolffd@0: 'BackgroundColor',[0.8 0.8 0.8], ... wolffd@0: 'FontWeight','demi', ... wolffd@0: 'Position',[45 162 55 12], ... wolffd@0: 'String','TOPOLOGY', ... wolffd@0: 'Style','text', ... wolffd@0: 'Tag','StaticText7'); wolffd@0: b = uicontrol('Parent',a, ... wolffd@0: 'Callback','sompak_rb_control hexa',... wolffd@0: 'Units','points', ... wolffd@0: 'Position',[14 140 17 16], ... wolffd@0: 'Style','radiobutton', ... wolffd@0: 'Tag','HEXA', ... wolffd@0: 'Value',1); wolffd@0: wolffd@0: udata.topol='hexa'; wolffd@0: wolffd@0: b = uicontrol('Parent',a, ... wolffd@0: 'Callback','sompak_rb_control rect',... wolffd@0: 'Units','points', ... wolffd@0: 'Position',[73 140 17 16], ... wolffd@0: 'Style','radiobutton', ... wolffd@0: 'Tag','RECT'); wolffd@0: b = uicontrol('Parent',a, ... wolffd@0: 'Units','points', ... wolffd@0: 'BackgroundColor',[0.8 0.8 0.8], ... wolffd@0: 'FontWeight','demi', ... wolffd@0: 'HorizontalAlignment','left', ... wolffd@0: 'Position',[33 142 30 12], ... wolffd@0: 'String','Hexa', ... wolffd@0: 'Style','text', ... wolffd@0: 'Tag','StaticText8'); wolffd@0: b = uicontrol('Parent',a, ... wolffd@0: 'Units','points', ... wolffd@0: 'BackgroundColor',[0.8 0.8 0.8], ... wolffd@0: 'FontWeight','demi', ... wolffd@0: 'HorizontalAlignment','left', ... wolffd@0: 'Position',[90 142 30 12], ... wolffd@0: 'String','Rect', ... wolffd@0: 'Style','text', ... wolffd@0: 'Tag','StaticText9'); wolffd@0: b = uicontrol('Parent',a, ... wolffd@0: 'Units','points', ... wolffd@0: 'BackgroundColor',[0.8 0.8 0.8], ... wolffd@0: 'Position',[12 180 122 40], ... wolffd@0: 'Style','frame', ... wolffd@0: 'Tag','Frame5'); wolffd@0: b = uicontrol('Parent',a, ... wolffd@0: 'Units','points', ... wolffd@0: 'BackgroundColor',[0.8 0.8 0.8], ... wolffd@0: 'FontWeight','demi', ... wolffd@0: 'HorizontalAlignment','left', ... wolffd@0: 'Position',[25 202 33 12], ... wolffd@0: 'String','X-dim', ... wolffd@0: 'Style','text', ... wolffd@0: 'Tag','StaticText10'); wolffd@0: b = uicontrol('Parent',a, ... wolffd@0: 'Units','points', ... wolffd@0: 'BackgroundColor',[0.8 0.8 0.8], ... wolffd@0: 'FontWeight','demi', ... wolffd@0: 'HorizontalAlignment','left', ... wolffd@0: 'Position',[89 202 33 12], ... wolffd@0: 'String','Y-dim', ... wolffd@0: 'Style','text', ... wolffd@0: 'Tag','StaticText11'); wolffd@0: b = uicontrol('Parent',a, ... wolffd@0: 'Units','points', ... wolffd@0: 'BackgroundColor',[1 1 1], ... wolffd@0: 'Callback','sompak_rb_control xdim',... wolffd@0: 'Position',[20 183 40 20], ... wolffd@0: 'Style','edit', ... wolffd@0: 'Tag','XDIM'); wolffd@0: b = uicontrol('Parent',a, ... wolffd@0: 'Units','points', ... wolffd@0: 'BackgroundColor',[1 1 1], ... wolffd@0: 'Callback','sompak_rb_control ydim',... wolffd@0: 'Position',[85 183 40 20], ... wolffd@0: 'Style','edit', ... wolffd@0: 'Tag','YDIM'); wolffd@0: wolffd@0: udata.xdim=[]; wolffd@0: udata.ydim=[]; wolffd@0: wolffd@0: b = uicontrol('Parent',a, ... wolffd@0: 'Units','points', ... wolffd@0: 'BackgroundColor',[0.8 0.8 0.8], ... wolffd@0: 'Position',[12 222 122 40], ... wolffd@0: 'Style','frame', ... wolffd@0: 'Tag','Frame6'); wolffd@0: b = uicontrol('Parent',a, ... wolffd@0: 'Units','points', ... wolffd@0: 'BackgroundColor',[0.8 0.8 0.8], ... wolffd@0: 'FontWeight','demi', ... wolffd@0: 'Position',[25 245 95 12], ... wolffd@0: 'String','OUTPUT VARIABLE', ... wolffd@0: 'Style','text', ... wolffd@0: 'Tag','StaticText12'); wolffd@0: b = uicontrol('Parent',a, ... wolffd@0: 'Units','points', ... wolffd@0: 'BackgroundColor',[1 1 1], ... wolffd@0: 'Callback','sompak_rb_control out_var',... wolffd@0: 'Position',[22 226 102 20], ... wolffd@0: 'String','''ans''', ... wolffd@0: 'Style','edit', ... wolffd@0: 'Tag','OUT_VAR'); wolffd@0: wolffd@0: udata.out_var='ans'; wolffd@0: wolffd@0: b = uicontrol('Parent',a, ... wolffd@0: 'Units','points', ... wolffd@0: 'BackgroundColor',[0.8 0.8 0.8], ... wolffd@0: 'Position',[12 264 122 40], ... wolffd@0: 'Style','frame', ... wolffd@0: 'Tag','Frame7'); wolffd@0: b = uicontrol('Parent',a, ... wolffd@0: 'Units','points', ... wolffd@0: 'BackgroundColor',[1 1 1], ... wolffd@0: 'Callback','sompak_rb_control out_file',... wolffd@0: 'Position',[15 267 50 20], ... wolffd@0: 'Style','edit', ... wolffd@0: 'Tag','OUT_FILE'); wolffd@0: wolffd@0: udata.out_file=[]; wolffd@0: wolffd@0: b = uicontrol('Parent',a, ... wolffd@0: 'Units','points', ... wolffd@0: 'BackgroundColor',[0.8 0.8 0.8], ... wolffd@0: 'FontWeight','demi', ... wolffd@0: 'HorizontalAlignment','left', ... wolffd@0: 'Position',[40 288 60 12], ... wolffd@0: 'String','OUTPUT FILE', ... wolffd@0: 'Style','text', ... wolffd@0: 'Tag','StaticText13'); wolffd@0: b = uicontrol('Parent',a, ... wolffd@0: 'Units','points', ... wolffd@0: 'BackgroundColor',[0.701961 0.701961 0.701961], ... wolffd@0: 'Callback','sompak_rb_control out_ft',... wolffd@0: 'FontSize',9, ... wolffd@0: 'FontWeight','demi', ... wolffd@0: 'HorizontalAlignment','left', ... wolffd@0: 'Max',3, ... wolffd@0: 'Min',1, ... wolffd@0: 'Position',[70 272 62 15], ... wolffd@0: 'String',{'No File';'mat-file';'cod-file'}, ... wolffd@0: 'Style','popupmenu', ... wolffd@0: 'Tag','OUT_FILE_TYPE', ... wolffd@0: 'Value',1); wolffd@0: wolffd@0: udata.out_file_type=''; wolffd@0: wolffd@0: b = uicontrol('Parent',a, ... wolffd@0: 'Units','points', ... wolffd@0: 'BackgroundColor',[0.8 0.8 0.8], ... wolffd@0: 'Position',[12 306 122 40], ... wolffd@0: 'Style','frame', ... wolffd@0: 'Tag','Frame8'); wolffd@0: b = uicontrol('Parent',a, ... wolffd@0: 'Units','points', ... wolffd@0: 'BackgroundColor',[0.8 0.8 0.8], ... wolffd@0: 'FontWeight','demi', ... wolffd@0: 'HorizontalAlignment','left', ... wolffd@0: 'Position',[57 330 30 12], ... wolffd@0: 'String','DATA', ... wolffd@0: 'Style','text', ... wolffd@0: 'Tag','StaticText14'); wolffd@0: b = uicontrol('Parent',a, ... wolffd@0: 'Units','points', ... wolffd@0: 'BackgroundColor',[1 1 1], ... wolffd@0: 'Callback','sompak_rb_control data',... wolffd@0: 'Position',[15 309 50 20], ... wolffd@0: 'Style','edit', ... wolffd@0: 'Tag','DATA'); wolffd@0: wolffd@0: udata.data=[]; wolffd@0: wolffd@0: b = uicontrol('Parent',a, ... wolffd@0: 'Units','points', ... wolffd@0: 'Callback','sompak_rb_control input_ft',... wolffd@0: 'FontSize',9, ... wolffd@0: 'FontWeight','demi', ... wolffd@0: 'HorizontalAlignment','left', ... wolffd@0: 'Max',3, ... wolffd@0: 'Min',1, ... wolffd@0: 'Position',[70 314 62 15], ... wolffd@0: 'String',{'Variable';'mat-file';'dat-file'}, ... wolffd@0: 'Style','popupmenu', ... wolffd@0: 'Tag','INPUT_FILE_TYPE', ... wolffd@0: 'Value',1); wolffd@0: udata.input_file_type=''; wolffd@0: wolffd@0: b = uicontrol('Parent',a, ... wolffd@0: 'Units','points', ... wolffd@0: 'BackgroundColor',[0.8 0.8 0.8], ... wolffd@0: 'FontSize',12, ... wolffd@0: 'FontWeight','bold', ... wolffd@0: 'HorizontalAlignment','left', ... wolffd@0: 'Position',[57 355 30 12], ... wolffd@0: 'String','INIT', ... wolffd@0: 'Style','text', ... wolffd@0: 'Tag','StaticText15'); wolffd@0: wolffd@0: set(gcf,'UserData',udata); wolffd@0: wolffd@0: wolffd@0: wolffd@0: wolffd@0: