7a4d366647d777ab28ae3142cf229323d1098420
Christoph Budziszewski git-svn-id: https://svn.dis...

Christoph Budziszewski authored 15 years ago

1) function extr = calculateImageData(filenameList, voxelList)
Christoph Budziszewski kleine änderungen code move

Christoph Budziszewski authored 15 years ago

2) 
Christoph Budziszewski refactored to arg-structs!...

Christoph Budziszewski authored 15 years ago

3) V = filenameList;
Christoph Budziszewski kleine änderungen code move

Christoph Budziszewski authored 15 years ago

4) 
5) vox = voxelList;
Christoph Budziszewski refactored to arg-structs!...

Christoph Budziszewski authored 15 years ago

6) nVoxel = size(vox,1);
7) nImage = numel(V);
Christoph Budziszewski kleine änderungen code move

Christoph Budziszewski authored 15 years ago

8) 
Christoph Budziszewski schwimmen.

Christoph Budziszewski authored 15 years ago

9) rad = 0;
10) 
Christoph Budziszewski refactored to arg-structs!...

Christoph Budziszewski authored 15 years ago

11) for kImage=1:nImage
Christoph Budziszewski coordTabel works for JZ006

Christoph Budziszewski authored 15 years ago

12)     roicenter = round(inv(V(kImage).mat)*[vox, ones(nVoxel,1)]');
13)     x = roicenter(1,:);
14)     y = roicenter(2,:);
15)     z = roicenter(3,:);
Christoph Budziszewski kleine änderungen code move

Christoph Budziszewski authored 15 years ago

16) 
17) 
Christoph Budziszewski coordTabel works for JZ006

Christoph Budziszewski authored 15 years ago

18)     for iVoxel = 1:nVoxel
Christoph Budziszewski heavy CrossVal Toolbox deve...

Christoph Budziszewski authored 15 years ago

19) 
Christoph Budziszewski coordTabel works for JZ006

Christoph Budziszewski authored 15 years ago

20)         if rad==0
Christoph Budziszewski git-svn-id: https://svn.dis...

Christoph Budziszewski authored 15 years ago

21)             x = roicenter(1,iVoxel);
22)             y = roicenter(2,iVoxel);
23)             z = roicenter(3,iVoxel);
Christoph Budziszewski coordTabel works for JZ006

Christoph Budziszewski authored 15 years ago

24)         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)             [x y z] = ndgrid(-vxrad(1,iVoxel):sign(vdim(1)):vxrad(1,iVoxel), ...
29)                 -vxrad(2,iVoxel):sign(vdim(2)):vxrad(2,iVoxel), ...
30)                 -vxrad(3,iVoxel):sign(vdim(3)):vxrad(3,iVoxel));
31)             sel = (x./vxrad(1,iVoxel)).^2 + (y./vxrad(2,iVoxel)).^2 + ...
32)                 (z./vxrad(3,iVoxel)).^2 <= 1;
33)             x = roicenter(1,iVoxel)+x(sel(:));
34)             y = roicenter(2,iVoxel)+y(sel(:));
35)             z = roicenter(3,iVoxel)+z(sel(:));
36)         end;
37) 
38) 
39)         dat = spm_sample_vol(V(kImage), x, y, z,0);
Christoph Budziszewski git-svn-id: https://svn.dis...

Christoph Budziszewski authored 15 years ago

40)         extr(kImage).dat(iVoxel)      = dat;
Christoph Budziszewski coordTabel works for JZ006

Christoph Budziszewski authored 15 years ago

41)         extr(kImage).mean(iVoxel)     = nanmean(dat);
Christoph Budziszewski git-svn-id: https://svn.dis...

Christoph Budziszewski authored 15 years ago

42)         extr(kImage).nvx(iVoxel)      = numel(dat);
Christoph Budziszewski coordTabel works for JZ006

Christoph Budziszewski authored 15 years ago

43)     end;
Christoph Budziszewski git-svn-id: https://svn.dis...

Christoph Budziszewski authored 15 years ago

44) 
45) end;