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