radius bug fast behoben.
Christoph Budziszewski

Christoph Budziszewski commited on 2009-03-17 14:50:47
Zeige 2 geänderte Dateien mit 7 Einfügungen und 5 Löschungen.


git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@160 83ab2cfd-5345-466c-8aeb-2b2739fb922d
... ...
@@ -14,6 +14,9 @@ for kImage=1:nImage
14 14
     y = roicenter(2,:);
15 15
     z = roicenter(3,:);
16 16
 
17
+            tmp = spm_imatrix(V(kImage).mat);
18
+            vdim = tmp(7:9);
19
+            vxrad = ceil((rad*ones(nVoxel,3))./(ones(nVoxel,1)*vdim))';
17 20
 
18 21
     for iVoxel = 1:nVoxel
19 22
 
... ...
@@ -22,9 +25,6 @@ for kImage=1:nImage
22 25
             y = roicenter(2,iVoxel);
23 26
             z = roicenter(3,iVoxel);
24 27
         else
25
-            tmp = spm_imatrix(V(kImage).mat);
26
-            vdim = tmp(7:9);
27
-            vxrad = ceil((rad*ones(1,3))./(ones(nVoxel,1)*vdim))';
28 28
             [x y z] = ndgrid(-vxrad(1,iVoxel):sign(vdim(1)):vxrad(1,iVoxel), ...
29 29
                 -vxrad(2,iVoxel):sign(vdim(2)):vxrad(2,iVoxel), ...
30 30
                 -vxrad(3,iVoxel):sign(vdim(3)):vxrad(3,iVoxel));
... ...
@@ -37,7 +37,8 @@ for kImage=1:nImage
37 37
 
38 38
 
39 39
         dat = spm_sample_vol(V(kImage), x, y, z,0);
40
-        extr(kImage).dat(iVoxel)      = dat;
40
+        
41
+        extr(kImage).dat(iVoxel,:)    = dat;
41 42
         extr(kImage).mean(iVoxel)     = nanmean(dat);
42 43
         extr(kImage).nvx(iVoxel)      = numel(dat);
43 44
     end;
... ...
@@ -37,8 +37,9 @@ function subjectData = runCoordTable(args)
37 37
             rawdata = [];
38 38
             for iImage = 1:length(extr);
39 39
                 tmp = extr(iImage);
40
-                rawdata = [rawdata tmp.dat(iVoxel)];
40
+                rawdata = [rawdata tmp.dat(iVoxel,:)];
41 41
             end
42
+            subjectStruct{s}.rawData{iVoxel} = rawdata;
42 43
             subjectStruct{s}.pst{iVoxel} = calculatePST(args.timeline,pstopts,rawdata);
43 44
         end
44 45
        disp(sprintf('done %g / %g',s,nSubjects));
45 46