studychange works. added gui elements for spatial and temporal grouping
Christoph Budziszewski

Christoph Budziszewski commited on 2009-07-30 20:05:36
Zeige 6 geänderte Dateien mit 104 Einfügungen und 54 Löschungen.


git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@200 83ab2cfd-5345-466c-8aeb-2b2739fb922d
... ...
@@ -6,11 +6,11 @@ StudyArgs.subjectSelectValue	= 1;
6 6
 StudyArgs.classdefString      = '';
7 7
 
8 8
 StudyArgs.pststart            = '0';
9
-StudyArgs.pstend              = '0';
9
+StudyArgs.pstend              = '1';
10 10
 StudyArgs.baselinestart       = '0';
11 11
 StudyArgs.baselineend         = '0';
12
-StudyArgs.trfactor            = '0';
13
-StudyArgs.trlabel             = '2';
12
+StudyArgs.trfactor            = '0.5';
13
+StudyArgs.trlabel             = '';
14 14
 
15 15
 StudyArgs.imageTypeSelectionString = 'noImages';
16 16
 StudyArgs.imageTypeSelectionValue  = 1;
... ...
@@ -19,6 +19,7 @@ StudyArgs.voxelString         = '';
19 19
 
20 20
 StudyArgs.selNormPSTValue     = 1;
21 21
 StudyArgs.chkColBiasValue     = 1;
22
+StudyArgs.roiGroupingValue    = 1;
22 23
 
23 24
 %%%%%%%%%%%%%%%
24 25
 
... ...
@@ -26,6 +27,8 @@ StudyArgs.frameshiftstart = '0';
26 27
 StudyArgs.frameshiftend = '0';
27 28
 StudyArgs.frameshiftdur = '0';
28 29
 
30
+StudyArgs.timeframeGroupingValue = 1;
31
+
29 32
 StudyArgs.svmoptstring = '-s 0 -t 0 -c 1';
30 33
 StudyArgs.svmnfold = '0';
31 34
 StudyArgs.svmrnd = 1;
... ...
@@ -12,7 +12,7 @@ function StudyArgs = load_study(studyFile,model)
12 12
     set(model.subjectSelector,'UserData',StudyArgs.subjectSelectString);
13 13
     set(model.subjectSelector,'Value',StudyArgs.subjectSelectValue);
14 14
     
15
-    set(model.txtClassDef,'String',sprintf(StudyArgs.classdefString));
15
+    set(model.txtClassDef,'String',StudyArgs.classdefString);
16 16
     
17 17
     set(model.txtPSTHStart,     'String',sprintf(StudyArgs.pststart));
18 18
     set(model.txtPSTHEnd,       'String',sprintf(StudyArgs.pstend));
... ...
@@ -25,10 +25,11 @@ function StudyArgs = load_study(studyFile,model)
25 25
     set(model.imageTypeSelection, 'UserData',StudyArgs.imageTypeSelectionString);
26 26
     set(model.imageTypeSelection, 'Value'   ,StudyArgs.imageTypeSelectionValue);
27 27
     
28
-    set(model.txtVoxelDef,'String',sprintf(StudyArgs.voxelString));
28
+    set(model.txtVoxelDef,'String',StudyArgs.voxelString);
29 29
     
30 30
     set(model.selNormPST,       'Value',StudyArgs.selNormPSTValue);
31 31
     set(model.chkColBias,       'Value',StudyArgs.chkColBiasValue);
32
+    set(model.selRoiGrouping,   'Value',StudyArgs.roiGroupingValue);
32 33
     
33 34
     %%%% 
34 35
     
... ...
@@ -36,6 +37,8 @@ function StudyArgs = load_study(studyFile,model)
36 37
     set(model.txtFrameShiftEnd,'String',StudyArgs.frameshiftend);
37 38
     set(model.txtFrameShiftDur,'String',StudyArgs.frameshiftdur);
38 39
     
40
+    set(model.selTimeframeGrouping,'Value',StudyArgs.timeframeGroupingValue);
41
+
39 42
     set(model.txtSVMopts,'String',StudyArgs.svmoptstring );
40 43
     set(model.txtSVMnfold,'String',StudyArgs.svmnfold );
41 44
     set(model.chkSVMrnd,'Value',StudyArgs.svmrnd );
... ...
@@ -24,6 +25,7 @@ StudyArgs.voxelString         = get(model.txtVoxelDef,'String');
24 25
 
25 26
 StudyArgs.selNormPSTValue     = get(model.selNormPST, 'Value');
26 27
 StudyArgs.chkColBiasValue     = get(model.chkColBias, 'Value');
28
+StudyArgs.roiGroupingValue    = get(model.selRoiGrouping, 'Value');
27 29
 
28 30
 % %%%%%%%%%%%%%%%
29 31
 
... ...
@@ -31,6 +33,8 @@ StudyArgs.frameshiftstart       = get(model.txtFrameShiftStart,'String');
31 33
 StudyArgs.frameshiftend         = get(model.txtFrameShiftEnd,'String');
32 34
 StudyArgs.frameshiftdur         = get(model.txtFrameShiftDur,'String');
33 35
 
36
+StudyArgs.timeframeGroupingValue    = get(model.selTimeframeGrouping,'Value');
37
+
34 38
 StudyArgs.svmoptstring          = get(model.txtSVMopts,'String');
35 39
 StudyArgs.svmnfold              = get(model.txtSVMnfold,'String');
36 40
 StudyArgs.svmrnd                = get(model.chkSVMrnd,'Value');
... ...
@@ -91,6 +91,8 @@ end
91 91
 
92 92
 %%%%% ui elements
93 93
 function model = createFirstStepPanel(model,parent)
94
+    norm1Model = {'none','mean','minmax'};
95
+    roiGroupMethods = {'none','mean','max','median'};
94 96
 
95 97
     main_grid = cell(2,4);
96 98
     main_grid{1,1} = [0 0.7 0.4 0.3];
... ...
@@ -99,8 +101,8 @@ function model = createFirstStepPanel(model,parent)
99 101
     main_grid{1,4} = [0 0.0 1.0 0.1];
100 102
     
101 103
     main_grid{2,1} = [0.4 0.7 0.6 0.3];
102
-    main_grid{2,2} = [0.5 0.5 0.5 0.2];
103
-    main_grid{2,3} = [0.5 0.1 0.5 0.4];
104
+    main_grid{2,2} = [0.5 0.1 0.5 0.6];
105
+%     main_grid{2,3} = [0.5 0.1 0.5 0.4];
104 106
     
105 107
     %Subjects
106 108
     pSubject = uipanel(parent,'Units','normalized','Position',cell2mat(main_grid(1,1)));
... ...
@@ -184,51 +186,78 @@ function model = createFirstStepPanel(model,parent)
184 186
         model.txtTrFactor          = createTextField(pPSTH,cell2mat(tl_grid(2,5)),'');
185 187
         model.labelTR              = createTextField(pPSTH,cell2mat(tl_grid(3,5)),'');
186 188
         
187
-        % images
188
-        pImage = uipanel(parent,'Title','Image Options','Position',cell2mat(main_grid(2,2)));
189
-        set(pImage,'BackgroundColor','w');
189
+        % OPTIONS
190
+        grid_h = 0.16;
191
+        grid_wl = 0.4;
192
+        grid_wo = 0.6;
190 193
         
191
-        createLabel(pImage,[0.0 0.5 1 0.5],'Select Image Base');
194
+        optGrid = cell([3 6]);
195
+        optGrid{1,1} = [0.0 0.83 grid_wl grid_h];
196
+        optGrid{2,1} = [0.4 0.83 grid_wo grid_h];
192 197
         
193
-        model.imageTypeSelection = uicontrol(pImage,'Style','popupmenu',...
194
-        'Units','normalized',...
195
-        'Position',[0.0 0.0 1 0.5]);
196
-        set(model.imageTypeSelection,'BackgroundColor','w');
198
+        optGrid{1,2} = [0.0 0.66 grid_wl grid_h];
199
+        optGrid{2,2} = [0.4 0.66 grid_wo grid_h];
197 200
 
198
-        % coordinate Table
199
-        pVoxel = uipanel(parent,'Title','ROI','Position',cell2mat(main_grid(1,3)));
200
-        set(pVoxel,'BackgroundColor','w');
201
-        lVoxelDef = createLabel(pVoxel, [0 0.9 1 0.1],'<ROI Name> [+ radius (mm)];');
202
-        model.txtVoxelDef = createTextField(pVoxel,[0 0 1 0.9],'');
203
-        set(model.txtVoxelDef,'HorizontalAlignment','left');
204
-        set(model.txtVoxelDef,'Max',20);
205
-        set(model.txtVoxelDef,'Min',0);
206
-        set(model.txtVoxelDef, 'FontName', 'FixedWidth');
201
+        optGrid{1,3} = [0.0 0.5 grid_wl grid_h];
202
+        optGrid{2,3} = [0.4 0.5 grid_wo grid_h];
207 203
         
208
-        %normalizations
209
-        pNorm = uipanel(parent,'Title','Normalization','Position',cell2mat(main_grid(2,3)));
210
-        set(pNorm,'BackgroundColor','w');
204
+        optGrid{1,4} = [0.0 0.33 grid_wl grid_h];
205
+        optGrid{2,4} = [0.4 0.33 grid_wo grid_h];
211 206
 
212
-        createLabel(pNorm,[0 0.75 1 0.25],'psth norm4SVM');
207
+        optGrid{1,5} = [0.0 0.16 grid_wl grid_h];
208
+        optGrid{2,5} = [0.4 0.16 grid_wo grid_h];
213 209
         
210
+        optGrid{1,6} = [0.0 0.0 grid_wl grid_h];
211
+        optGrid{2,6} = [0.4 0.0 grid_wo grid_h];
214 212
 
215
-        norm1Model = {'none','mean','minmax'};
213
+        % Options:Imagebase
214
+        pOptions = uipanel(parent,'Title','Options','Position',cell2mat(main_grid(2,2)));
215
+        set(pOptions,'BackgroundColor','w');
216
+
217
+        createLabel(pOptions,cell2mat(optGrid(1,1)),'Image Base');
218
+        model.imageTypeSelection = uicontrol(pOptions,'Style','popupmenu',...
219
+        'Units','normalized',...
220
+        'Position',cell2mat(optGrid(2,1)));
221
+        set(model.imageTypeSelection,'BackgroundColor','w');
216 222
         
223
+        %Options:normalizations
217 224
         
218
-        model.selNormPST = uicontrol(pNorm,'Style','popupmenu',...
225
+        createLabel(pOptions,cell2mat(optGrid(1,2)),'psth norm4SVM');
226
+        model.selNormPST = uicontrol(pOptions,'Style','popupmenu',...
219 227
             'Units','normalized',...
220
-            'Position',[0.0 0.5 1 0.25],...
228
+            'Position',cell2mat(optGrid(2,2)),...
221 229
             'String',norm1Model,...
222 230
             'UserData',norm1Model);
223 231
          set(model.selNormPST,'BackgroundColor','w');   
224 232
         
225
-        model.chkColBias = uicontrol(pNorm,'Style','checkbox',...
233
+        model.chkColBias = uicontrol(pOptions,'Style','checkbox',...
226 234
             'Units','normalized',...
227
-            'Position',[0.0 0.1 1 0.25],...
235
+            'Position',cell2mat(optGrid(2,3)),...
228 236
             'String','column Bias removal',...
229 237
             'Enable','on');
230 238
          set(model.chkColBias,'BackgroundColor','w');   
231 239
          
240
+         %Options:spatialGrouping
241
+
242
+         createLabel(pOptions,cell2mat(optGrid(1,4)),'ROI Grouping');
243
+         model.selRoiGrouping = uicontrol(pOptions,'Style','popupmenu',...
244
+                'Units','normalized',...
245
+                'Position',cell2mat(optGrid(2,4)),...
246
+                'String',roiGroupMethods,...
247
+                'UserData',roiGroupMethods);
248
+         set(model.selRoiGrouping,'BackgroundColor','w');
249
+         
250
+        
251
+        % COORD TABLE
252
+        pVoxel = uipanel(parent,'Title','ROI','Position',cell2mat(main_grid(1,3)));
253
+        set(pVoxel,'BackgroundColor','w');
254
+        lVoxelDef = createLabel(pVoxel, [0 0.9 1 0.1],'<ROI Name> [+ radius (mm)];');
255
+        model.txtVoxelDef = createTextField(pVoxel,[0 0 1 0.9],'');
256
+        set(model.txtVoxelDef,'HorizontalAlignment','left');
257
+        set(model.txtVoxelDef,'Max',20);
258
+        set(model.txtVoxelDef,'Min',0);
259
+        set(model.txtVoxelDef, 'FontName', 'FixedWidth');
260
+        
232 261
         %buttons
233 262
         pButtons = uipanel(parent,'Position',cell2mat(main_grid(1,4)));
234 263
         set(pButtons,'BackgroundColor','w');
... ...
@@ -252,33 +281,45 @@ end
252 281
 function model = createSecondStepPanel(model,parent)
253 282
 basecolor = 'w';
254 283
 
255
-pTime = uipanel(parent,'Units','normalized','Position',[0.0 0.8 1 0.2]);
284
+pTime = uipanel(parent,'Units','normalized','Position',[0.0 0.7 1 0.3]);
256 285
     set(pTime,'Title','Decode Timeframe Options');
257 286
     set(pTime,'BackgroundColor',basecolor);
258
-    grid_h = 0.3;
287
+    grid_h = 0.25;
259 288
     grid_w = 0.3;
260
-    time_grid = cell([3 3]);
261
-    time_grid{1,1} = [0.0 0.63 grid_w grid_h];
262
-    time_grid{2,1} = [0.4 0.63 grid_w grid_h];
263
-    time_grid{3,1} = [0.7 0.63 grid_w grid_h];
264
-    time_grid{1,2} = [0.0 0.33 grid_w grid_h];
265
-    time_grid{2,2} = [0.4 0.33 grid_w grid_h];
266
-    time_grid{3,2} = [0.7 0.33 grid_w grid_h];
267
-    time_grid{1,3} = [0.0 0.03 grid_w grid_h];
268
-    time_grid{2,3} = [0.4 0.03 grid_w grid_h];
269
-    time_grid{3,3} = [0.7 0.03 grid_w grid_h];
289
+    time_grid = cell([3 4]);
290
+    time_grid{1,1} = [0.0 0.75 grid_w grid_h];
291
+    time_grid{2,1} = [0.4 0.75 grid_w grid_h];
292
+    time_grid{3,1} = [0.7 0.75 grid_w grid_h];
293
+    time_grid{1,2} = [0.0 0.50 grid_w grid_h];
294
+    time_grid{2,2} = [0.4 0.50 grid_w grid_h];
295
+    time_grid{3,2} = [0.7 0.50 grid_w grid_h];
296
+    time_grid{1,3} = [0.0 0.25 grid_w grid_h];
297
+    time_grid{2,3} = [0.4 0.25 grid_w grid_h];
298
+    time_grid{3,3} = [0.7 0.0 grid_w grid_h];
299
+    time_grid{1,4} = [0.0 0.0 grid_w grid_h];
300
+    time_grid{2,4} = [0.4 0.0 grid_w grid_h];
301
+    time_grid{3,4} = [0.7 0.0 grid_w grid_h];
270 302
     
271 303
     lStart      = createLabel(pTime, cell2mat(time_grid(2,1)) ,'Start [sec]');
272 304
     lEnd        = createLabel(pTime, cell2mat(time_grid(3,1)) ,'End [sec]');
273 305
     lFrameShift = createLabel(pTime, cell2mat(time_grid(1,2)),'Frame Shift');
274 306
     lFramsSize  = createLabel(pTime, cell2mat(time_grid(1,3)),'Frame Size');
307
+    lFramegroup = createLabel(pTime, cell2mat(time_grid(1,4)),'Timeframe Grouping');
275 308
     
276 309
     model.txtFrameShiftStart   = createTextField(pTime,cell2mat(time_grid(2,2)),'');
277 310
     model.txtFrameShiftEnd     = createTextField(pTime,cell2mat(time_grid(3,2)),'');
278 311
     model.txtFrameShiftDur     = createTextField(pTime,cell2mat(time_grid(2,3)),'');
279 312
     
313
+    TimeframeGroupingOptions = {'none','sum','mean','max','median'};
314
+    
315
+    model.selTimeframeGrouping = uicontrol(pTime,'Style','popupmenu',...
316
+        'Units','normalized',...
317
+        'Position',cell2mat(time_grid(2,4)),...
318
+        'String',TimeframeGroupingOptions,...
319
+        'UserData',TimeframeGroupingOptions);
320
+    set(model.selTimeframeGrouping,'Enable','off');
280 321
     
281
-pSVM = uipanel(parent,'Units','normalized','Position',[0 0.4 0.5 0.4]);
322
+pSVM = uipanel(parent,'Units','normalized','Position',[0 0.3 0.5 0.4]);
282 323
     set(pSVM,'Title','SVM Classification');
283 324
     set(pSVM,'BackgroundColor',basecolor);
284 325
 
... ...
@@ -303,26 +344,26 @@ pSVM = uipanel(parent,'Units','normalized','Position',[0 0.4 0.5 0.4]);
303 344
         'Position',[0 0.0 1 0.25]);
304 345
     set(btnRunXSVM,'Enable','on');
305 346
     
306
-pSOM = uipanel(parent,'Units','normalized','Position',[0.5 0.4 0.5 0.4]);
347
+pSOM = uipanel(parent,'Units','normalized','Position',[0.5 0.3 0.5 0.4]);
307 348
     set(pSOM,'Title','SOM Classification');
308 349
     set(pSOM,'BackgroundColor',basecolor);
309 350
 
310 351
     createLabel(pSOM,[0 0.75 0.3 0.20],'Size:');
311
-    model.txtSomM = createTextField(pSOM,[0.3 0.75 0.25 0.2],'');
312
-    somsizemal = createLabel(pSOM,[0.55 0.75 0.2 0.20],'x');
352
+    model.txtSomM = createTextField(pSOM,[0.3 0.75 0.25 0.16],'');
353
+    somsizemal = createLabel(pSOM,[0.55 0.75 0.2 0.16],'x');
313 354
     set(somsizemal,'HorizontalAlignment','center');
314
-    model.txtSomN = createTextField(pSOM,[0.75 0.75 0.25 0.20],'');
355
+    model.txtSomN = createTextField(pSOM,[0.75 0.75 0.25 0.16],'');
315 356
     latticeModel = {'rect','hexa'};
316 357
     model.selSomLattice = uicontrol(pSOM,'Style','popupmenu',...
317 358
         'Units','normalized',...
318
-        'Position',[0.0 0.5 0.3 0.20],...
359
+        'Position',[0.0 0.5 0.3 0.16],...
319 360
         'String',latticeModel,...
320 361
         'UserData',latticeModel);
321 362
     set(model.selSomLattice,'BackgroundColor','w');
322 363
 
323
-    model.txtSOMnfold = createTextField(pSOM,[0.5 0.50 0.25 0.20],'');
364
+    model.txtSOMnfold = createTextField(pSOM,[0.5 0.50 0.25 0.16],'');
324 365
 %     set(model.txtSOMnfold,'Enable','off');
325
-    createLabel(pSOM,[0.75 0.5 0.25 0.20 ],'-Fold CrossVal');
366
+    createLabel(pSOM,[0.75 0.5 0.25 0.16 ],'-Fold CrossVal');
326 367
        
327 368
 
328 369
     btnRunSOM = uicontrol(pSOM,'String','run SOM Crossvalidation',...
... ...
@@ -335,7 +376,7 @@ pSOM = uipanel(parent,'Units','normalized','Position',[0.5 0.4 0.5 0.4]);
335 376
         'Position',[0.0 0.0 1 0.25]);
336 377
     set(btnRunXSOM,'Enable','on');
337 378
     
338
-pSearchlight = uipanel(parent,'Units','normalized','Position',[0.0 0.1 0.5 0.3]);
379
+pSearchlight = uipanel(parent,'Units','normalized','Position',[0.0 0.0 0.5 0.3]);
339 380
     set(pSearchlight,'Title','Spatiotemporal FB classification');
340 381
     set(pSearchlight,'BackgroundColor',basecolor);
341 382