variable DEFAULTS
Christoph Budziszewski

Christoph Budziszewski commited on 2009-01-12 20:07:09
Zeige 1 geänderte Dateien mit 36 Einfügungen und 13 Löschungen.


git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@109 83ab2cfd-5345-466c-8aeb-2b2739fb922d
... ...
@@ -1,5 +1,23 @@
1 1
 function main_UI(args)
2 2
 
3
+%     project = args.project;
4
+%     DEFAULT = project.default;
5
+
6
+    % DELETE THIS
7
+DEFAULT.selectedSubject = 1;
8
+DEFAULT.smoothed        = 1;
9
+DEFAULT.multisubject    = 'single';
10
+DEFAULT.pststart        = -15;
11
+DEFAULT.pstend          = 40;
12
+DEFAULT.baselinestart   = -3;
13
+DEFAULT.baselineend     = -1;
14
+DEFAULT.frameshiftstart = -5;
15
+DEFAULT.frameshiftend   = 35;
16
+DEFAULT.frameshiftdur   = 0;
17
+DEFAULT.classdefstring  = 'left,\t[9,11,13],\t -2 ;\nright,\t[10,12,14],\t -1;';
18
+DEFAULT.voxelstring     = 'SPL l,\t[ 0, 0, 0];\nSPL r,\t[ 0, 0, 0];\n';
19
+DEFAULT.svmoptstring    = '-s 0 -t 0 -v 6 -c 1';
20
+    % STOP DELETE HERE
3 21
 
4 22
 %  Initialize and hide the GUI as it is being constructed.
5 23
     frameWidth=450;
... ...
@@ -17,7 +35,9 @@ function main_UI(args)
17 35
     
18 36
     savemenu = uimenu(frame,'Label','Save/Load');
19 37
     
38
+%     model.subjectMap = SubjectRoiMapping(project);
20 39
     model.subjectMap = SubjectRoiMapping;
40
+    
21 41
     nElementRows = 24;
22 42
     optionLineHeight = 1.0/nElementRows;
23 43
     controlElementHeight=optionLineHeight*(1.0/1.5)*frameHeight;
... ...
@@ -36,12 +56,15 @@ function main_UI(args)
36 56
     model.subjectSelector = uicontrol(pSubject,'Style','listbox',...
37 57
                     'Min',1, 'Max',3,...
38 58
                     'String',getSubjectCellList(model.subjectMap),...
39
-                    'Value',5,...  % default selected item
59
+                    'Value',DEFAULT.selectedSubject,...  % default selected item
40 60
                     'Position',[firstColumn firstRow 0.66*frameWidth controlElementHeight*6]);
41 61
     set(model.subjectSelector,'BackgroundColor','w');
42 62
     
43
-    model.txtSmoothed     = createTextField(pSubject,[0.68*frameWidth firstRow  0.25*frameWidth controlElementHeight],'1');
44
-    model.txtMultisubject = createTextField(pSubject,[0.68*frameWidth firstRow*2  0.25*frameWidth controlElementHeight],'single');
63
+    createLabel(pSubject,[0.68*frameWidth firstRow*2  0.25*frameWidth controlElementHeight],'Smooth Data');
64
+    model.txtSmoothed     = uicontrol(pSubject,'Style','checkbox','Position',[0.68*frameWidth firstRow  0.25*frameWidth controlElementHeight],'Value',DEFAULT.smoothed);
65
+
66
+    createLabel(pSubject,[0.68*frameWidth firstRow*4  0.25*frameWidth controlElementHeight],'Crossvalidation');
67
+    model.txtMultisubject = createTextField(pSubject,[0.68*frameWidth firstRow*3  0.25*frameWidth controlElementHeight],DEFAULT.multisubject);
45 68
     set(model.txtMultisubject,'enable','off');
46 69
 
47 70
     % PSTH
... ...
@@ -64,13 +87,13 @@ function main_UI(args)
64 87
     lFramsSize  = createLabel(pPSTH, [firstColumn  fifthRow  0.33*frameWidth controlElementHeight],'SVM Frame Size');
65 88
     
66 89
     
67
-    model.txtPSTHStart       = createTextField(pPSTH,[secondColumn secondRow 0.25*frameWidth controlElementHeight],'-10.0');
68
-    model.txtPSTHEnd         = createTextField(pPSTH,[thirdColumn  secondRow 0.25*frameWidth controlElementHeight],' 40.0');
69
-    model.txtBaselineStart   = createTextField(pPSTH,[secondColumn thirdRow  0.25*frameWidth controlElementHeight],'-3.0');
70
-    model.txtBaselineEnd     = createTextField(pPSTH,[thirdColumn  thirdRow  0.25*frameWidth controlElementHeight],'-1.0');
71
-    model.txtFrameShiftStart = createTextField(pPSTH,[secondColumn fourthRow 0.25*frameWidth controlElementHeight],'-5.0');
72
-    model.txtFrameShiftEnd   = createTextField(pPSTH,[thirdColumn  fourthRow 0.25*frameWidth controlElementHeight],' 35.0');
73
-    model.txtFrameShiftDur   = createTextField(pPSTH,[secondColumn fifthRow  0.25*frameWidth controlElementHeight],' 0');
90
+    model.txtPSTHStart       = createTextField(pPSTH,[secondColumn secondRow 0.25*frameWidth controlElementHeight],DEFAULT.pststart);
91
+    model.txtPSTHEnd         = createTextField(pPSTH,[thirdColumn  secondRow 0.25*frameWidth controlElementHeight],DEFAULT.pstend);
92
+    model.txtBaselineStart   = createTextField(pPSTH,[secondColumn thirdRow  0.25*frameWidth controlElementHeight],DEFAULT.baselinestart);
93
+    model.txtBaselineEnd     = createTextField(pPSTH,[thirdColumn  thirdRow  0.25*frameWidth controlElementHeight],DEFAULT.baselineend);
94
+    model.txtFrameShiftStart = createTextField(pPSTH,[secondColumn fourthRow 0.25*frameWidth controlElementHeight],DEFAULT.frameshiftstart);
95
+    model.txtFrameShiftEnd   = createTextField(pPSTH,[thirdColumn  fourthRow 0.25*frameWidth controlElementHeight],DEFAULT.frameshiftend);
96
+    model.txtFrameShiftDur   = createTextField(pPSTH,[secondColumn fifthRow  0.25*frameWidth controlElementHeight],DEFAULT.frameshiftdur);
74 97
 
75 98
                 
76 99
     %Classes
... ...
@@ -81,7 +104,7 @@ function main_UI(args)
81 104
     secondRow   = (nClassRows-4.5)*controlElementHeight;
82 105
 
83 106
     lClassDef = createLabel(pCLASS, [firstColumn firstRow  0.66*frameWidth controlElementHeight],'<Label>,<[Event,Event,..]>,<SVM-Value>;');
84
-    model.txtClassDef = createTextField(pCLASS,[firstColumn secondRow 0.98*frameWidth 4*controlElementHeight],sprintf('DRT,\t[9,10],\t-2 ;\nM2ST,\t[11,12],\t-1;'));
107
+    model.txtClassDef = createTextField(pCLASS,[firstColumn secondRow 0.98*frameWidth 4*controlElementHeight],sprintf(DEFAULT.classdefstring));
85 108
     set(model.txtClassDef,'HorizontalAlignment','left');
86 109
     set(model.txtClassDef,'Max',20);
87 110
     set(model.txtClassDef,'Min',0);
... ...
@@ -96,7 +119,7 @@ function main_UI(args)
96 119
 
97 120
     lVoxelDef = createLabel(pVOXEL, [firstColumn firstRow  0.66*frameWidth controlElementHeight],'<ROI Name>,<ROI Modifier>;');
98 121
     model.txtVoxelDef = createTextField(pVOXEL,[firstColumn secondRow 0.98*frameWidth 6*controlElementHeight],...
99
-        sprintf('SPL l,\t[ 0, 0, 0];\nSPL r,\t[ 0, 0, 0];\n'));
122
+        sprintf(DEFAULT.voxelstring));
100 123
     set(model.txtVoxelDef,'HorizontalAlignment','left');
101 124
     set(model.txtVoxelDef,'Max',20);
102 125
     set(model.txtVoxelDef,'Min',0);
... ...
@@ -106,7 +129,7 @@ function main_UI(args)
106 129
     firstColumn  =  5.00;
107 130
     firstRow     =  1.00 * controlElementHeight;
108 131
 
109
-    model.txtSVMopts = createTextField(pSVM,[firstColumn firstRow  0.66*frameWidth controlElementHeight],'-s 0 -t 0 -v 6 -c 1');
132
+    model.txtSVMopts = createTextField(pSVM,[firstColumn firstRow  0.66*frameWidth controlElementHeight],DEFAULT.svmoptstring);
110 133
     %model.txtSVMopts = createTextField(pSVM,[firstColumn firstRow  0.66*frameWidth controlElementHeight],'-s 0 -t 2 -v 6 -c 10 -g .1');
111 134
     set(model.txtSVMopts,'Enable','on'); %inactive
112 135
     set(model.txtSVMopts,'HorizontalAlignment','left');
113 136