Browse code

getBaseDir

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@208 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Axel Lindner authored on10/08/2009 12:15:55
Showing1 changed files
... ...
@@ -65,7 +65,7 @@ switch task
65 65
         roiargs.timeline        = timeLine;
66 66
         roiargs.classes         = classDef;
67 67
         roiargs.mask            = mask;
68
-        roiargs.basedir         = model.baseDir;
68
+        roiargs.basedir         = getBaseDir(model);
69 69
         roiargs.sessionList     = 1:3;
70 70
         roiargs.eventList       = classDef.eventMatrix;
71 71
         roiargs.psthOpts        = psthOpts;
Browse code

fixed FBS basedir fixed confidece interval plot

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@205 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Christoph Budziszewski authored on06/08/2009 18:02:56
Showing1 changed files
... ...
@@ -81,7 +81,7 @@ switch task
81 81
         out.header.classDef = classDef;
82 82
         
83 83
 
84
-        out.subjectdata  = fbs_load_mask(model.baseDir,subjects);
84
+        out.subjectdata  = fbs_load_mask(getBaseDir(model),subjects);
85 85
         
86 86
 %         if(size(subjects,2)>1)
87 87
 %             display(sprintf('No BATCH Support for Searchlight!'));
... ...
@@ -92,7 +92,7 @@ switch task
92 92
         fbsargs.timeline        = timeLine;
93 93
         fbsargs.classes         = classDef;
94 94
         fbsargs.mask            = mask;
95
-        fbsargs.basedir         = model.baseDir;
95
+        fbsargs.basedir         = getBaseDir(model);
96 96
         fbsargs.sessionList     = 1:3;
97 97
         fbsargs.eventList       = classDef.eventMatrix;
98 98
         fbsargs.psthOpts        = psthOpts;
Browse code

spatial and temporal grouping functionality

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@202 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Christoph Budziszewski authored on03/08/2009 16:18:15
Showing1 changed files
... ...
@@ -31,7 +31,7 @@ psthOpts.psthNorm      = getPsthNormalizationMethod(model);
31 31
 
32 32
 switch task
33 33
     case 'COORD'
34
-        disp('COORD');
34
+        disp('LUT Approach');
35 35
        
36 36
         out = struct;
37 37
         out.header = struct;
... ...
@@ -48,11 +48,12 @@ switch task
48 48
         coordargs.coords        = parseCoordinateTextField(model);
49 49
         coordargs.mask          = mask;
50 50
         coordargs.psthOpts      = psthOpts;
51
+        coordargs.groupingFkt   = getSpatialGroupingFunction(model);
51 52
         
52 53
         out.subjectdata = runCoordTable(coordargs);
53 54
 
54 55
     case 'ROI'
55
-        disp('ROI');
56
+        disp('ROI Image Approach');
56 57
         out = struct;
57 58
         out.header = struct;
58 59
         out.header.type = 'ROI';
... ...
@@ -117,6 +118,7 @@ end
117 118
 warn = warning('off','all');
118 119
 header            = preprocessedData.header;
119 120
 header.frameShift = getFrameShiftParams(model);
121
+header.timeframeGroupingfunction = getTemporalGroupingFunction(model);
120 122
 data              = preprocessedData.subjectdata;
121 123
 
122 124
 switch task
Browse code

almost all "change study" features implemented. needs testing.

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@199 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Christoph Budziszewski authored on30/07/2009 18:46:52
Showing1 changed files
... ...
@@ -42,7 +42,7 @@ switch task
42 42
         coordargs = struct;
43 43
         coordargs.subjects      = subjects;
44 44
         coordargs.timeline      = timeLine;
45
-        coordargs.basedir       = model.baseDir;
45
+        coordargs.basedir       = getBaseDir(model);
46 46
         coordargs.sessionList   = 1:3;
47 47
         coordargs.eventList     = classDef.eventMatrix;
48 48
         coordargs.coords        = parseCoordinateTextField(model);
Browse code

refined gui elements

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@191 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Christoph Budziszewski authored on03/05/2009 04:08:13
Showing1 changed files
... ...
@@ -16,6 +16,8 @@ end
16 16
 function preprocess(model,task)
17 17
 % parse the GUI and pass parameters as structure
18 18
 
19
+evalin('base','clear(''preprocessedData'')');
20
+
19 21
 timeLine = getTimeLineParams(model);
20 22
 subjects = getSubjectCellList(model);
21 23
 classDef = parseClassDef(model);
... ...
@@ -112,7 +114,7 @@ if(~(isa(preprocessedData,'struct')))
112 114
     display('you need to preprocess some data before this step');
113 115
     return
114 116
 end
115
-
117
+warn = warning('off','all');
116 118
 header            = preprocessedData.header;
117 119
 header.frameShift = getFrameShiftParams(model);
118 120
 data              = preprocessedData.subjectdata;
... ...
@@ -163,8 +165,8 @@ switch task
163 165
         
164 166
 end
165 167
 
166
-% disp('warings restored');
167
-% warning('on',warn);
168
+disp('warings restored');
169
+warning(warn);
168 170
 end
169 171
 
170 172
 function decode_plot(model,type)
Browse code

error tracking: added psth-plot, debug option. foud possible searchlight error.

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@190 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Christoph Budziszewski authored on28/04/2009 14:49:31
Showing1 changed files
... ...
@@ -80,10 +80,10 @@ switch task
80 80
 
81 81
         out.subjectdata  = fbs_load_mask(model.baseDir,subjects);
82 82
         
83
-        if(size(subjects,2)>1)
84
-            display(sprintf('No BATCH Support for Searchlight!'));
85
-            return
86
-        end
83
+%         if(size(subjects,2)>1)
84
+%             display(sprintf('No BATCH Support for Searchlight!'));
85
+%             return
86
+%         end
87 87
         
88 88
         fbsargs = struct;
89 89
         fbsargs.timeline        = timeLine;
Browse code

fbs custom timeline mod, for-loop bug included system event queue flush every 100 voxel

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@183 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Christoph Budziszewski authored on26/04/2009 02:36:45
Showing1 changed files
... ...
@@ -158,7 +158,7 @@ switch task
158 158
         fbsargs.svmopts = getSvmArgs(model,1);
159 159
         header.svmrnd   = getSvmRnd(model);
160 160
         fbsargs.radius  = getSearchlightRadius(model);
161
-	fbsargs.timeline = getSearchlightTimeline(model);
161
+        fbsargs.timeline = getSearchlightTimeline(model);
162 162
             runFBSImageMaskMode(header,data,fbsargs);
163 163
         
164 164
 end
Browse code

fbs timeline mod

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@180 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Christoph Budziszewski authored on26/04/2009 01:20:58
Showing1 changed files
... ...
@@ -158,6 +158,7 @@ switch task
158 158
         fbsargs.svmopts = getSvmArgs(model,1);
159 159
         header.svmrnd   = getSvmRnd(model);
160 160
         fbsargs.radius  = getSearchlightRadius(model);
161
+	fbsargs.timeline = getSearchlightTimeline(model);
161 162
             runFBSImageMaskMode(header,data,fbsargs);
162 163
         
163 164
 end
Browse code

added some batch files, workaround for NAN - Bug

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@178 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Christoph Budziszewski authored on23/04/2009 16:48:20
Showing1 changed files
... ...
@@ -122,17 +122,22 @@ switch task
122 122
         disp('SVM');
123 123
         svmopts    = getSvmArgs(model,1);
124 124
         header.svmrnd = getSvmRnd(model);
125
+        header.nantozero = 1;
125 126
         decode = calculateMultiSubjectDecodePerformance(header,data,svmopts);
126 127
         decode.header = header;
127 128
         assignin('base','decode',decode);
128 129
     case 'XSVM'
129 130
         disp('XSVM')
130 131
         svmopts  = getSvmArgs(model,0);
132
+        header.svmrnd = getSvmRnd(model);
133
+        header.nantozero = 1;
131 134
         decode = xsvm_subject_loop(header,data,svmopts);
132 135
         decode.header = header;
133 136
         assignin('base','decode',decode);
134 137
     case 'SOM'
135 138
         display('SOM');
139
+        somopts.rnd = 1;
140
+        somopts.nantozero = 1;
136 141
         somopts.size = [3 3];
137 142
         somopts.lattice = 'rect';
138 143
         somopts.nfold = 6;
... ...
@@ -141,6 +146,8 @@ switch task
141 146
         assignin('base','decode',decode);
142 147
     case 'XSOM'
143 148
         display('XSOM');
149
+        somopts.rnd = 1;
150
+        somopts.nantozero = 1;
144 151
         somopts.size = [3 3];
145 152
         somopts.lattice = 'rect';
146 153
         decode = som_xsubject_performance(header,data,somopts);
Browse code

SOM Single run

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@174 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Christoph Budziszewski authored on07/04/2009 16:43:52
Showing1 changed files
... ...
@@ -133,8 +133,12 @@ switch task
133 133
         assignin('base','decode',decode);
134 134
     case 'SOM'
135 135
         display('SOM');
136
-        disp('not implemented')
137
-
136
+        somopts.size = [3 3];
137
+        somopts.lattice = 'rect';
138
+        somopts.nfold = 6;
139
+        decode = som_subject_batch(header,data,somopts);
140
+        decode.header = header;
141
+        assignin('base','decode',decode);
138 142
     case 'XSOM'
139 143
         display('XSOM');
140 144
         somopts.size = [3 3];
Browse code

X-SOM finished!

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@173 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Christoph Budziszewski authored on07/04/2009 15:54:26
Showing1 changed files
... ...
@@ -135,8 +135,8 @@ switch task
135 135
         display('SOM');
136 136
         disp('not implemented')
137 137
 
138
-    case 'X-SOM'
139
-        display('X-SOM');
138
+    case 'XSOM'
139
+        display('XSOM');
140 140
         somopts.size = [3 3];
141 141
         somopts.lattice = 'rect';
142 142
         decode = som_xsubject_performance(header,data,somopts);
Browse code

manual renamings, better FBS savePath (ISO-Date)

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@172 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Christoph Budziszewski authored on07/04/2009 15:07:27
Showing1 changed files
... ...
@@ -133,14 +133,17 @@ switch task
133 133
         assignin('base','decode',decode);
134 134
     case 'SOM'
135 135
         display('SOM');
136
-        somopts = '';
137
-        decode = som_combined_subject_batch(header,data,somopts);
136
+        disp('not implemented')
137
+
138
+    case 'X-SOM'
139
+        display('X-SOM');
140
+        somopts.size = [3 3];
141
+        somopts.lattice = 'rect';
142
+        decode = som_xsubject_performance(header,data,somopts);
138 143
         decode.header = header;
139 144
         assignin('base','decode',decode);
140
-    case 'X-SOM'
141
-        disp('not implemented')
142 145
     case 'FBS'
143
-        disp('this method is under high development.')
146
+        display('FBS');
144 147
         fbsargs.svmopts = getSvmArgs(model,1);
145 148
         header.svmrnd   = getSvmRnd(model);
146 149
         fbsargs.radius  = getSearchlightRadius(model);
Browse code

searchlight ready. missing nifti-image-write support. added timing to FBS

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@167 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Christoph Budziszewski authored on30/03/2009 17:54:25
Showing1 changed files
... ...
@@ -141,6 +141,8 @@ switch task
141 141
         disp('not implemented')
142 142
     case 'FBS'
143 143
         disp('this method is under high development.')
144
+        fbsargs.svmopts = getSvmArgs(model,1);
145
+        header.svmrnd   = getSvmRnd(model);
144 146
         fbsargs.radius  = getSearchlightRadius(model);
145 147
             runFBSImageMaskMode(header,data,fbsargs);
146 148
         
Browse code

snapshot, working on fbs

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@166 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Christoph Budziszewski authored on27/03/2009 14:57:26
Showing1 changed files
... ...
@@ -48,9 +48,7 @@ switch task
48 48
         coordargs.psthOpts      = psthOpts;
49 49
         
50 50
         out.subjectdata = runCoordTable(coordargs);
51
-        
52
-        assignin('base','preprocessedData',out);
53
-        
51
+
54 52
     case 'ROI'
55 53
         disp('ROI');
56 54
         out = struct;
... ...
@@ -71,8 +69,6 @@ switch task
71 69
         
72 70
         out.subjectdata = runROIImageMaskMode(roiargs);
73 71
         
74
-        assignin('base','preprocessedData',out);
75
-        
76 72
     case 'FBS'
77 73
         disp('FSB');
78 74
         out = struct;
... ...
@@ -81,14 +77,15 @@ switch task
81 77
         out.header.timeline = timeLine;
82 78
         out.header.classDef = classDef;
83 79
         
84
-        fbsargs = struct;
85
-        fbsargs.subject         = subjects;
80
+
81
+        out.subjectdata  = fbs_load_mask(model.baseDir,subjects);
86 82
         
87 83
         if(size(subjects,2)>1)
88 84
             display(sprintf('No BATCH Support for Searchlight!'));
89 85
             return
90 86
         end
91 87
         
88
+        fbsargs = struct;
92 89
         fbsargs.timeline        = timeLine;
93 90
         fbsargs.classes         = classDef;
94 91
         fbsargs.mask            = mask;
... ...
@@ -96,10 +93,16 @@ switch task
96 93
         fbsargs.sessionList     = 1:3;
97 94
         fbsargs.eventList       = classDef.eventMatrix;
98 95
         fbsargs.psthOpts        = psthOpts;
99
-        
100
-        out.subjectdata = runFBSImageMaskMode(fbsargs);
96
+
97
+        out.header.args         = fbsargs;
98
+
99
+        % no more preprocessing in this step!
101 100
                 
102 101
 end
102
+
103
+assignin('base','preprocessedData',out);
104
+
105
+
103 106
 end
104 107
 
105 108
 function decode(model,task)
... ...
@@ -137,8 +140,9 @@ switch task
137 140
     case 'X-SOM'
138 141
         disp('not implemented')
139 142
     case 'FBS'
140
-        disp('not implemented')
141
-        fbs.radius        = getSearchlightRadius(model);
143
+        disp('this method is under high development.')
144
+        fbsargs.radius  = getSearchlightRadius(model);
145
+            runFBSImageMaskMode(header,data,fbsargs);
142 146
         
143 147
 end
144 148
 
Browse code

stable version for conference.

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@165 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Christoph Budziszewski authored on19/03/2009 15:14:44
Showing1 changed files
... ...
@@ -74,7 +74,31 @@ switch task
74 74
         assignin('base','preprocessedData',out);
75 75
         
76 76
     case 'FBS'
77
-        disp('not implemented')
77
+        disp('FSB');
78
+        out = struct;
79
+        out.header = struct;
80
+        out.header.type = 'FBS';
81
+        out.header.timeline = timeLine;
82
+        out.header.classDef = classDef;
83
+        
84
+        fbsargs = struct;
85
+        fbsargs.subject         = subjects;
86
+        
87
+        if(size(subjects,2)>1)
88
+            display(sprintf('No BATCH Support for Searchlight!'));
89
+            return
90
+        end
91
+        
92
+        fbsargs.timeline        = timeLine;
93
+        fbsargs.classes         = classDef;
94
+        fbsargs.mask            = mask;
95
+        fbsargs.basedir         = model.baseDir;
96
+        fbsargs.sessionList     = 1:3;
97
+        fbsargs.eventList       = classDef.eventMatrix;
98
+        fbsargs.psthOpts        = psthOpts;
99
+        
100
+        out.subjectdata = runFBSImageMaskMode(fbsargs);
101
+                
78 102
 end
79 103
 end
80 104
 
Browse code

Classes must reside in Main Dir!

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@164 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Christoph Budziszewski authored on18/03/2009 14:58:00
Showing1 changed files
... ...
@@ -46,7 +46,6 @@ switch task
46 46
         coordargs.coords        = parseCoordinateTextField(model);
47 47
         coordargs.mask          = mask;
48 48
         coordargs.psthOpts      = psthOpts;
49
-
50 49
         
51 50
         out.subjectdata = runCoordTable(coordargs);
52 51
         
Browse code

radius frontend enabled, fixed backend problems. radius working

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@162 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Christoph Budziszewski authored on18/03/2009 14:50:47
Showing1 changed files
... ...
@@ -45,7 +45,6 @@ switch task
45 45
         coordargs.eventList     = classDef.eventMatrix;
46 46
         coordargs.coords        = parseCoordinateTextField(model);
47 47
         coordargs.mask          = mask;
48
-        coordargs.radius        = getSearchlightRadius(model);
49 48
         coordargs.psthOpts      = psthOpts;
50 49
 
51 50
         
... ...
@@ -114,6 +113,9 @@ switch task
114 113
         assignin('base','decode',decode);
115 114
     case 'X-SOM'
116 115
         disp('not implemented')
116
+    case 'FBS'
117
+        disp('not implemented')
118
+        fbs.radius        = getSearchlightRadius(model);
117 119
         
118 120
 end
119 121
 
Browse code

begin SOM implementation

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@159 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Christoph Budziszewski authored on16/03/2009 21:53:24
Showing1 changed files
... ...
@@ -83,6 +83,11 @@ end
83 83
 function decode(model,task)
84 84
 preprocessedData = evalin('base','preprocessedData');
85 85
 
86
+if(~(isa(preprocessedData,'struct')))
87
+    display('you need to preprocess some data before this step');
88
+    return
89
+end
90
+
86 91
 header            = preprocessedData.header;
87 92
 header.frameShift = getFrameShiftParams(model);
88 93
 data              = preprocessedData.subjectdata;
... ...
@@ -102,8 +107,11 @@ switch task
102 107
         decode.header = header;
103 108
         assignin('base','decode',decode);
104 109
     case 'SOM'
105
-        disp('not implemented')
106
-
110
+        display('SOM');
111
+        somopts = '';
112
+        decode = som_combined_subject_batch(header,data,somopts);
113
+        decode.header = header;
114
+        assignin('base','decode',decode);
107 115
     case 'X-SOM'
108 116
         disp('not implemented')
109 117
         
Browse code

normalization features enabled

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@158 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Christoph Budziszewski authored on16/03/2009 21:07:46
Showing1 changed files
... ...
@@ -21,8 +21,11 @@ subjects = getSubjectCellList(model);
21 21
 classDef = parseClassDef(model);
22 22
 
23 23
 mask     = ['^' cell2mat(getImageFileMask(model)) '.*\.img$'];
24
-% images
25
-% normalization
24
+
25
+psthOpts = struct;
26
+psthOpts.colBias       = getColumnBiasRemoveOption(model);
27
+psthOpts.psthNorm      = getPsthNormalizationMethod(model);
28
+
26 29
 
27 30
 switch task
28 31
     case 'COORD'
... ...
@@ -43,6 +46,8 @@ switch task
43 46
         coordargs.coords        = parseCoordinateTextField(model);
44 47
         coordargs.mask          = mask;
45 48
         coordargs.radius        = getSearchlightRadius(model);
49
+        coordargs.psthOpts      = psthOpts;
50
+
46 51
         
47 52
         out.subjectdata = runCoordTable(coordargs);
48 53
         
... ...
@@ -64,6 +69,7 @@ switch task
64 69
         roiargs.basedir         = model.baseDir;
65 70
         roiargs.sessionList     = 1:3;
66 71
         roiargs.eventList       = classDef.eventMatrix;
72
+        roiargs.psthOpts        = psthOpts;
67 73
         
68 74
         out.subjectdata = runROIImageMaskMode(roiargs);
69 75
         
Browse code

added randomize datapoints option

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@157 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Christoph Budziszewski authored on16/03/2009 20:09:44
Showing1 changed files
... ...
@@ -85,6 +85,7 @@ switch task
85 85
     case 'SVM'
86 86
         disp('SVM');
87 87
         svmopts    = getSvmArgs(model,1);
88
+        header.svmrnd = getSvmRnd(model);
88 89
         decode = calculateMultiSubjectDecodePerformance(header,data,svmopts);
89 90
         decode.header = header;
90 91
         assignin('base','decode',decode);
Browse code

enabled radius. but does not work with r>0 !

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@156 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Christoph Budziszewski authored on16/03/2009 18:55:40
Showing1 changed files
... ...
@@ -42,6 +42,7 @@ switch task
42 42
         coordargs.eventList     = classDef.eventMatrix;
43 43
         coordargs.coords        = parseCoordinateTextField(model);
44 44
         coordargs.mask          = mask;
45
+        coordargs.radius        = getSearchlightRadius(model);
45 46
         
46 47
         out.subjectdata = runCoordTable(coordargs);
47 48
         
Browse code

all enabled features working: PRE: roi-image and coord-table CLASS: batch svm and x-subject svm PLOT: raw psth per voxel, subject performance, mean performance and SE

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@155 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Christoph Budziszewski authored on16/03/2009 18:11:30
Showing1 changed files
... ...
@@ -85,11 +85,13 @@ switch task
85 85
         disp('SVM');
86 86
         svmopts    = getSvmArgs(model,1);
87 87
         decode = calculateMultiSubjectDecodePerformance(header,data,svmopts);
88
+        decode.header = header;
88 89
         assignin('base','decode',decode);
89 90
     case 'XSVM'
90 91
         disp('XSVM')
91 92
         svmopts  = getSvmArgs(model,0);
92 93
         decode = xsvm_subject_loop(header,data,svmopts);
94
+        decode.header = header;
93 95
         assignin('base','decode',decode);
94 96
     case 'SOM'
95 97
         disp('not implemented')
... ...
@@ -104,10 +106,10 @@ end
104 106
 end
105 107
 
106 108
 function decode_plot(model,type)
107
-switch type
108
-    case 'SIMPLE'
109
-        
110
-end
109
+decode = evalin('base','decode');
110
+preprocessed = evalin('base','preprocessedData');
111
+plotDecodePerformance(type,decode,preprocessed.subjectdata);
112
+       
111 113
 end
112 114
 
113 115
 
Browse code

task-models implementet.

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@154 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Christoph Budziszewski authored on16/03/2009 17:26:16
Showing1 changed files
... ...
@@ -5,6 +5,8 @@ switch task
5 5
         preprocess(model,subtask);
6 6
     case 'decode'
7 7
         decode(model,subtask);
8
+    case 'plot'
9
+        decode_plot(model,subtask);
8 10
 end
9 11
 end
10 12
 % disp('all warnings OFF')
... ...
@@ -101,7 +103,11 @@ end
101 103
 % warning('on',warn);
102 104
 end
103 105
 
104
-function decode_plot()
106
+function decode_plot(model,type)
107
+switch type
108
+    case 'SIMPLE'
109
+        
110
+end
105 111
 end
106 112
 
107 113
 
Browse code

first plot button. not working. Idea: 3 tasks = 3 models.

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@153 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Christoph Budziszewski authored on16/03/2009 17:07:44
Showing1 changed files
... ...
@@ -73,16 +73,21 @@ end
73 73
 
74 74
 function decode(model,task)
75 75
 preprocessedData = evalin('base','preprocessedData');
76
+
77
+header            = preprocessedData.header;
78
+header.frameShift = getFrameShiftParams(model);
79
+data              = preprocessedData.subjectdata;
80
+
76 81
 switch task
77 82
     case 'SVM'
78 83
         disp('SVM');
79 84
         svmopts    = getSvmArgs(model,1);
80
-        decode = calculateMultiSubjectDecodePerformance(preprocessedData.header,preprocessedData.subjectdata,svmopts);
85
+        decode = calculateMultiSubjectDecodePerformance(header,data,svmopts);
81 86
         assignin('base','decode',decode);
82 87
     case 'XSVM'
83 88
         disp('XSVM')
84 89
         svmopts  = getSvmArgs(model,0);
85
-        decode = xsvm_subject_loop(preprocessedData.header,preprocessedData.subjectdata,svmopts);
90
+        decode = xsvm_subject_loop(header,data,svmopts);
86 91
         assignin('base','decode',decode);
87 92
     case 'SOM'
88 93
         disp('not implemented')
... ...
@@ -96,6 +101,9 @@ end
96 101
 % warning('on',warn);
97 102
 end
98 103
 
104
+function decode_plot()
105
+end
106
+
99 107
 
100 108
 
101 109
 
Browse code

GUI Task Switch: selfmade TabbedPanel

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@152 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Christoph Budziszewski authored on16/03/2009 16:03:31
Showing1 changed files
... ...
@@ -80,7 +80,7 @@ switch task
80 80
         decode = calculateMultiSubjectDecodePerformance(preprocessedData.header,preprocessedData.subjectdata,svmopts);
81 81
         assignin('base','decode',decode);
82 82
     case 'XSVM'
83
-        disp('not implemented')
83
+        disp('XSVM')
84 84
         svmopts  = getSvmArgs(model,0);
85 85
         decode = xsvm_subject_loop(preprocessedData.header,preprocessedData.subjectdata,svmopts);
86 86
         assignin('base','decode',decode);
Browse code

more x-svm classification

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@149 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Christoph Budziszewski authored on12/03/2009 17:15:24
Showing1 changed files
... ...
@@ -72,16 +72,18 @@ end
72 72
 end
73 73
 
74 74
 function decode(model,task)
75
+preprocessedData = evalin('base','preprocessedData');
75 76
 switch task
76 77
     case 'SVM'
77 78
         disp('SVM');
78 79
         svmopts    = getSvmArgs(model,1);
79
-        preprocessedData = evalin('base','preprocessedData');
80 80
         decode = calculateMultiSubjectDecodePerformance(preprocessedData.header,preprocessedData.subjectdata,svmopts);
81 81
         assignin('base','decode',decode);
82
-    case 'X-SVM'
82
+    case 'XSVM'
83 83
         disp('not implemented')
84
-        
84
+        svmopts  = getSvmArgs(model,0);
85
+        decode = xsvm_subject_loop(preprocessedData.header,preprocessedData.subjectdata,svmopts);
86
+        assignin('base','decode',decode);
85 87
     case 'SOM'
86 88
         disp('not implemented')
87 89
 
Browse code

working: SingleSubject, CoordTable, SVM, VISUAL SingleSubject, ROI-Image, SVM, VISUAL MultiSubject, CoordTable, SVM, VISUAL MultiSubject, ROI-Image, SVM, VISUAL

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@147 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Christoph Budziszewski authored on09/03/2009 15:42:39
Showing1 changed files
... ...
@@ -1,7 +1,6 @@
1 1
 function main(model,task,subtask)
2 2
 disp('RUN');
3 3
 switch task 
4
-    
5 4
     case 'pre'
6 5
         preprocess(model,subtask);
7 6
     case 'decode'
... ...
@@ -33,7 +32,6 @@ switch task
33 32
         out.header.timeline = timeLine;
34 33
         out.header.classDef = classDef;
35 34
         
36
-        
37 35
         coordargs = struct;
38 36
         coordargs.subjects      = subjects;
39 37
         coordargs.timeline      = timeLine;
... ...
@@ -49,6 +47,12 @@ switch task
49 47
         
50 48
     case 'ROI'
51 49
         disp('ROI');
50
+        out = struct;
51
+        out.header = struct;
52
+        out.header.type = 'ROI';
53
+        out.header.timeline = timeLine;
54
+        out.header.classDef = classDef;
55
+        
52 56
         roiargs = struct;
53 57
         roiargs.subjects        = subjects;
54 58
         roiargs.timeline        = timeLine;
... ...
@@ -58,7 +62,9 @@ switch task
58 62
         roiargs.sessionList     = 1:3;
59 63
         roiargs.eventList       = classDef.eventMatrix;
60 64
         
61
-        runROIImageMaskMode(roiargs);
65
+        out.subjectdata = runROIImageMaskMode(roiargs);
66
+        
67
+        assignin('base','preprocessedData',out);
62 68
         
63 69
     case 'FBS'
64 70
         disp('not implemented')
... ...
@@ -72,8 +78,7 @@ switch task
72 78
         svmopts    = getSvmArgs(model,1);
73 79
         preprocessedData = evalin('base','preprocessedData');
74 80
         decode = calculateMultiSubjectDecodePerformance(preprocessedData.header,preprocessedData.subjectdata,svmopts);
75
-        
76
-        
81
+        assignin('base','decode',decode);
77 82
     case 'X-SVM'
78 83
         disp('not implemented')
79 84
         
Browse code

single subject -> svm classification -> plotDecodePerformance working!

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@145 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Christoph Budziszewski authored on06/03/2009 13:17:25
Showing1 changed files
... ...
@@ -71,7 +71,7 @@ switch task
71 71
         disp('SVM');
72 72
         svmopts    = getSvmArgs(model,1);
73 73
         preprocessedData = evalin('base','preprocessedData');
74
-        calculateMultiSubjectDecodePerformance(preprocessedData.header,preprocessedData.subjectdata,svmopts);
74
+        decode = calculateMultiSubjectDecodePerformance(preprocessedData.header,preprocessedData.subjectdata,svmopts);
75 75
         
76 76
         
77 77
     case 'X-SVM'
Browse code

enabled svm classification. labelmap not working

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@143 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Christoph Budziszewski authored on05/03/2009 16:47:04
Showing1 changed files
... ...
@@ -1,10 +1,20 @@
1
-function main(model,task)
2
-
3
-% parse the GUI and pass parameters as structure
1
+function main(model,task,subtask)
4 2
 disp('RUN');
3
+switch task 
4
+    
5
+    case 'pre'
6
+        preprocess(model,subtask);
7
+    case 'decode'
8
+        decode(model,subtask);
9
+end
10
+end
5 11
 % disp('all warnings OFF')
6 12
 % warn = warning('off','all');
7 13
 
14
+
15
+function preprocess(model,task)
16
+% parse the GUI and pass parameters as structure
17
+
8 18
 timeLine = getTimeLineParams(model);
9 19
 subjects = getSubjectCellList(model);
10 20
 classDef = parseClassDef(model);
... ...
@@ -16,41 +26,62 @@ mask     = ['^' cell2mat(getImageFileMask(model)) '.*\.img$'];
16 26
 switch task
17 27
     case 'COORD'
18 28
         disp('COORD');
29
+       
30
+        out = struct;
31
+        out.header = struct;
32
+        out.header.type = 'COORD';
33
+        out.header.timeline = timeLine;
34
+        out.header.classDef = classDef;
35
+        
36
+        
19 37
         coordargs = struct;
20
-        coordargs.subjects = subjects;
21
-        coordargs.timeline = timeLine;
22
-        coordargs.basedir = model.baseDir;
23
-        coordargs.sessionList = 1:3;
24
-        coordargs.eventList = classDef.eventMatrix;
25
-        coordargs.coords = parseCoordinateTextField(model);
26
-        coordargs.mask   = mask;
38
+        coordargs.subjects      = subjects;
39
+        coordargs.timeline      = timeLine;
40
+        coordargs.basedir       = model.baseDir;
41
+        coordargs.sessionList   = 1:3;
42
+        coordargs.eventList     = classDef.eventMatrix;
43
+        coordargs.coords        = parseCoordinateTextField(model);
44
+        coordargs.mask          = mask;
45
+        
46
+        out.subjectdata = runCoordTable(coordargs);
27 47
         
28
-        runCoordTable(coordargs)
48
+        assignin('base','preprocessedData',out);
29 49
         
30 50
     case 'ROI'
31 51
         disp('ROI');
32 52
         roiargs = struct;
33
-        roiargs.subjects    = subjects;
34
-        roiargs.timeline    = timeLine;
35
-        roiargs.classes     = classDef;
36
-        roiargs.mask        = mask;
37
-        roiargs.basedir     = model.baseDir;
38
-        roiargs.sessionList = 1:3;
39
-        roiargs.eventList   = classDef.eventMatrix;
53
+        roiargs.subjects        = subjects;
54
+        roiargs.timeline        = timeLine;
55
+        roiargs.classes         = classDef;
56
+        roiargs.mask            = mask;
57
+        roiargs.basedir         = model.baseDir;
58
+        roiargs.sessionList     = 1:3;
59
+        roiargs.eventList       = classDef.eventMatrix;
40 60
         
41 61
         runROIImageMaskMode(roiargs);
42 62
         
43 63
     case 'FBS'
44
-        disp('FBS')
45
-        
64
+        disp('not implemented')
65
+end
66
+end
67
+
68
+function decode(model,task)
69
+switch task
46 70
     case 'SVM'
47
-        disp('classify with svm');
71
+        disp('SVM');
72
+        svmopts    = getSvmArgs(model,1);
73
+        preprocessedData = evalin('base','preprocessedData');
74
+        calculateMultiSubjectDecodePerformance(preprocessedData.header,preprocessedData.subjectdata,svmopts);
75
+        
48 76
         
49 77
     case 'X-SVM'
78
+        disp('not implemented')
50 79
         
51 80
     case 'SOM'
81
+        disp('not implemented')
52 82
 
53 83
     case 'X-SOM'
84
+        disp('not implemented')
54 85
         
55 86
 end
56 87
 
Browse code

snapshot, classification

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@140 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Christoph Budziszewski authored on02/03/2009 18:28:41
Showing1 changed files
... ...
@@ -38,13 +38,20 @@ switch task
38 38
         roiargs.sessionList = 1:3;
39 39
         roiargs.eventList   = classDef.eventMatrix;
40 40
         
41
-        
42
-        assignin('base','roiargs',roiargs);
43
-        
44 41
         runROIImageMaskMode(roiargs);
45 42
         
46 43
     case 'FBS'
47 44
         disp('FBS')
45
+        
46
+    case 'SVM'
47
+        disp('classify with svm');
48
+        
49
+    case 'X-SVM'
50
+        
51
+    case 'SOM'
52
+
53
+    case 'X-SOM'
54
+        
48 55
 end
49 56
 
50 57
 % disp('warings restored');
Browse code

schwimmen.

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@139 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Christoph Budziszewski authored on25/02/2009 16:53:36
Showing1 changed files
... ...
@@ -2,6 +2,9 @@ function main(model,task)
2 2
 
3 3
 % parse the GUI and pass parameters as structure
4 4
 disp('RUN');
5
+% disp('all warnings OFF')
6
+% warn = warning('off','all');
7
+
5 8
 timeLine = getTimeLineParams(model);
6 9
 subjects = getSubjectCellList(model);
7 10
 classDef = parseClassDef(model);
... ...
@@ -44,6 +47,8 @@ switch task
44 47
         disp('FBS')
45 48
 end
46 49
 
50
+% disp('warings restored');
51
+% warning('on',warn);
47 52
 end
48 53
 
49 54
 
Browse code

coordTabel works for JZ006

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@138 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Christoph Budziszewski authored on25/02/2009 15:49:55
Showing1 changed files
... ...
@@ -5,23 +5,35 @@ disp('RUN');
5 5
 timeLine = getTimeLineParams(model);
6 6
 subjects = getSubjectCellList(model);
7 7
 classDef = parseClassDef(model);
8
+
9
+mask     = ['^' cell2mat(getImageFileMask(model)) '.*\.img$'];
8 10
 % images
9 11
 % normalization
10 12
 
11 13
 switch task
12 14
     case 'COORD'
13 15
         disp('COORD');
14
-        coordinates= 'parse me';
15
-        runCoordTable()
16
+        coordargs = struct;
17
+        coordargs.subjects = subjects;
18
+        coordargs.timeline = timeLine;
19
+        coordargs.basedir = model.baseDir;
20
+        coordargs.sessionList = 1:3;
21
+        coordargs.eventList = classDef.eventMatrix;
22
+        coordargs.coords = parseCoordinateTextField(model);
23
+        coordargs.mask   = mask;
24
+        
25
+        runCoordTable(coordargs)
16 26
         
17 27
     case 'ROI'
18 28
         disp('ROI');
19 29
         roiargs = struct;
20
-        roiargs.subjects = subjects;
21
-        roiargs.timeline = timeLine;
22
-        roiargs.classes  = classDef;
23
-        roiargs.mask     = getImageFileMask(model);
24
-        roiargs.basedir  = model.baseDir;
30
+        roiargs.subjects    = subjects;
31
+        roiargs.timeline    = timeLine;
32
+        roiargs.classes     = classDef;
33
+        roiargs.mask        = mask;
34
+        roiargs.basedir     = model.baseDir;
35
+        roiargs.sessionList = 1:3;
36
+        roiargs.eventList   = classDef.eventMatrix;
25 37
         
26 38
         
27 39
         assignin('base','roiargs',roiargs);
Browse code

roi image working

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@137 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Christoph Budziszewski authored on25/02/2009 13:40:40
Showing1 changed files
... ...
@@ -8,58 +8,32 @@ classDef = parseClassDef(model);
8 8
 % images
9 9
 % normalization
10 10
 
11
-
12
-
13 11
 switch task
14 12
     case 'COORD'
15 13
         disp('COORD');
16 14
         coordinates= 'parse me';
17 15
         runCoordTable()
16
+        
18 17
     case 'ROI'
19 18
         disp('ROI');
20
-        runROIImageMaskMode(subjects,timeLine)
19
+        roiargs = struct;
20
+        roiargs.subjects = subjects;
21
+        roiargs.timeline = timeLine;
22
+        roiargs.classes  = classDef;
23
+        roiargs.mask     = getImageFileMask(model);
24
+        roiargs.basedir  = model.baseDir;
25
+        
26
+        
27
+        assignin('base','roiargs',roiargs);
28
+        
29
+        runROIImageMaskMode(roiargs);
30
+        
21 31
     case 'FBS'
22 32
         disp('FBS')
23 33
 end
24 34
 
25
-return
26
-
27
-timeline = getTimeLineParams(parameterModel);
28
-switch action
29
-    case 'COORD-LOOKUP-TABLE'
30
-        runCoordTable(timeline,parameterModel);
31
-    case 'ROI-IMAGE-MASK'
32
-        runROIImageMaskMode(timeline,parameterModel);
33
-        disp('DONE');
34
-    case 'FULL-BRAIN'
35
-        error('SVMCrossVal:main:notImplemented','Feature not yet implemented');
36
-    otherwise 
37
-        error('SVMCrossVal:main:actionError','Wrong ''action''. Use the GUI.');
38 35
 end
39
-end
40
-
41 36
 
42 37
 
43 38
 
44 39
 
45
-
46
-function calculateParams = parseCalculateParams(paramModel)
47
-calculateParams  = struct;
48
-calculateParams.smoothed        = getChkValue(paramModel.chkSmoothed);
49
-calculateParams.svmargs         = get(paramModel.txtSVMopts,'String');
50
-calculateParams.sessionList     = 1:3;
51
-
52
-calculateParams.CROSSVAL_METHOD      = CROSSVAL_METHOD_DEF.svmcrossval;
53
-calculateParams.VOXEL_SELECTION_MODE = VOXEL_SELECTION_MODE_DEF.roiImage;
54
-calculateParams.PROJECT_BASE_PATH    = PROJECT_BASE_PATH;
55
-calculateParams.PROJECT_RESULT_PATH  = PROJECT_RESULT_PATH;
56
-calculateParams.RANDOMIZE       = 0;
57
-
58
-classStruct = parseClassDef(paramModel);
59
-calculateParams.labelMap        = LabelMap(classStruct.labelCells , classStruct.conditionCells, 'auto'); % LabelMap({'<','>','<+<','>+>','<+>','>+<'},{-2,-1,1,2,3,4}); 0 is autolabel
60
-calculateParams.classList       = getClasses(calculateParams.labelMap);
61
-calculateParams.eventList       = classStruct.eventMatrix; %[9,11,13; 10,12,14];
62
-calculateParams.subjectSelection = subjectSelection;
63
- 
64
-% assignin('base','calculateParams',calculateParams);
65
-end
Browse code

zwischenspiecher

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@136 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Christoph Budziszewski authored on25/02/2009 02:24:48
Showing1 changed files
... ...
@@ -13,7 +13,7 @@ classDef = parseClassDef(model);
13 13
 switch task
14 14
     case 'COORD'
15 15
         disp('COORD');
16
-        coordinates= 'parse me'
16
+        coordinates= 'parse me';
17 17
         runCoordTable()
18 18
     case 'ROI'
19 19
         disp('ROI');
Browse code

zwischenspeicherung

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@135 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Christoph Budziszewski authored on18/02/2009 18:24:30
Showing1 changed files
... ...
@@ -1,4 +1,29 @@
1
-function main(action,parameterModel)
1
+function main(model,task)
2
+
3
+% parse the GUI and pass parameters as structure
4
+disp('RUN');
5
+timeLine = getTimeLineParams(model);
6
+subjects = getSubjectCellList(model);
7
+classDef = parseClassDef(model);
8
+% images
9
+% normalization
10
+
11
+
12
+
13
+switch task
14
+    case 'COORD'
15
+        disp('COORD');
16
+        coordinates= 'parse me'
17
+        runCoordTable()
18
+    case 'ROI'
19
+        disp('ROI');
20
+        runROIImageMaskMode(subjects,timeLine)
21
+    case 'FBS'
22
+        disp('FBS')
23
+end
24
+
25
+return
26
+
2 27
 timeline = getTimeLineParams(parameterModel);
3 28
 switch action
4 29
     case 'COORD-LOOKUP-TABLE'
Browse code

started save/load functionality.

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@132 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Christoph Budziszewski authored on18/02/2009 15:59:39
Showing1 changed files
... ...
@@ -15,18 +15,6 @@ end
15 15
 
16 16
 
17 17
 
18
-% generate parameter structs for subroutines
19
-function timelineParams = getTimeLineParams(paramModel)
20
-timelineParams = struct;
21
-timelineParams.frameShiftStart = getDouble(paramModel.txtFrameShiftStart);  % -20;
22
-timelineParams.frameShiftEnd   = getDouble(paramModel.txtFrameShiftEnd); %15;
23
-timelineParams.decodeDuration  = getDouble(paramModel.txtFrameShiftDur);
24
-timelineParams.psthStart       = getDouble(paramModel.txtPSTHStart); % -25;
25
-timelineParams.psthEnd         = getDouble(paramModel.txtPSTHEnd); % 20;
26
-timelineParams.baselineStart   = getDouble(paramModel.txtBaselineStart); % -22;
27
-timelineParams.baselineEnd     = getDouble(paramModel.txtBaselineEnd); % -20;
28
-
29
-end
30 18
 
31 19
 
32 20
 
Browse code

new parseVoxelTxtField getImageFileList reads files according to gui-settings voxel to subject coordinate mapping missing.

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@131 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Christoph Budziszewski authored on16/02/2009 17:32:42
Showing1 changed files
... ...
@@ -28,6 +28,8 @@ timelineParams.baselineEnd     = getDouble(paramModel.txtBaselineEnd); % -20;
28 28
 
29 29
 end
30 30
 
31
+
32
+
31 33
 function calculateParams = parseCalculateParams(paramModel)
32 34
 calculateParams  = struct;
33 35
 calculateParams.smoothed        = getChkValue(paramModel.chkSmoothed);
Browse code

subject list from filesystem, image mask list from filesystem

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@130 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Christoph Budziszewski authored on13/02/2009 14:57:00
Showing1 changed files
... ...
@@ -4,7 +4,7 @@ switch action
4 4
     case 'COORD-LOOKUP-TABLE'
5 5
         runCoordTable(timeline,parameterModel);
6 6
     case 'ROI-IMAGE-MASK'
7
-        runROIImageMaskMode(parameterModel);
7
+        runROIImageMaskMode(timeline,parameterModel);
8 8
         disp('DONE');
9 9
     case 'FULL-BRAIN'
10 10
         error('SVMCrossVal:main:notImplemented','Feature not yet implemented');
Browse code

moved things

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@127 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Christoph Budziszewski authored on09/02/2009 16:44:50
Showing1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,50 @@
1
+function main(action,parameterModel)
2
+timeline = getTimeLineParams(parameterModel);
3
+switch action
4
+    case 'COORD-LOOKUP-TABLE'
5
+        runCoordTable(timeline,parameterModel);
6
+    case 'ROI-IMAGE-MASK'
7
+        runROIImageMaskMode(parameterModel);
8
+        disp('DONE');
9
+    case 'FULL-BRAIN'
10
+        error('SVMCrossVal:main:notImplemented','Feature not yet implemented');
11
+    otherwise 
12
+        error('SVMCrossVal:main:actionError','Wrong ''action''. Use the GUI.');
13
+end
14
+end
15
+
16
+
17
+
18
+% generate parameter structs for subroutines
19
+function timelineParams = getTimeLineParams(paramModel)
20
+timelineParams = struct;
21
+timelineParams.frameShiftStart = getDouble(paramModel.txtFrameShiftStart);  % -20;
22
+timelineParams.frameShiftEnd   = getDouble(paramModel.txtFrameShiftEnd); %15;
23
+timelineParams.decodeDuration  = getDouble(paramModel.txtFrameShiftDur);
24
+timelineParams.psthStart       = getDouble(paramModel.txtPSTHStart); % -25;
25
+timelineParams.psthEnd         = getDouble(paramModel.txtPSTHEnd); % 20;
26
+timelineParams.baselineStart   = getDouble(paramModel.txtBaselineStart); % -22;
27
+timelineParams.baselineEnd     = getDouble(paramModel.txtBaselineEnd); % -20;
28
+
29
+end
30
+
31
+function calculateParams = parseCalculateParams(paramModel)
32
+calculateParams  = struct;
33
+calculateParams.smoothed        = getChkValue(paramModel.chkSmoothed);
34
+calculateParams.svmargs         = get(paramModel.txtSVMopts,'String');
35
+calculateParams.sessionList     = 1:3;
36
+
37
+calculateParams.CROSSVAL_METHOD      = CROSSVAL_METHOD_DEF.svmcrossval;
38
+calculateParams.VOXEL_SELECTION_MODE = VOXEL_SELECTION_MODE_DEF.roiImage;
39
+calculateParams.PROJECT_BASE_PATH    = PROJECT_BASE_PATH;
40
+calculateParams.PROJECT_RESULT_PATH  = PROJECT_RESULT_PATH;
41
+calculateParams.RANDOMIZE       = 0;
42
+
43
+classStruct = parseClassDef(paramModel);
44
+calculateParams.labelMap        = LabelMap(classStruct.labelCells , classStruct.conditionCells, 'auto'); % LabelMap({'<','>','<+<','>+>','<+>','>+<'},{-2,-1,1,2,3,4}); 0 is autolabel
45
+calculateParams.classList       = getClasses(calculateParams.labelMap);
46
+calculateParams.eventList       = classStruct.eventMatrix; %[9,11,13; 10,12,14];
47
+calculateParams.subjectSelection = subjectSelection;
48
+ 
49
+% assignin('base','calculateParams',calculateParams);
50
+end