|
a |
|
b/code/preprocessing/EEG/fastica/fasticag.m |
|
|
1 |
function fasticag(mixedsig, InitialGuess) |
|
|
2 |
%FASTICAG - Fast Independent Component Analysis, the Graphical User Interface |
|
|
3 |
% |
|
|
4 |
% FASTICAG gives a graphical user interface for performing independent |
|
|
5 |
% component analysis by the FastICA package. No arguments are |
|
|
6 |
% necessary in the function call. |
|
|
7 |
% |
|
|
8 |
% Optional arguments can be given in the form: |
|
|
9 |
% FASTICAG(mixedsig, initialGuess) where the matrix mixedsig contains the |
|
|
10 |
% multidimensional signals as row vectors, and initialGuess gives the |
|
|
11 |
% initial value for the mixing matrix used in the algorithm. |
|
|
12 |
% |
|
|
13 |
% FASTICA uses the fixed-point algorithm developed by Aapo Hyvarinen, |
|
|
14 |
% see http://www.cis.hut.fi/projects/ica/fastica/. The Matlab package |
|
|
15 |
% was programmed by Hugo Gavert, Jarmo Hurri, Jaakko Sarela, and Aapo |
|
|
16 |
% Hyvarinen. |
|
|
17 |
% |
|
|
18 |
% |
|
|
19 |
% See also FASTICA |
|
|
20 |
|
|
|
21 |
% @(#)$Id$ |
|
|
22 |
|
|
|
23 |
|
|
|
24 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
|
25 |
% Global values |
|
|
26 |
|
|
|
27 |
% Handle to this main figure |
|
|
28 |
global hf_FastICA_MAIN; |
|
|
29 |
|
|
|
30 |
% Check to see if GUI is already running |
|
|
31 |
% Can't have more than one copy - otherwise the global |
|
|
32 |
% variables and handles can get mixed up. |
|
|
33 |
if ~isempty(hf_FastICA_MAIN) |
|
|
34 |
error('FastICA GUI already running!'); |
|
|
35 |
end |
|
|
36 |
|
|
|
37 |
|
|
|
38 |
% Handles to other controls in this main window |
|
|
39 |
global ht_FastICA_mixedStatus; |
|
|
40 |
global ht_FastICA_dim; |
|
|
41 |
global ht_FastICA_numOfSamp; |
|
|
42 |
global ht_FastICA_newDim; |
|
|
43 |
global ht_FastICA_whiteStatus; |
|
|
44 |
global ht_FastICA_icaStatus; |
|
|
45 |
global hpm_FastICA_approach; |
|
|
46 |
global he_FastICA_numOfIC; |
|
|
47 |
global hpm_FastICA_g; |
|
|
48 |
global hpm_FastICA_stabilization; |
|
|
49 |
|
|
|
50 |
% These global variables are used to store all the values |
|
|
51 |
% I used to use the 'UserData' field of components, but |
|
|
52 |
% that got too complex, so I decided to put everything |
|
|
53 |
% in global variables |
|
|
54 |
global g_FastICA_mixedsig; |
|
|
55 |
global g_FastICA_pca_D; |
|
|
56 |
global g_FastICA_pca_E; |
|
|
57 |
global g_FastICA_white_sig; |
|
|
58 |
global g_FastICA_white_wm; |
|
|
59 |
global g_FastICA_white_dwm; |
|
|
60 |
global g_FastICA_ica_sig; |
|
|
61 |
global g_FastICA_ica_A; |
|
|
62 |
global g_FastICA_ica_W; |
|
|
63 |
global g_FastICA_initGuess; |
|
|
64 |
global g_FastICA_approach; |
|
|
65 |
global g_FastICA_numOfIC; |
|
|
66 |
global g_FastICA_g; |
|
|
67 |
global g_FastICA_finetune; |
|
|
68 |
global g_FastICA_a1; |
|
|
69 |
global g_FastICA_a2; |
|
|
70 |
global g_FastICA_myy; |
|
|
71 |
global g_FastICA_stabilization; |
|
|
72 |
global g_FastICA_epsilon; |
|
|
73 |
global g_FastICA_maxNumIte; |
|
|
74 |
global g_FastICA_maxFinetune; |
|
|
75 |
global g_FastICA_sampleSize; |
|
|
76 |
global g_FastICA_initState; |
|
|
77 |
global g_FastICA_displayMo; |
|
|
78 |
global g_FastICA_displayIn; |
|
|
79 |
global g_FastICA_verbose; |
|
|
80 |
|
|
|
81 |
% initial values for them: |
|
|
82 |
% All the initial values are set here - even for |
|
|
83 |
% variables that are not used in this file |
|
|
84 |
|
|
|
85 |
if nargin < 2 |
|
|
86 |
g_FastICA_initGuess = 1; |
|
|
87 |
% The user didn't enter initial guess so we default |
|
|
88 |
% back to random initial state. |
|
|
89 |
g_FastICA_initState = 1; % see below for string values |
|
|
90 |
else |
|
|
91 |
g_FastICA_initGuess = InitialGuess; |
|
|
92 |
% If initial guess was entered, then the user probably |
|
|
93 |
% wan't to use it, eh? |
|
|
94 |
g_FastICA_initState = 2; % see below for string values |
|
|
95 |
end |
|
|
96 |
|
|
|
97 |
if nargin < 1 |
|
|
98 |
g_FastICA_mixedsig = []; |
|
|
99 |
else |
|
|
100 |
g_FastICA_mixedsig = mixedsig; % We'll remove mean |
|
|
101 |
end % the first time we |
|
|
102 |
% use this. |
|
|
103 |
|
|
|
104 |
% Global variable for stopping the ICA calculations |
|
|
105 |
global g_FastICA_interrupt; |
|
|
106 |
|
|
|
107 |
g_FastICA_pca_D = []; |
|
|
108 |
g_FastICA_pca_E = []; |
|
|
109 |
g_FastICA_white_sig = []; |
|
|
110 |
g_FastICA_white_wm = []; |
|
|
111 |
g_FastICA_white_dwm = []; |
|
|
112 |
g_FastICA_ica_sig = []; |
|
|
113 |
g_FastICA_ica_A = []; |
|
|
114 |
g_FastICA_ica_W = []; |
|
|
115 |
g_FastICA_approach = 1; % see below for string values |
|
|
116 |
g_FastICA_numOfIC = 0; |
|
|
117 |
g_FastICA_g = 1; % see below for string values |
|
|
118 |
g_FastICA_finetune = 5; % see below for string values |
|
|
119 |
g_FastICA_a1 = 1; |
|
|
120 |
g_FastICA_a2 = 1; |
|
|
121 |
g_FastICA_myy = 1; |
|
|
122 |
g_FastICA_stabilization = 2; % see below for string values |
|
|
123 |
g_FastICA_epsilon = 0.0001; |
|
|
124 |
g_FastICA_maxNumIte = 1000; |
|
|
125 |
g_FastICA_maxFinetune = 100; |
|
|
126 |
g_FastICA_sampleSize = 1; |
|
|
127 |
g_FastICA_displayMo = 1; % see below for string values |
|
|
128 |
g_FastICA_displayIn = 1; |
|
|
129 |
g_FastICA_verbose = 1; % see below for string values |
|
|
130 |
|
|
|
131 |
% These are regarded as constants and are used to store |
|
|
132 |
% the strings for the popup menus the current value is |
|
|
133 |
% seen in the variables above |
|
|
134 |
% D - refers to strings that are displayed |
|
|
135 |
% V - refers to string values that are used in FPICA |
|
|
136 |
global c_FastICA_appr_strD; |
|
|
137 |
global c_FastICA_appr_strV; |
|
|
138 |
global c_FastICA_g1_strD; |
|
|
139 |
global c_FastICA_g1_strV; |
|
|
140 |
global c_FastICA_g2_strD; |
|
|
141 |
global c_FastICA_g2_strV; |
|
|
142 |
global c_FastICA_finetune_strD; |
|
|
143 |
global c_FastICA_finetune_strV; |
|
|
144 |
global c_FastICA_stabili_strD; |
|
|
145 |
global c_FastICA_stabili_strV; |
|
|
146 |
global c_FastICA_iSta_strD; |
|
|
147 |
global c_FastICA_iSta_strV; |
|
|
148 |
global c_FastICA_dMod_strD; |
|
|
149 |
global c_FastICA_dMod_strV; |
|
|
150 |
global c_FastICA_verb_strD; |
|
|
151 |
global c_FastICA_verb_strV; |
|
|
152 |
|
|
|
153 |
% All the values for these are set here - even for |
|
|
154 |
% variables that are not used in this file |
|
|
155 |
|
|
|
156 |
c_FastICA_appr_strD = 'deflation|symmetric'; |
|
|
157 |
c_FastICA_appr_strV = ['defl';'symm']; |
|
|
158 |
% The 'g1' and 'g2' below correspond to the values of approach (1 or 2) |
|
|
159 |
% Deflation and Symmetric used to have a bit different selection |
|
|
160 |
% of available nonlinearities. |
|
|
161 |
c_FastICA_g1_strD = 'pow3|tanh|gauss|skew'; |
|
|
162 |
c_FastICA_g1_strV = ['pow3';'tanh';'gaus';'skew']; |
|
|
163 |
c_FastICA_g2_strD = 'pow3|tanh|gauss|skew'; |
|
|
164 |
c_FastICA_g2_strV = ['pow3';'tanh';'gaus';'skew']; |
|
|
165 |
c_FastICA_finetune_strD = 'pow3|tanh|gauss|skew|off'; |
|
|
166 |
c_FastICA_finetune_strV = ['pow3';'tanh';'gaus';'skew';'off ']; |
|
|
167 |
c_FastICA_stabili_strD = 'on|off'; |
|
|
168 |
c_FastICA_stabili_strV = ['on ';'off']; |
|
|
169 |
c_FastICA_iSta_strD = 'random|guess'; |
|
|
170 |
c_FastICA_iSta_strV = ['rand ';'guess']; |
|
|
171 |
c_FastICA_dMod_strD = 'signals|basis|filters|off'; |
|
|
172 |
c_FastICA_dMod_strV = ['signals';'basis ';'filters';'off ']; |
|
|
173 |
c_FastICA_verb_strD = 'on|off'; |
|
|
174 |
c_FastICA_verb_strV = ['on ';'off']; |
|
|
175 |
|
|
|
176 |
|
|
|
177 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
|
178 |
% Configuration options |
|
|
179 |
FIGURENAME = 'FastICA'; |
|
|
180 |
FIGURETAG = 'f_FastICA'; |
|
|
181 |
SCREENSIZE = get(0,'ScreenSize'); |
|
|
182 |
FIGURESIZE = [round(0.1*SCREENSIZE(3)) (SCREENSIZE(4)-round(0.1*SCREENSIZE(4))-370) 530 370]; |
|
|
183 |
|
|
|
184 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
|
185 |
% Create the figure |
|
|
186 |
a = figure('Color',[0.8 0.8 0.8], ... |
|
|
187 |
'PaperType','a4letter', ... |
|
|
188 |
'Name', FIGURENAME, ... |
|
|
189 |
'NumberTitle', 'off', ... |
|
|
190 |
'Tag', FIGURETAG, ... |
|
|
191 |
'Position', FIGURESIZE, ... |
|
|
192 |
'MenuBar', 'none'); |
|
|
193 |
% Resizing has to be denied after the window has been created - |
|
|
194 |
% otherwise the window shows only as a tiny window in Windows XP. |
|
|
195 |
set (a, 'Resize', 'off'); |
|
|
196 |
|
|
|
197 |
hf_FastICA_MAIN = a; |
|
|
198 |
|
|
|
199 |
set(hf_FastICA_MAIN, 'HandleVisibility', 'callback'); |
|
|
200 |
|
|
|
201 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
|
202 |
% From here on it get's ugly as I have not had time to clean it up |
|
|
203 |
|
|
|
204 |
|
|
|
205 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
|
206 |
% Create the frames |
|
|
207 |
pos_l=2; |
|
|
208 |
pos_w=FIGURESIZE(3)-4; |
|
|
209 |
pos_h=FIGURESIZE(4)-4; |
|
|
210 |
pos_t=FIGURESIZE(4)-2-pos_h; |
|
|
211 |
h_f_background = uicontrol('Parent',a, ... |
|
|
212 |
'BackgroundColor',[0.701961 0.701961 0.701961], ... |
|
|
213 |
'Position',[pos_l pos_t pos_w pos_h], ... |
|
|
214 |
'Style','frame', ... |
|
|
215 |
'Tag','f_background'); |
|
|
216 |
|
|
|
217 |
pos_l=4; |
|
|
218 |
pos_w=400; |
|
|
219 |
pos_h=106; |
|
|
220 |
pos_t=FIGURESIZE(4)-4-pos_h; |
|
|
221 |
h_f_mixed = uicontrol('Parent',a, ... |
|
|
222 |
'BackgroundColor',[0.701961 0.701961 0.701961], ... |
|
|
223 |
'Position',[pos_l pos_t pos_w pos_h], ... |
|
|
224 |
'Style','frame', ... |
|
|
225 |
'Tag','f_mixed'); |
|
|
226 |
|
|
|
227 |
pos_h=90; |
|
|
228 |
pos_t=FIGURESIZE(4)-(106+4+2)-pos_h; |
|
|
229 |
h_f_white = uicontrol('Parent',a, ... |
|
|
230 |
'BackgroundColor',[0.701961 0.701961 0.701961], ... |
|
|
231 |
'Position',[pos_l pos_t pos_w pos_h], ... |
|
|
232 |
'Style','frame', ... |
|
|
233 |
'Tag','f_white'); |
|
|
234 |
|
|
|
235 |
pos_h=pos_t - 4 - 2; |
|
|
236 |
pos_t=4; |
|
|
237 |
h_f_ica = uicontrol('Parent',a, ... |
|
|
238 |
'BackgroundColor',[0.701961 0.701961 0.701961], ... |
|
|
239 |
'Position',[pos_l pos_t pos_w pos_h], ... |
|
|
240 |
'Style','frame', ... |
|
|
241 |
'Tag','f_ica'); |
|
|
242 |
|
|
|
243 |
pos_w=120; |
|
|
244 |
pos_l=FIGURESIZE(3)-(pos_w+2+2); |
|
|
245 |
pos_h=FIGURESIZE(4)-2*4; |
|
|
246 |
pos_t=FIGURESIZE(4)-(4)-pos_h; |
|
|
247 |
h_f_side = uicontrol('Parent',a, ... |
|
|
248 |
'BackgroundColor',[0.5 0.5 0.5], ... |
|
|
249 |
'Position',[pos_l pos_t pos_w pos_h], ... |
|
|
250 |
'Style','frame', ... |
|
|
251 |
'Tag','f_side'); |
|
|
252 |
|
|
|
253 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
|
254 |
% Controls in f_mixed |
|
|
255 |
bgc = get(h_f_mixed, 'BackgroundColor'); |
|
|
256 |
|
|
|
257 |
pos_vspace = 6; |
|
|
258 |
pos_hspace = 6; |
|
|
259 |
|
|
|
260 |
pos_frame=get(h_f_mixed, 'Position'); |
|
|
261 |
pos_l = pos_frame(1) + 6; |
|
|
262 |
pos_h = 16; |
|
|
263 |
pos_t = pos_frame(2) + pos_frame(4) - pos_h - 6; |
|
|
264 |
pos_w = 150; |
|
|
265 |
b = uicontrol('Parent',a, ... |
|
|
266 |
'BackgroundColor',bgc, ... |
|
|
267 |
'HorizontalAlignment','left', ... |
|
|
268 |
'Position',[pos_l pos_t pos_w pos_h], ... |
|
|
269 |
'String','Mixed signals:', ... |
|
|
270 |
'FontWeight', 'bold', ... |
|
|
271 |
'Style','text', ... |
|
|
272 |
'Tag','t_mixed'); |
|
|
273 |
|
|
|
274 |
pos_l = pos_l + pos_w; |
|
|
275 |
pos_w = 120; |
|
|
276 |
ht_FastICA_mixedStatus = uicontrol('Parent',a, ... |
|
|
277 |
'BackgroundColor',bgc, ... |
|
|
278 |
'HorizontalAlignment','left', ... |
|
|
279 |
'Position',[pos_l pos_t pos_w pos_h], ... |
|
|
280 |
'String','Not loaded yet', ... |
|
|
281 |
'Style','text', ... |
|
|
282 |
'Tag','t_mixedstatus'); |
|
|
283 |
|
|
|
284 |
% Vähän väliä |
|
|
285 |
pos_t = pos_t - 8; |
|
|
286 |
|
|
|
287 |
pos_l = pos_frame(1) + 6; |
|
|
288 |
pos_t = pos_t - pos_h; |
|
|
289 |
pos_w = 150; |
|
|
290 |
b = uicontrol('Parent',a, ... |
|
|
291 |
'BackgroundColor',bgc, ... |
|
|
292 |
'HorizontalAlignment','left', ... |
|
|
293 |
'Position',[pos_l pos_t pos_w pos_h], ... |
|
|
294 |
'String','Number of signals:', ... |
|
|
295 |
'Style','text', ... |
|
|
296 |
'Tag','t_2'); |
|
|
297 |
|
|
|
298 |
pos_l = pos_l + pos_w; |
|
|
299 |
pos_w = 50; |
|
|
300 |
ht_FastICA_dim = uicontrol('Parent',a, ... |
|
|
301 |
'BackgroundColor',bgc, ... |
|
|
302 |
'HorizontalAlignment','left', ... |
|
|
303 |
'Position',[pos_l pos_t pos_w pos_h], ... |
|
|
304 |
'String','', ... |
|
|
305 |
'Style','text', ... |
|
|
306 |
'Tag','t_dim'); |
|
|
307 |
|
|
|
308 |
pos_l = pos_frame(1) + 6; |
|
|
309 |
pos_t = pos_t - pos_h; |
|
|
310 |
pos_w = 150; |
|
|
311 |
b = uicontrol('Parent',a, ... |
|
|
312 |
'BackgroundColor',bgc, ... |
|
|
313 |
'HorizontalAlignment','left', ... |
|
|
314 |
'Position',[pos_l pos_t pos_w pos_h], ... |
|
|
315 |
'String','Number of samples:', ... |
|
|
316 |
'Style','text', ... |
|
|
317 |
'Tag','t_3'); |
|
|
318 |
|
|
|
319 |
pos_l = pos_l + pos_w; |
|
|
320 |
pos_w = 50; |
|
|
321 |
ht_FastICA_numOfSamp = uicontrol('Parent',a, ... |
|
|
322 |
'BackgroundColor',bgc, ... |
|
|
323 |
'HorizontalAlignment','left', ... |
|
|
324 |
'Position',[pos_l pos_t pos_w pos_h], ... |
|
|
325 |
'String','', ... |
|
|
326 |
'Style','text', ... |
|
|
327 |
'Tag','t_numOfSamp'); |
|
|
328 |
|
|
|
329 |
|
|
|
330 |
% Buttons |
|
|
331 |
pos_l = pos_frame(1) + pos_hspace; |
|
|
332 |
pos_w = 110; |
|
|
333 |
pos_h = 30; |
|
|
334 |
pos_t = pos_frame(2) + pos_vspace; |
|
|
335 |
b = uicontrol('Parent',a, ... |
|
|
336 |
'BackgroundColor',[0.701961 0.701961 0.701961], ... |
|
|
337 |
'Callback','gui_cb Transpose', ... |
|
|
338 |
'Interruptible', 'off', ... |
|
|
339 |
'Position',[pos_l pos_t pos_w pos_h], ... |
|
|
340 |
'String','Transpose', ... |
|
|
341 |
'Tag','b_Transpose'); |
|
|
342 |
|
|
|
343 |
pos_w = 130; |
|
|
344 |
pos_l = pos_frame(1) + pos_frame(3) - pos_hspace - pos_w; |
|
|
345 |
b = uicontrol('Parent',a, ... |
|
|
346 |
'BackgroundColor',[0.701961 0.701961 0.701961], ... |
|
|
347 |
'Callback','gui_cb ShowMixed', ... |
|
|
348 |
'Interruptible', 'off', ... |
|
|
349 |
'Position',[pos_l pos_t pos_w pos_h], ... |
|
|
350 |
'String','Plot data', ... |
|
|
351 |
'Tag','b_ShowMixed'); |
|
|
352 |
|
|
|
353 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
|
354 |
% Controls in f_white |
|
|
355 |
pos_frame=get(h_f_white, 'Position'); |
|
|
356 |
pos_l = pos_frame(1) + 6; |
|
|
357 |
pos_h = 16; |
|
|
358 |
pos_t = pos_frame(2) + pos_frame(4) - pos_h - 6; |
|
|
359 |
pos_w = 150; |
|
|
360 |
b = uicontrol('Parent',a, ... |
|
|
361 |
'BackgroundColor',bgc, ... |
|
|
362 |
'HorizontalAlignment','left', ... |
|
|
363 |
'Position',[pos_l pos_t pos_w pos_h], ... |
|
|
364 |
'String','Dimension control:', ... |
|
|
365 |
'FontWeight', 'bold', ... |
|
|
366 |
'Style','text', ... |
|
|
367 |
'Tag','t_white'); |
|
|
368 |
|
|
|
369 |
pos_l = pos_l + pos_w; |
|
|
370 |
pos_w = 120; |
|
|
371 |
ht_FastICA_whiteStatus = uicontrol('Parent',a, ... |
|
|
372 |
'BackgroundColor',bgc, ... |
|
|
373 |
'HorizontalAlignment','left', ... |
|
|
374 |
'Position',[pos_l pos_t pos_w pos_h], ... |
|
|
375 |
'String','', ... |
|
|
376 |
'Style','text', ... |
|
|
377 |
'Tag','t_whiteStatus'); |
|
|
378 |
|
|
|
379 |
% Vähän väliä |
|
|
380 |
pos_t = pos_t - 8; |
|
|
381 |
|
|
|
382 |
pos_l = pos_frame(1) + 6; |
|
|
383 |
pos_t = pos_t - pos_h; |
|
|
384 |
pos_w = 150; |
|
|
385 |
b = uicontrol('Parent',a, ... |
|
|
386 |
'BackgroundColor',bgc, ... |
|
|
387 |
'HorizontalAlignment','left', ... |
|
|
388 |
'Position',[pos_l pos_t pos_w pos_h], ... |
|
|
389 |
'String','Reduced dimension:', ... |
|
|
390 |
'Style','text', ... |
|
|
391 |
'Tag','t_4'); |
|
|
392 |
|
|
|
393 |
pos_l = pos_l + pos_w; |
|
|
394 |
pos_w = 50; |
|
|
395 |
ht_FastICA_newDim = uicontrol('Parent',a, ... |
|
|
396 |
'BackgroundColor',bgc, ... |
|
|
397 |
'HorizontalAlignment','left', ... |
|
|
398 |
'Position',[pos_l pos_t pos_w pos_h], ... |
|
|
399 |
'String','', ... |
|
|
400 |
'Style','text', ... |
|
|
401 |
'Tag','t_newDim'); |
|
|
402 |
|
|
|
403 |
|
|
|
404 |
% buttons |
|
|
405 |
|
|
|
406 |
pos_l = pos_frame(1) + pos_hspace; |
|
|
407 |
pos_w = 110; |
|
|
408 |
pos_h = 30; |
|
|
409 |
pos_t = pos_frame(2) + pos_vspace; |
|
|
410 |
b = uicontrol('Parent',a, ... |
|
|
411 |
'BackgroundColor',[0.701961 0.701961 0.701961], ... |
|
|
412 |
'Callback','gui_cb DoPCA', ... |
|
|
413 |
'Interruptible', 'off', ... |
|
|
414 |
'Position',[pos_l pos_t pos_w pos_h], ... |
|
|
415 |
'String','Reduce dim.', ... |
|
|
416 |
'Tag','b_DoPCA'); |
|
|
417 |
|
|
|
418 |
pos_l = pos_l + pos_w + pos_hspace; |
|
|
419 |
b = uicontrol('Parent',a, ... |
|
|
420 |
'BackgroundColor',[0.701961 0.701961 0.701961], ... |
|
|
421 |
'Callback','gui_cb OrigDim', ... |
|
|
422 |
'Interruptible', 'off', ... |
|
|
423 |
'Position',[pos_l pos_t pos_w pos_h], ... |
|
|
424 |
'String','Original dim.', ... |
|
|
425 |
'Tag','b_OrigDim'); |
|
|
426 |
|
|
|
427 |
pos_w = 130; |
|
|
428 |
pos_h = 30; |
|
|
429 |
pos_l = pos_frame(1) + pos_frame(3) - 6 - pos_w; |
|
|
430 |
pos_t = pos_frame(2) + 6; |
|
|
431 |
b = uicontrol('Parent',a, ... |
|
|
432 |
'BackgroundColor',[0.701961 0.701961 0.701961], ... |
|
|
433 |
'Callback','gui_cb ShowWhite', ... |
|
|
434 |
'Interruptible', 'off', ... |
|
|
435 |
'Position',[pos_l pos_t pos_w pos_h], ... |
|
|
436 |
'String','Plot whitened', ... |
|
|
437 |
'Tag','b_ShowWhite'); |
|
|
438 |
|
|
|
439 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
|
440 |
% Controls in f_ica |
|
|
441 |
pos_frame=get(h_f_ica, 'Position'); |
|
|
442 |
pos_l = pos_frame(1) + 6; |
|
|
443 |
pos_h = 20; |
|
|
444 |
pos_t = pos_frame(2) + pos_frame(4) - pos_h - 6; |
|
|
445 |
pos_w = 150; |
|
|
446 |
b = uicontrol('Parent',a, ... |
|
|
447 |
'BackgroundColor',bgc, ... |
|
|
448 |
'HorizontalAlignment','left', ... |
|
|
449 |
'Position',[pos_l pos_t pos_w pos_h], ... |
|
|
450 |
'String','Fixed point ICA:', ... |
|
|
451 |
'FontWeight', 'bold', ... |
|
|
452 |
'Style','text', ... |
|
|
453 |
'Tag','t_white'); |
|
|
454 |
|
|
|
455 |
pos_l = pos_l + pos_w; |
|
|
456 |
pos_w = 120; |
|
|
457 |
ht_FastICA_icaStatus = uicontrol('Parent',a, ... |
|
|
458 |
'BackgroundColor',bgc, ... |
|
|
459 |
'HorizontalAlignment','left', ... |
|
|
460 |
'Position',[pos_l pos_t pos_w pos_h], ... |
|
|
461 |
'String','Not yet done', ... |
|
|
462 |
'Style','text', ... |
|
|
463 |
'Tag','t_icaStatus'); |
|
|
464 |
|
|
|
465 |
% Vähän väliä |
|
|
466 |
pos_t = pos_t - 8; |
|
|
467 |
|
|
|
468 |
%pos_l = pos_frame(1) + 6; |
|
|
469 |
pos_l = pos_frame(1) + 6 + 150; |
|
|
470 |
pos_t = pos_t - pos_h; |
|
|
471 |
%pos_w = 260; |
|
|
472 |
pos_w = 120; |
|
|
473 |
b = uicontrol('Parent',a, ... |
|
|
474 |
'BackgroundColor',bgc, ... |
|
|
475 |
'HorizontalAlignment','left', ... |
|
|
476 |
'Position',[pos_l pos_t pos_w pos_h], ... |
|
|
477 |
'String','Approach:', ... |
|
|
478 |
'Style','text', ... |
|
|
479 |
'Tag','t_5'); |
|
|
480 |
|
|
|
481 |
pos_w = 100; |
|
|
482 |
%pos_t = pos_t - 4; |
|
|
483 |
pos_l = pos_frame(1) + pos_frame(3) - 6 - pos_w; |
|
|
484 |
hpm_FastICA_approach = uicontrol('Parent',a, ... |
|
|
485 |
'BackgroundColor',bgc, ... |
|
|
486 |
'Callback','gui_cb ChangeApproach', ... |
|
|
487 |
'Position',[pos_l pos_t pos_w pos_h], ... |
|
|
488 |
'String',c_FastICA_appr_strD, ... |
|
|
489 |
'Style','popupmenu', ... |
|
|
490 |
'Tag','pm_approach', ... |
|
|
491 |
'Value',g_FastICA_approach); |
|
|
492 |
|
|
|
493 |
%pos_t = pos_t - 4; |
|
|
494 |
%pos_l = pos_frame(1) + 6; |
|
|
495 |
pos_l = pos_frame(1) + 6 + 150; |
|
|
496 |
pos_t = pos_t - pos_h; |
|
|
497 |
%pos_w = 260; |
|
|
498 |
pos_w = 120; |
|
|
499 |
b = uicontrol('Parent',a, ... |
|
|
500 |
'BackgroundColor',bgc, ... |
|
|
501 |
'HorizontalAlignment','left', ... |
|
|
502 |
'Position',[pos_l pos_t pos_w pos_h], ... |
|
|
503 |
'String','Number of ICs:', ... |
|
|
504 |
'Style','text', ... |
|
|
505 |
'Tag','t_6'); |
|
|
506 |
|
|
|
507 |
pos_w = 100; |
|
|
508 |
pos_l = pos_frame(1) + pos_frame(3) - 6 - pos_w; |
|
|
509 |
he_FastICA_numOfIC = uicontrol('Parent',a, ... |
|
|
510 |
'BackgroundColor',[1 1 1], ... |
|
|
511 |
'Callback','gui_cb ChangeNumOfIC', ... |
|
|
512 |
'HorizontalAlignment','right', ... |
|
|
513 |
'Position',[pos_l pos_t pos_w pos_h], ... |
|
|
514 |
'String','0', ... |
|
|
515 |
'Style','edit', ... |
|
|
516 |
'Tag','e_numOfIC'); |
|
|
517 |
|
|
|
518 |
%pos_t = pos_t - 4; |
|
|
519 |
%pos_l = pos_frame(1) + 6; |
|
|
520 |
pos_l = pos_frame(1) + 6 + 150; |
|
|
521 |
pos_t = pos_t - pos_h; |
|
|
522 |
%pos_w = 260; |
|
|
523 |
pos_w = 120; |
|
|
524 |
b = uicontrol('Parent',a, ... |
|
|
525 |
'BackgroundColor',bgc, ... |
|
|
526 |
'HorizontalAlignment','left', ... |
|
|
527 |
'Position',[pos_l pos_t pos_w pos_h], ... |
|
|
528 |
'String','Nonlinearity (g):', ... |
|
|
529 |
'Style','text', ... |
|
|
530 |
'Tag','t_71'); |
|
|
531 |
|
|
|
532 |
%pos_t = pos_t - 4; |
|
|
533 |
pos_w = 100; |
|
|
534 |
pos_l = pos_frame(1) + pos_frame(3) - 6 - pos_w; |
|
|
535 |
hpm_FastICA_g = uicontrol('Parent',a, ... |
|
|
536 |
'BackgroundColor',bgc, ... |
|
|
537 |
'Callback','gui_cb ChangeG', ... |
|
|
538 |
'Position',[pos_l pos_t pos_w pos_h], ... |
|
|
539 |
'String',c_FastICA_g1_strD, ... |
|
|
540 |
'Style','popupmenu', ... |
|
|
541 |
'Tag','pm_g', ... |
|
|
542 |
'Value',g_FastICA_g); |
|
|
543 |
|
|
|
544 |
%pos_t = pos_t - 4; |
|
|
545 |
%pos_l = pos_frame(1) + 6; |
|
|
546 |
pos_l = pos_frame(1) + 6 + 150; |
|
|
547 |
pos_t = pos_t - pos_h; |
|
|
548 |
%pos_w = 260; |
|
|
549 |
pos_w = 120; |
|
|
550 |
b = uicontrol('Parent',a, ... |
|
|
551 |
'BackgroundColor',bgc, ... |
|
|
552 |
'HorizontalAlignment','left', ... |
|
|
553 |
'Position',[pos_l pos_t pos_w pos_h], ... |
|
|
554 |
'String','Stabilization:', ... |
|
|
555 |
'Style','text', ... |
|
|
556 |
'Tag','t_71a'); |
|
|
557 |
|
|
|
558 |
%pos_t = pos_t - 4; |
|
|
559 |
pos_w = 100; |
|
|
560 |
pos_l = pos_frame(1) + pos_frame(3) - 6 - pos_w; |
|
|
561 |
hpm_FastICA_stabilization = uicontrol('Parent',a, ... |
|
|
562 |
'BackgroundColor',bgc, ... |
|
|
563 |
'Callback','gui_cb ChangeStab', ... |
|
|
564 |
'Position',[pos_l pos_t pos_w pos_h], ... |
|
|
565 |
'String',c_FastICA_stabili_strD, ... |
|
|
566 |
'Style','popupmenu', ... |
|
|
567 |
'Tag','pm_stab', ... |
|
|
568 |
'Value',g_FastICA_stabilization); |
|
|
569 |
|
|
|
570 |
|
|
|
571 |
|
|
|
572 |
pos_l = pos_frame(1) + pos_vspace; |
|
|
573 |
pos_w = 110; |
|
|
574 |
pos_h = 30; |
|
|
575 |
pos_t = pos_frame(2) + pos_hspace; |
|
|
576 |
b = uicontrol('Parent',a, ... |
|
|
577 |
'BackgroundColor',[0.701961 0.701961 0.701961], ... |
|
|
578 |
'Callback','gui_cb AdvOpt', ... |
|
|
579 |
'Position',[pos_l pos_t pos_w pos_h], ... |
|
|
580 |
'String','Adv. options >>', ... |
|
|
581 |
'Tag','b_advOpt'); |
|
|
582 |
|
|
|
583 |
pos_w = 130; |
|
|
584 |
pos_h = 30; |
|
|
585 |
pos_l = pos_frame(1) + pos_frame(3) - pos_vspace - pos_w; |
|
|
586 |
b = uicontrol('Parent',a, ... |
|
|
587 |
'BackgroundColor',[0.701961 0.701961 0.701961], ... |
|
|
588 |
'Callback','gui_cb ShowICASig', ... |
|
|
589 |
'Interruptible', 'on', ... |
|
|
590 |
'Position',[pos_l pos_t pos_w pos_h], ... |
|
|
591 |
'String','Plot ICs', ... |
|
|
592 |
'Tag','b_ShowICASig'); |
|
|
593 |
|
|
|
594 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
|
595 |
% Controls in f_side |
|
|
596 |
pos_vspace = 6; |
|
|
597 |
pos_hspace = 10; |
|
|
598 |
pos_temp=get(h_f_side, 'Position'); |
|
|
599 |
pos_l=pos_temp(1)+pos_hspace; |
|
|
600 |
pos_w=100; |
|
|
601 |
pos_h=30; |
|
|
602 |
pos_t=pos_temp(2)+pos_temp(4)-pos_vspace-pos_h; |
|
|
603 |
|
|
|
604 |
b = uicontrol('Parent',a, ... |
|
|
605 |
'BackgroundColor',[0.701961 0.701961 0.701961], ... |
|
|
606 |
'Callback','gui_cb LoadData', ... |
|
|
607 |
'Interruptible', 'off', ... |
|
|
608 |
'Position',[pos_l pos_t pos_w pos_h], ... |
|
|
609 |
'String','Load data', ... |
|
|
610 |
'Tag','b_LoadData'); |
|
|
611 |
|
|
|
612 |
|
|
|
613 |
pos_t=pos_t-pos_h-pos_vspace; |
|
|
614 |
b = uicontrol('Parent',a, ... |
|
|
615 |
'BackgroundColor',[0.701961 0.701961 0.701961], ... |
|
|
616 |
'Callback','gui_cb DoFPICA', ... |
|
|
617 |
'Interruptible', 'on', ... |
|
|
618 |
'Position',[pos_l pos_t pos_w pos_h], ... |
|
|
619 |
'String','Do ICA', ... |
|
|
620 |
'Tag','b_DoFPICA'); |
|
|
621 |
|
|
|
622 |
pos_t=pos_t-pos_h-pos_vspace; |
|
|
623 |
b = uicontrol('Parent',a, ... |
|
|
624 |
'BackgroundColor',[0.701961 0.701961 0.701961], ... |
|
|
625 |
'Callback','gui_cb SaveData', ... |
|
|
626 |
'Interruptible', 'off', ... |
|
|
627 |
'Position',[pos_l pos_t pos_w pos_h], ... |
|
|
628 |
'String','Save results', ... |
|
|
629 |
'Tag','b_SaveData'); |
|
|
630 |
|
|
|
631 |
pos_t=pos_t-pos_h-pos_vspace; |
|
|
632 |
b = uicontrol('Parent',a, ... |
|
|
633 |
'BackgroundColor',[0.701961 0.701961 0.701961], ... |
|
|
634 |
'Callback','gui_cb Quit', ... |
|
|
635 |
'Position',[pos_l pos_t pos_w pos_h], ... |
|
|
636 |
'String','Quit', ... |
|
|
637 |
'Tag','b_Quit'); |
|
|
638 |
|
|
|
639 |
pos_t=pos_t-pos_h-pos_vspace; |
|
|
640 |
b = uicontrol('Parent',a, ... |
|
|
641 |
'BackgroundColor',[0.701961 0.701961 0.701961], ... |
|
|
642 |
'Callback','gui_cb Interrupt', ... |
|
|
643 |
'Position',[pos_l pos_t pos_w pos_h], ... |
|
|
644 |
'String','Interrupt', ... |
|
|
645 |
'Visible','off', ... |
|
|
646 |
'Tag','b_Interrupt'); |
|
|
647 |
|
|
|
648 |
pos_t = pos_frame(2) + pos_vspace + pos_h + pos_vspace; |
|
|
649 |
b = uicontrol('Parent',a, ... |
|
|
650 |
'BackgroundColor',[0.701961 0.701961 0.701961], ... |
|
|
651 |
'Callback','gui_cb About', ... |
|
|
652 |
'Position',[pos_l pos_t pos_w pos_h], ... |
|
|
653 |
'String','About...', ... |
|
|
654 |
'Tag','b_About'); |
|
|
655 |
|
|
|
656 |
pos_t = pos_frame(2) + pos_vspace; |
|
|
657 |
b = uicontrol('Parent',a, ... |
|
|
658 |
'BackgroundColor',[0.701961 0.701961 0.701961], ... |
|
|
659 |
'Callback','gui_cb Help', ... |
|
|
660 |
'Position',[pos_l pos_t pos_w pos_h], ... |
|
|
661 |
'String','Help', ... |
|
|
662 |
'Tag','b_Help'); |
|
|
663 |
|
|
|
664 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
|
665 |
% Do rest of the initialization... |
|
|
666 |
gui_cb InitAll; |
|
|
667 |
|