annotate toolboxes/MIRtoolbox1.3.2/somtoolbox/sompak_train_gui.m @ 0:e9a9cd732c1e tip

first hg version after svn
author wolffd
date Tue, 10 Feb 2015 15:05:51 +0000
parents
children
rev   line source
wolffd@0 1 function sompak_train_gui()
wolffd@0 2
wolffd@0 3 %SOMPAK_TRAIN_GUI A GUI for using SOM_PAK training program from Matlab.
wolffd@0 4 %
wolffd@0 5 % sompak_train_gui
wolffd@0 6 %
wolffd@0 7 % Launches a GUI which allows the use of SOM_PAK training program
wolffd@0 8 % (vsom) from Matlab. Notice that to use this function, the SOM_PAK
wolffd@0 9 % programs must be in your search path, or the variable 'SOM_PAKDIR'
wolffd@0 10 % which is a string containing the program path, must be defined in
wolffd@0 11 % the workspace. SOM_PAK programs can be found from:
wolffd@0 12 % http://www.cis.hut.fi/research/som_lvq_pak.shtml
wolffd@0 13 %
wolffd@0 14 % See also SOMPAK_TRAIN, SOMPAK_GUI, SOMPAK_INIT_GUI,
wolffd@0 15 % SOMPAK_SAMMON_GUI, SOM_GUI.
wolffd@0 16
wolffd@0 17 % Contributed to SOM Toolbox vs2, February 2nd, 2000 by Juha Parhankangas
wolffd@0 18 % Copyright (c) by Juha Parhankangas
wolffd@0 19 % http://www.cis.hut.fi/projects/somtoolbox/
wolffd@0 20
wolffd@0 21 % Juha Parhankangas 050100
wolffd@0 22
wolffd@0 23 h=findobj(get(0,'Children'),'Tag','TrainGUI');
wolffd@0 24
wolffd@0 25 if ~isempty(h)
wolffd@0 26 figure(h);
wolffd@0 27 return;
wolffd@0 28 end
wolffd@0 29
wolffd@0 30 a = figure('Color',[0.8 0.8 0.8],...
wolffd@0 31 'PaperType','a4letter', ...
wolffd@0 32 'Position',[558 207 173 445], ...
wolffd@0 33 'Tag','TrainGUI');
wolffd@0 34 b = uicontrol('Parent',a, ...
wolffd@0 35 'Units','points', ...
wolffd@0 36 'BackgroundColor',[0.701961 0.701961 0.701961], ...
wolffd@0 37 'Callback','close gcf', ...
wolffd@0 38 'FontWeight','demi', ...
wolffd@0 39 'Position',[8 20 50 20], ...
wolffd@0 40 'String','CLOSE', ...
wolffd@0 41 'Tag','Pushbutton1');
wolffd@0 42 b = uicontrol('Parent',a, ...
wolffd@0 43 'Units','points', ...
wolffd@0 44 'BackgroundColor',[0.701961 0.701961 0.701961], ...
wolffd@0 45 'Callback','sompak_rb_control train_ok',...
wolffd@0 46 'FontWeight','demi', ...
wolffd@0 47 'Position',[86 20 50 20], ...
wolffd@0 48 'String','OK', ...
wolffd@0 49 'Tag','Pushbutton2');
wolffd@0 50 b = uicontrol('Parent',a, ...
wolffd@0 51 'Units','points', ...
wolffd@0 52 'BackgroundColor',[0.701961 0.701961 0.701961], ...
wolffd@0 53 'Position',[8 50 130 300], ...
wolffd@0 54 'Style','frame', ...
wolffd@0 55 'Tag','Frame1');
wolffd@0 56 b = uicontrol('Parent',a, ...
wolffd@0 57 'Units','points', ...
wolffd@0 58 'BackgroundColor',[0.8 0.8 0.8], ...
wolffd@0 59 'Position',[12 54 122 40], ...
wolffd@0 60 'Style','frame', ...
wolffd@0 61 'Tag','Frame2');
wolffd@0 62 b = uicontrol('Parent',a, ...
wolffd@0 63 'Units','points', ...
wolffd@0 64 'BackgroundColor',[0.8 0.8 0.8], ...
wolffd@0 65 'FontWeight','demi', ...
wolffd@0 66 'HorizontalAlignment','left', ...
wolffd@0 67 'Position',[18 78 110 12], ...
wolffd@0 68 'String','NEIGHBORHOOD RADIUS', ...
wolffd@0 69 'Style','text', ...
wolffd@0 70 'Tag','StaticText1');
wolffd@0 71 b = uicontrol('Parent',a, ...
wolffd@0 72 'Units','points', ...
wolffd@0 73 'BackgroundColor',[1 1 1], ...
wolffd@0 74 'Callback','sompak_rb_control radius', ...
wolffd@0 75 'Position',[48 56 50 20], ...
wolffd@0 76 'Style','edit', ...
wolffd@0 77 'Tag','RADIUS');
wolffd@0 78
wolffd@0 79 udata.radius=[];
wolffd@0 80
wolffd@0 81 b = uicontrol('Parent',a, ...
wolffd@0 82 'Units','points', ...
wolffd@0 83 'BackgroundColor',[0.8 0.8 0.8], ...
wolffd@0 84 'Position',[12 96 122 40], ...
wolffd@0 85 'Style','frame', ...
wolffd@0 86 'Tag','Frame3');
wolffd@0 87 b = uicontrol('Parent',a, ...
wolffd@0 88 'Units','points', ...
wolffd@0 89 'BackgroundColor',[0.8 0.8 0.8], ...
wolffd@0 90 'FontWeight','demi', ...
wolffd@0 91 'HorizontalAlignment','left', ...
wolffd@0 92 'Position',[22 120 101 12], ...
wolffd@0 93 'String','INITIAL ALPHA VALUE', ...
wolffd@0 94 'Style','text', ...
wolffd@0 95 'Tag','StaticText2');
wolffd@0 96 b = uicontrol('Parent',a, ...
wolffd@0 97 'Units','points', ...
wolffd@0 98 'BackgroundColor',[1 1 1], ...
wolffd@0 99 'Callback','sompak_rb_control alpha',...
wolffd@0 100 'Position',[48 99 50 20], ...
wolffd@0 101 'Style','edit', ...
wolffd@0 102 'Tag','ALPHA');
wolffd@0 103
wolffd@0 104
wolffd@0 105 udata.alpha=[];
wolffd@0 106
wolffd@0 107
wolffd@0 108 b = uicontrol('Parent',a, ...
wolffd@0 109 'Units','points', ...
wolffd@0 110 'BackgroundColor',[0.8 0.8 0.8], ...
wolffd@0 111 'Position',[12 138 122 40], ...
wolffd@0 112 'Style','frame', ...
wolffd@0 113 'Tag','Frame4');
wolffd@0 114 b = uicontrol('Parent',a, ...
wolffd@0 115 'Units','points', ...
wolffd@0 116 'BackgroundColor',[0.8 0.8 0.8], ...
wolffd@0 117 'FontWeight','demi', ...
wolffd@0 118 'HorizontalAlignment','left', ...
wolffd@0 119 'Position',[30 163 90 12], ...
wolffd@0 120 'String','RUNNING LENGTH', ...
wolffd@0 121 'Style','text', ...
wolffd@0 122 'Tag','StaticText3');
wolffd@0 123 b = uicontrol('Parent',a, ...
wolffd@0 124 'Units','points', ...
wolffd@0 125 'BackgroundColor',[1 1 1], ...
wolffd@0 126 'Callback','sompak_rb_control rlen',...
wolffd@0 127 'Position',[48 141 50 20], ...
wolffd@0 128 'Style','edit', ...
wolffd@0 129 'Tag','RLEN');
wolffd@0 130
wolffd@0 131 udata.rlen=[];
wolffd@0 132
wolffd@0 133 b = uicontrol('Parent',a, ...
wolffd@0 134 'Units','points', ...
wolffd@0 135 'BackgroundColor',[0.8 0.8 0.8], ...
wolffd@0 136 'Position',[12 180 122 40], ...
wolffd@0 137 'Style','frame', ...
wolffd@0 138 'Tag','Frame5');
wolffd@0 139 b = uicontrol('Parent',a, ...
wolffd@0 140 'Units','points', ...
wolffd@0 141 'BackgroundColor',[0.8 0.8 0.8], ...
wolffd@0 142 'FontWeight','demi', ...
wolffd@0 143 'HorizontalAlignment','left', ...
wolffd@0 144 'Position',[30 204 90 11], ...
wolffd@0 145 'String','OUTPUT VARIABLE', ...
wolffd@0 146 'Style','text', ...
wolffd@0 147 'Tag','StaticText4');
wolffd@0 148 b = uicontrol('Parent',a, ...
wolffd@0 149 'Units','points', ...
wolffd@0 150 'BackgroundColor',[1 1 1], ...
wolffd@0 151 'Callback','sompak_rb_control out_var',...
wolffd@0 152 'Position',[48 183 50 20], ...
wolffd@0 153 'String','''ans''',...
wolffd@0 154 'Style','edit', ...
wolffd@0 155 'Tag','OUT_VAR');
wolffd@0 156
wolffd@0 157 udata.out_var='ans';
wolffd@0 158
wolffd@0 159 b = uicontrol('Parent',a, ...
wolffd@0 160 'Units','points', ...
wolffd@0 161 'BackgroundColor',[0.8 0.8 0.8], ...
wolffd@0 162 'Position',[12 222 122 40], ...
wolffd@0 163 'Style','frame', ...
wolffd@0 164 'Tag','Frame6');
wolffd@0 165 b = uicontrol('Parent',a, ...
wolffd@0 166 'Units','points', ...
wolffd@0 167 'BackgroundColor',[0.8 0.8 0.8], ...
wolffd@0 168 'FontWeight','demi', ...
wolffd@0 169 'HorizontalAlignment','left', ...
wolffd@0 170 'Position',[42 245 65 12], ...
wolffd@0 171 'String','OUTPUT FILE', ...
wolffd@0 172 'Style','text', ...
wolffd@0 173 'Tag','StaticText5');
wolffd@0 174 b = uicontrol('Parent',a, ...
wolffd@0 175 'Units','points', ...
wolffd@0 176 'BackgroundColor',[1 1 1], ...
wolffd@0 177 'Callback','sompak_rb_control out_file',...
wolffd@0 178 'Position',[15 225 50 20], ...
wolffd@0 179 'Style','edit', ...
wolffd@0 180 'Tag','OUT_FILE');
wolffd@0 181
wolffd@0 182 udata.out_file=[];
wolffd@0 183
wolffd@0 184 b = uicontrol('Parent',a, ...
wolffd@0 185 'Callback','sompak_rb_control out_ft',...
wolffd@0 186 'Units','points', ...
wolffd@0 187 'FontWeight','demi', ...
wolffd@0 188 'HorizontalAlignment','left', ...
wolffd@0 189 'Max',3, ...
wolffd@0 190 'Min',1, ...
wolffd@0 191 'Position',[70 230 62 15], ...
wolffd@0 192 'String',{'No File';'mat-file';'cod-file'}, ...
wolffd@0 193 'Style','popupmenu', ...
wolffd@0 194 'Tag','OUT_FILE_TYPE', ...
wolffd@0 195 'Value',1);
wolffd@0 196
wolffd@0 197 udata.out_file_type='';
wolffd@0 198
wolffd@0 199 b = uicontrol('Parent',a, ...
wolffd@0 200 'Units','points', ...
wolffd@0 201 'BackgroundColor',[0.8 0.8 0.8], ...
wolffd@0 202 'Position',[12 264 122 40], ...
wolffd@0 203 'Style','frame', ...
wolffd@0 204 'Tag','Frame7');
wolffd@0 205 b = uicontrol('Parent',a, ...
wolffd@0 206 'Units','points', ...
wolffd@0 207 'BackgroundColor',[0.8 0.8 0.8], ...
wolffd@0 208 'FontWeight','demi', ...
wolffd@0 209 'HorizontalAlignment','left', ...
wolffd@0 210 'Position',[34 288 85 12], ...
wolffd@0 211 'String','TEACHING DATA', ...
wolffd@0 212 'Style','text', ...
wolffd@0 213 'Tag','StaticText6');
wolffd@0 214 b = uicontrol('Parent',a, ...
wolffd@0 215 'Units','points', ...
wolffd@0 216 'BackgroundColor',[1 1 1], ...
wolffd@0 217 'Callback','sompak_rb_control data',...
wolffd@0 218 'Position',[15 267 50 20], ...
wolffd@0 219 'Style','edit', ...
wolffd@0 220 'Tag','DATA');
wolffd@0 221 b = uicontrol('Parent',a, ...
wolffd@0 222 'Units','points', ...
wolffd@0 223 'BackgroundColor',[0.701961 0.701961 0.701961], ...
wolffd@0 224 'Callback','sompak_rb_control input_ft',...
wolffd@0 225 'FontWeight','demi', ...
wolffd@0 226 'HorizontalAlignment','left', ...
wolffd@0 227 'Max',3, ...
wolffd@0 228 'Min',1, ...
wolffd@0 229 'Position',[70 272 62 15], ...
wolffd@0 230 'String',{'Variable';'mat-file';'dat-file'}, ...
wolffd@0 231 'Style','popupmenu', ...
wolffd@0 232 'Tag','INPUT_FILE_TYPE', ...
wolffd@0 233 'Value',1);
wolffd@0 234
wolffd@0 235 udata.input_file_type='';
wolffd@0 236
wolffd@0 237 b = uicontrol('Parent',a, ...
wolffd@0 238 'Units','points', ...
wolffd@0 239 'BackgroundColor',[0.8 0.8 0.8], ...
wolffd@0 240 'Position',[12 306 122 40], ...
wolffd@0 241 'Style','frame', ...
wolffd@0 242 'Tag','Frame8');
wolffd@0 243 b = uicontrol('Parent',a, ...
wolffd@0 244 'Units','points', ...
wolffd@0 245 'BackgroundColor',[0.8 0.8 0.8], ...
wolffd@0 246 'FontWeight','demi', ...
wolffd@0 247 'HorizontalAlignment','left', ...
wolffd@0 248 'Position',[60 331 25 12], ...
wolffd@0 249 'String','MAP', ...
wolffd@0 250 'Style','text', ...
wolffd@0 251 'Tag','StaticText7');
wolffd@0 252 b = uicontrol('Parent',a, ...
wolffd@0 253 'Units','points', ...
wolffd@0 254 'BackgroundColor',[1 1 1], ...
wolffd@0 255 'Callback','sompak_rb_control map',...
wolffd@0 256 'Position',[15 309 50 20], ...
wolffd@0 257 'Style','edit', ...
wolffd@0 258 'Tag','MAP');
wolffd@0 259
wolffd@0 260 udata.map=[];
wolffd@0 261
wolffd@0 262 b = uicontrol('Parent',a, ...
wolffd@0 263 'Units','points', ...
wolffd@0 264 'BackgroundColor',[0.701961 0.701961 0.701961], ...
wolffd@0 265 'Callback','sompak_rb_control map_ft',...
wolffd@0 266 'FontWeight','demi', ...
wolffd@0 267 'HorizontalAlignment','left', ...
wolffd@0 268 'Max',3, ...
wolffd@0 269 'Min',1, ...
wolffd@0 270 'Position',[70 314 62 15], ...
wolffd@0 271 'String',{'Variable','mat-file','cod-file'}, ...
wolffd@0 272 'Style','popupmenu', ...
wolffd@0 273 'Tag','MAP_TYPE', ...
wolffd@0 274 'Value',1);
wolffd@0 275
wolffd@0 276 udata.map_type='';
wolffd@0 277
wolffd@0 278 b = uicontrol('Parent',a, ...
wolffd@0 279 'Units','points', ...
wolffd@0 280 'BackgroundColor',[0.8 0.8 0.8], ...
wolffd@0 281 'FontSize',12, ...
wolffd@0 282 'FontWeight','demi', ...
wolffd@0 283 'HorizontalAlignment','left', ...
wolffd@0 284 'Position',[50 359 48 12], ...
wolffd@0 285 'String','TRAIN', ...
wolffd@0 286 'Style','text', ...
wolffd@0 287 'Tag','StaticText8');
wolffd@0 288
wolffd@0 289 set(gcf,'UserData',udata);
wolffd@0 290