wolffd@0: function sompak_train_gui() wolffd@0: wolffd@0: %SOMPAK_TRAIN_GUI A GUI for using SOM_PAK training program from Matlab. wolffd@0: % wolffd@0: % sompak_train_gui wolffd@0: % wolffd@0: % Launches a GUI which allows the use of SOM_PAK training program wolffd@0: % (vsom) from Matlab. Notice that to use this function, the SOM_PAK wolffd@0: % programs must be in your search path, or the variable 'SOM_PAKDIR' wolffd@0: % which is a string containing the program path, must be defined in wolffd@0: % the workspace. SOM_PAK programs can be found from: wolffd@0: % http://www.cis.hut.fi/research/som_lvq_pak.shtml wolffd@0: % wolffd@0: % See also SOMPAK_TRAIN, SOMPAK_GUI, SOMPAK_INIT_GUI, wolffd@0: % SOMPAK_SAMMON_GUI, SOM_GUI. wolffd@0: wolffd@0: % Contributed to SOM Toolbox vs2, February 2nd, 2000 by Juha Parhankangas 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','TrainGUI'); 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',[558 207 173 445], ... wolffd@0: 'Tag','TrainGUI'); 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 train_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: 'HorizontalAlignment','left', ... wolffd@0: 'Position',[18 78 110 12], ... wolffd@0: 'String','NEIGHBORHOOD RADIUS', ... wolffd@0: 'Style','text', ... wolffd@0: 'Tag','StaticText1'); wolffd@0: b = uicontrol('Parent',a, ... wolffd@0: 'Units','points', ... wolffd@0: 'BackgroundColor',[1 1 1], ... wolffd@0: 'Callback','sompak_rb_control radius', ... wolffd@0: 'Position',[48 56 50 20], ... wolffd@0: 'Style','edit', ... wolffd@0: 'Tag','RADIUS'); wolffd@0: wolffd@0: udata.radius=[]; 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 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: 'HorizontalAlignment','left', ... wolffd@0: 'Position',[22 120 101 12], ... wolffd@0: 'String','INITIAL ALPHA VALUE', ... wolffd@0: 'Style','text', ... wolffd@0: 'Tag','StaticText2'); wolffd@0: b = uicontrol('Parent',a, ... wolffd@0: 'Units','points', ... wolffd@0: 'BackgroundColor',[1 1 1], ... wolffd@0: 'Callback','sompak_rb_control alpha',... wolffd@0: 'Position',[48 99 50 20], ... wolffd@0: 'Style','edit', ... wolffd@0: 'Tag','ALPHA'); wolffd@0: wolffd@0: wolffd@0: udata.alpha=[]; wolffd@0: 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 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: 'HorizontalAlignment','left', ... wolffd@0: 'Position',[30 163 90 12], ... wolffd@0: 'String','RUNNING LENGTH', ... wolffd@0: 'Style','text', ... wolffd@0: 'Tag','StaticText3'); wolffd@0: b = uicontrol('Parent',a, ... wolffd@0: 'Units','points', ... wolffd@0: 'BackgroundColor',[1 1 1], ... wolffd@0: 'Callback','sompak_rb_control rlen',... wolffd@0: 'Position',[48 141 50 20], ... wolffd@0: 'Style','edit', ... wolffd@0: 'Tag','RLEN'); wolffd@0: wolffd@0: udata.rlen=[]; 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 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',[30 204 90 11], ... wolffd@0: 'String','OUTPUT VARIABLE', ... wolffd@0: 'Style','text', ... wolffd@0: 'Tag','StaticText4'); 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',[48 183 50 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 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: 'HorizontalAlignment','left', ... wolffd@0: 'Position',[42 245 65 12], ... wolffd@0: 'String','OUTPUT FILE', ... wolffd@0: 'Style','text', ... wolffd@0: 'Tag','StaticText5'); 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 225 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: 'Callback','sompak_rb_control out_ft',... wolffd@0: 'Units','points', ... wolffd@0: 'FontWeight','demi', ... wolffd@0: 'HorizontalAlignment','left', ... wolffd@0: 'Max',3, ... wolffd@0: 'Min',1, ... wolffd@0: 'Position',[70 230 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 264 122 40], ... wolffd@0: 'Style','frame', ... wolffd@0: 'Tag','Frame7'); 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',[34 288 85 12], ... wolffd@0: 'String','TEACHING DATA', ... wolffd@0: 'Style','text', ... wolffd@0: 'Tag','StaticText6'); 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 267 50 20], ... wolffd@0: 'Style','edit', ... wolffd@0: 'Tag','DATA'); 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 input_ft',... 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',{'Variable';'mat-file';'dat-file'}, ... wolffd@0: 'Style','popupmenu', ... wolffd@0: 'Tag','INPUT_FILE_TYPE', ... wolffd@0: 'Value',1); wolffd@0: 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: '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',[60 331 25 12], ... wolffd@0: 'String','MAP', ... wolffd@0: 'Style','text', ... wolffd@0: 'Tag','StaticText7'); wolffd@0: b = uicontrol('Parent',a, ... wolffd@0: 'Units','points', ... wolffd@0: 'BackgroundColor',[1 1 1], ... wolffd@0: 'Callback','sompak_rb_control map',... wolffd@0: 'Position',[15 309 50 20], ... wolffd@0: 'Style','edit', ... wolffd@0: 'Tag','MAP'); wolffd@0: wolffd@0: udata.map=[]; wolffd@0: 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 map_ft',... 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','cod-file'}, ... wolffd@0: 'Style','popupmenu', ... wolffd@0: 'Tag','MAP_TYPE', ... wolffd@0: 'Value',1); wolffd@0: wolffd@0: udata.map_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','demi', ... wolffd@0: 'HorizontalAlignment','left', ... wolffd@0: 'Position',[50 359 48 12], ... wolffd@0: 'String','TRAIN', ... wolffd@0: 'Style','text', ... wolffd@0: 'Tag','StaticText8'); wolffd@0: wolffd@0: set(gcf,'UserData',udata); wolffd@0: