wolffd@0
|
1 function sompak_sammon_gui()
|
wolffd@0
|
2
|
wolffd@0
|
3 %SOMPAK_SAMMON_GUI A GUI for using SOM_PAK Sammon's mapping program
|
wolffd@0
|
4 % from Matlab.
|
wolffd@0
|
5 %
|
wolffd@0
|
6 % sompak_sammon_gui
|
wolffd@0
|
7 %
|
wolffd@0
|
8 % Launches a GUI which allows the use of SOM_PAK Sammon's mapping
|
wolffd@0
|
9 % program (sammon) from Matlab. Notice that to use this function, the
|
wolffd@0
|
10 % SOM_PAK programs must be in your search path, or the variable
|
wolffd@0
|
11 % 'SOM_PAKDIR' which is a string containing the program path, must be
|
wolffd@0
|
12 % defined in the workspace. SOM_PAK programs can be found from:
|
wolffd@0
|
13 % http://www.cis.hut.fi/research/som_lvq_pak.shtml
|
wolffd@0
|
14 %
|
wolffd@0
|
15 % See also SOMPAK_SAMMON, SOMPAK_GUI, SOMPAK_INIT_GUI,
|
wolffd@0
|
16 % SOMPAK_TRAIN_GUI, SOM_GUI.
|
wolffd@0
|
17
|
wolffd@0
|
18 % Contributed to SOM Toolbox vs2, February 2nd, 2000 by Juha Parhankangas
|
wolffd@0
|
19 % Copyright (c) by Juha Parhankangas
|
wolffd@0
|
20 % http://www.cis.hut.fi/projects/somtoolbox/
|
wolffd@0
|
21
|
wolffd@0
|
22 % Juha Parhankangas 050100
|
wolffd@0
|
23
|
wolffd@0
|
24 h=findobj(get(0,'Children'),'Tag','SammonGUI');
|
wolffd@0
|
25
|
wolffd@0
|
26 if ~isempty(h)
|
wolffd@0
|
27 figure(h);
|
wolffd@0
|
28 return;
|
wolffd@0
|
29 end
|
wolffd@0
|
30
|
wolffd@0
|
31
|
wolffd@0
|
32 a = figure('Color',[0.8 0.8 0.8], ...
|
wolffd@0
|
33 'PaperType','a4letter', ...
|
wolffd@0
|
34 'Position',[665 517 175 295], ...
|
wolffd@0
|
35 'Tag','SammonGUI');
|
wolffd@0
|
36 b = uicontrol('Parent',a, ...
|
wolffd@0
|
37 'Units','points', ...
|
wolffd@0
|
38 'BackgroundColor',[0.701961 0.701961 0.701961], ...
|
wolffd@0
|
39 'Callback','close gcf', ...
|
wolffd@0
|
40 'FontWeight','demi', ...
|
wolffd@0
|
41 'Position',[8 20 50 20], ...
|
wolffd@0
|
42 'String','CLOSE', ...
|
wolffd@0
|
43 'Tag','Pushbutton1');
|
wolffd@0
|
44 b = uicontrol('Parent',a, ...
|
wolffd@0
|
45 'Units','points', ...
|
wolffd@0
|
46 'BackgroundColor',[0.701961 0.701961 0.701961], ...
|
wolffd@0
|
47 'Callback','sompak_rb_control sammon_ok',...
|
wolffd@0
|
48 'FontWeight','demi', ...
|
wolffd@0
|
49 'Position',[86 20 50 20], ...
|
wolffd@0
|
50 'String','OK', ...
|
wolffd@0
|
51 'Tag','Pushbutton2');
|
wolffd@0
|
52 b = uicontrol('Parent',a, ...
|
wolffd@0
|
53 'Units','points', ...
|
wolffd@0
|
54 'BackgroundColor',[0.701961 0.701961 0.701961], ...
|
wolffd@0
|
55 'Position',[8 50 130 175], ...
|
wolffd@0
|
56 'Style','frame', ...
|
wolffd@0
|
57 'Tag','Frame1');
|
wolffd@0
|
58 b = uicontrol('Parent',a, ...
|
wolffd@0
|
59 'Units','points', ...
|
wolffd@0
|
60 'BackgroundColor',[0.8 0.8 0.8], ...
|
wolffd@0
|
61 'Position',[12 54 122 40], ...
|
wolffd@0
|
62 'Style','frame', ...
|
wolffd@0
|
63 'Tag','Frame2');
|
wolffd@0
|
64 b = uicontrol('Parent',a, ...
|
wolffd@0
|
65 'Units','points', ...
|
wolffd@0
|
66 'BackgroundColor',[0.8 0.8 0.8], ...
|
wolffd@0
|
67 'FontWeight','demi', ...
|
wolffd@0
|
68 'HorizontalAlignment','left', ...
|
wolffd@0
|
69 'Position',[30 78 90 12], ...
|
wolffd@0
|
70 'String','RUNNING LENGTH', ...
|
wolffd@0
|
71 'Style','text', ...
|
wolffd@0
|
72 'Tag','StaticText1');
|
wolffd@0
|
73 b = uicontrol('Parent',a, ...
|
wolffd@0
|
74 'Units','points', ...
|
wolffd@0
|
75 'BackgroundColor',[1 1 1], ...
|
wolffd@0
|
76 'Callback','sompak_rb_control rlen',...
|
wolffd@0
|
77 'Position',[48 57 50 20], ...
|
wolffd@0
|
78 'Style','edit', ...
|
wolffd@0
|
79 'Tag','RLEN');
|
wolffd@0
|
80
|
wolffd@0
|
81 udata.rlen=[];
|
wolffd@0
|
82
|
wolffd@0
|
83 b = uicontrol('Parent',a, ...
|
wolffd@0
|
84 'Units','points', ...
|
wolffd@0
|
85 'BackgroundColor',[0.8 0.8 0.8], ...
|
wolffd@0
|
86 'Position',[12 96 122 40], ...
|
wolffd@0
|
87 'Style','frame', ...
|
wolffd@0
|
88 'Tag','Frame3');
|
wolffd@0
|
89 b = uicontrol('Parent',a, ...
|
wolffd@0
|
90 'Units','points', ...
|
wolffd@0
|
91 'BackgroundColor',[0.8 0.8 0.8], ...
|
wolffd@0
|
92 'FontWeight','demi', ...
|
wolffd@0
|
93 'HorizontalAlignment','left', ...
|
wolffd@0
|
94 'Position',[33 119 90 12], ...
|
wolffd@0
|
95 'String','OUTPUT VARIABLE', ...
|
wolffd@0
|
96 'Style','text', ...
|
wolffd@0
|
97 'Tag','StaticText2');
|
wolffd@0
|
98 b = uicontrol('Parent',a, ...
|
wolffd@0
|
99 'Units','points', ...
|
wolffd@0
|
100 'BackgroundColor',[1 1 1], ...
|
wolffd@0
|
101 'Callback','sompak_rb_control out_var',...
|
wolffd@0
|
102 'Position',[48 99 50 20], ...
|
wolffd@0
|
103 'String','''ans''', ...
|
wolffd@0
|
104 'Style','edit', ...
|
wolffd@0
|
105 'Tag','OUT_VAR');
|
wolffd@0
|
106
|
wolffd@0
|
107 udata.out_var='ans';
|
wolffd@0
|
108
|
wolffd@0
|
109 b = uicontrol('Parent',a, ...
|
wolffd@0
|
110 'Units','points', ...
|
wolffd@0
|
111 'BackgroundColor',[0.8 0.8 0.8], ...
|
wolffd@0
|
112 'Position',[12 138 122 40], ...
|
wolffd@0
|
113 'Style','frame', ...
|
wolffd@0
|
114 'Tag','Frame4');
|
wolffd@0
|
115 b = uicontrol('Parent',a, ...
|
wolffd@0
|
116 'Units','points', ...
|
wolffd@0
|
117 'BackgroundColor',[0.8 0.8 0.8], ...
|
wolffd@0
|
118 'FontWeight','demi', ...
|
wolffd@0
|
119 'HorizontalAlignment','left', ...
|
wolffd@0
|
120 'Position',[43 162 60 12], ...
|
wolffd@0
|
121 'String','OUTPUT FILE', ...
|
wolffd@0
|
122 'Style','text', ...
|
wolffd@0
|
123 'Tag','StaticText3');
|
wolffd@0
|
124 b = uicontrol('Parent',a, ...
|
wolffd@0
|
125 'Units','points', ...
|
wolffd@0
|
126 'BackgroundColor',[1 1 1], ...
|
wolffd@0
|
127 'Callback','sompak_rb_control out_file',...
|
wolffd@0
|
128 'Position',[15 141 50 20], ...
|
wolffd@0
|
129 'Style','edit', ...
|
wolffd@0
|
130 'Tag','OUT_FILE');
|
wolffd@0
|
131
|
wolffd@0
|
132 udata.out_file=[];
|
wolffd@0
|
133
|
wolffd@0
|
134 b = uicontrol('Parent',a, ...
|
wolffd@0
|
135 'Units','points', ...
|
wolffd@0
|
136 'Callback','sompak_rb_control out_ft',...
|
wolffd@0
|
137 'FontWeight','demi', ...
|
wolffd@0
|
138 'HorizontalAlignment','left', ...
|
wolffd@0
|
139 'Max',3, ...
|
wolffd@0
|
140 'Min',1, ...
|
wolffd@0
|
141 'Position',[70 146 62 15], ...
|
wolffd@0
|
142 'String',{'No File';'mat-file';'cod-file'}, ...
|
wolffd@0
|
143 'Style','popupmenu', ...
|
wolffd@0
|
144 'Tag','OUT_FILE_TYPE', ...
|
wolffd@0
|
145 'Value',1);
|
wolffd@0
|
146
|
wolffd@0
|
147 udata.out_file_type='';
|
wolffd@0
|
148
|
wolffd@0
|
149 b = uicontrol('Parent',a, ...
|
wolffd@0
|
150 'Units','points', ...
|
wolffd@0
|
151 'BackgroundColor',[0.8 0.8 0.8], ...
|
wolffd@0
|
152 'Position',[12 180 122 40], ...
|
wolffd@0
|
153 'Style','frame', ...
|
wolffd@0
|
154 'Tag','Frame5');
|
wolffd@0
|
155 b = uicontrol('Parent',a, ...
|
wolffd@0
|
156 'Units','points', ...
|
wolffd@0
|
157 'BackgroundColor',[0.8 0.8 0.8], ...
|
wolffd@0
|
158 'FontWeight','demi', ...
|
wolffd@0
|
159 'HorizontalAlignment','left', ...
|
wolffd@0
|
160 'Position',[60 203 25 12], ...
|
wolffd@0
|
161 'String','MAP', ...
|
wolffd@0
|
162 'Style','text', ...
|
wolffd@0
|
163 'Tag','StaticText4');
|
wolffd@0
|
164 b = uicontrol('Parent',a, ...
|
wolffd@0
|
165 'Units','points', ...
|
wolffd@0
|
166 'BackgroundColor',[1 1 1], ...
|
wolffd@0
|
167 'Callback','sompak_rb_control map',...
|
wolffd@0
|
168 'Position',[15 183 50 20], ...
|
wolffd@0
|
169 'Style','edit', ...
|
wolffd@0
|
170 'Tag','MAP');
|
wolffd@0
|
171
|
wolffd@0
|
172 udata.map=[];
|
wolffd@0
|
173
|
wolffd@0
|
174 b = uicontrol('Parent',a, ...
|
wolffd@0
|
175 'Units','points', ...
|
wolffd@0
|
176 'Callback','sompak_rb_control map_ft',...
|
wolffd@0
|
177 'FontWeight','demi', ...
|
wolffd@0
|
178 'HorizontalAlignment','left', ...
|
wolffd@0
|
179 'Max',3, ...
|
wolffd@0
|
180 'Min',1, ...
|
wolffd@0
|
181 'Position',[70 188 62 15], ...
|
wolffd@0
|
182 'String',{'Variable';'mat-file';'cod-file'}, ...
|
wolffd@0
|
183 'Style','popupmenu', ...
|
wolffd@0
|
184 'Tag','MAP_TYPE', ...
|
wolffd@0
|
185 'Value',1);
|
wolffd@0
|
186
|
wolffd@0
|
187 udata.map_type='';
|
wolffd@0
|
188
|
wolffd@0
|
189 b = uicontrol('Parent',a, ...
|
wolffd@0
|
190 'Units','points', ...
|
wolffd@0
|
191 'BackgroundColor',[0.8 0.8 0.8], ...
|
wolffd@0
|
192 'FontSize',12, ...
|
wolffd@0
|
193 'FontWeight','demi', ...
|
wolffd@0
|
194 'Position',[41 230 62 12], ...
|
wolffd@0
|
195 'String','SAMMON', ...
|
wolffd@0
|
196 'Style','text', ...
|
wolffd@0
|
197 'Tag','StaticText5');
|
wolffd@0
|
198
|
wolffd@0
|
199
|
wolffd@0
|
200 set(gcf,'UserData',udata);
|