Browse code

debugging

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

Christoph Budziszewski authored on 26/04/2009 18:27:56
Showing 4 changed files
... ...
@@ -40,6 +40,7 @@ for kImage=1:nImage
40 40
             x = roicenter(1,iVoxel)+x(sel(:));
41 41
             y = roicenter(2,iVoxel)+y(sel(:));
42 42
             z = roicenter(3,iVoxel)+z(sel(:));
43
+            [x y z]
43 44
         end;
44 45
 
45 46
         dat = spm_sample_vol(V(kImage), x, y, z,0);
... ...
@@ -1,4 +1,9 @@
1 1
 function sphere = fbs_buildSphere(mapping,center,radius,vdim)
2
+if radius == 0
3
+    sphere = center;
4
+    return
5
+end
6
+
2 7
 iVoxel = 1;
3 8
 % returns the IDs within Sphere
4 9
 coord = mapping.indexToCoordMap.get(center);
... ...
@@ -60,7 +60,7 @@ for s = 1:nSubjects
60 60
     indexToCoordMap = java.util.HashMap;
61 61
     coordToIndexMap = java.util.HashMap;
62 62
     for iVoxel = 1:nVoxel
63
-        coord = [x(iVoxel) y(iVoxel) z(iVoxel)];
63
+        coord = [x(iVoxel) y(iVoxel) z(iVoxel)]
64 64
         a = java.util.Vector(3,0);
65 65
         a.add(0,coord(1));
66 66
         a.add(1,coord(2));
... ...
@@ -131,9 +131,10 @@ for s = 1:nSubjects
131 131
     nSamplePoints = ((timeLineEnd-timeLineStart)/res) +1;
132 132
 
133 133
 if isempty( fbsargs.timeline )
134
-	fbsTimeLine = 1:nSamplePoints
134
+	fbsTimeLine = 1:nSamplePoints;
135
+    fbsTimeLine = fbsTimeLine +globalStart;
135 136
 else 
136
-	fbsTimeLine = fbsargs.timeline
137
+	fbsTimeLine = fbsargs.timeline;
137 138
 end
138 139
 
139 140
 
... ...
@@ -152,6 +153,7 @@ end
152 153
             end
153 154
             % get surrounding coordinate-IDs within radius
154 155
             sphere = fbs_buildSphere(mapping,iVoxel,radius,vdim);
156
+%             pause
155 157
 
156 158
             %build svm inputmatrix
157 159
             svmdata = [];
... ...
@@ -169,6 +171,7 @@ end
169 171
             end
170 172
 
171 173
             if RANDOMIZE_DATAPOINTS
174
+%                 [svmlabel svmdata]
172 175
                 rndindex  = randperm(length(svmlabel));
173 176
                 svmdata   = svmdata(rndindex,:);
174 177
                 svmlabel  = svmlabel(rndindex);
... ...
@@ -177,7 +180,7 @@ end
177 180
             decode = svm_single_crossval(svmlabel,svmdata,svmopts);
178 181
             % save the decode value to the corresponding coordinate
179 182
 
180
-            coord= mapping.indexToCoordMap.get(iVoxel);
183
+            coord = mapping.indexToCoordMap.get(iVoxel)
181 184
             x = coord(1);
182 185
             y = coord(2);
183 186
             z = coord(3);
... ...
@@ -32,7 +32,7 @@ for s = 1:nSubjects
32 32
 
33 33
     disp('computing volume values, please wait');
34 34
     
35
-    extr = calculateRoiImageData(subjectStruct{s}.volumes,subjectStruct{s}.roiFile);
35
+    [extr x y z] = calculateRoiImageData(subjectStruct{s}.volumes,subjectStruct{s}.roiFile);
36 36
     
37 37
     nVoxel = size(extr(1).dat,1);
38 38
 
... ...
@@ -41,6 +41,7 @@ for s = 1:nSubjects
41 41
 
42 42
     disp('computing psth');
43 43
     for iVoxel = 1:nVoxel
44
+        [ x(iVoxel) y(iVoxel) z(iVoxel)]
44 45
         rawdata = [];
45 46
         for iImage = 1:length(extr);
46 47
             tmp = extr(iImage);