17f70357421117c1a176c18c9e7f87357115ee9e
Christoph Budziszewski radius backend working

Christoph Budziszewski authored 15 years ago

1) function [extr voxelcount] = calculateImageData(filenameList, voxelList, rad)
2) voxelcount = 0;
Christoph Budziszewski kleine änderungen code move

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

9) 
Christoph Budziszewski enabled radius. but does no...

Christoph Budziszewski authored 15 years ago

10) % rad = 0;
Christoph Budziszewski schwimmen.

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

17) 
Christoph Budziszewski radius backend working

Christoph Budziszewski authored 15 years ago

18)     tmp = spm_imatrix(V(kImage).mat);
19)     vdim = tmp(7:9);
20)     vxrad = ceil((rad*ones(nVoxel,3))./(ones(nVoxel,1)*vdim))';
Christoph Budziszewski kleine änderungen code move

Christoph Budziszewski authored 15 years ago

21) 
Christoph Budziszewski radius backend working

Christoph Budziszewski authored 15 years ago

22)     subvoxelcount = 0;
Christoph Budziszewski coordTabel works for JZ006

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

24) 
Christoph Budziszewski coordTabel works for JZ006

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

26)             x = roicenter(1,iVoxel);
27)             y = roicenter(2,iVoxel);
28)             z = roicenter(3,iVoxel);
Christoph Budziszewski coordTabel works for JZ006

Christoph Budziszewski authored 15 years ago

29)         else
30)             [x y z] = ndgrid(-vxrad(1,iVoxel):sign(vdim(1)):vxrad(1,iVoxel), ...
31)                 -vxrad(2,iVoxel):sign(vdim(2)):vxrad(2,iVoxel), ...
32)                 -vxrad(3,iVoxel):sign(vdim(3)):vxrad(3,iVoxel));
33)             sel = (x./vxrad(1,iVoxel)).^2 + (y./vxrad(2,iVoxel)).^2 + ...
34)                 (z./vxrad(3,iVoxel)).^2 <= 1;
35)             x = roicenter(1,iVoxel)+x(sel(:));
36)             y = roicenter(2,iVoxel)+y(sel(:));
37)             z = roicenter(3,iVoxel)+z(sel(:));
38)         end;
39) 
40)         dat = spm_sample_vol(V(kImage), x, y, z,0);
Christoph Budziszewski radius bug fast behoben.

Christoph Budziszewski authored 15 years ago

41)         
Christoph Budziszewski radius backend working

Christoph Budziszewski authored 15 years ago

42)         for iSubVoxel = 1:size(dat,1)
43)             subvoxelcount = subvoxelcount +1;
44)             extr(kImage).dat(subvoxelcount)    = dat(iSubVoxel);
45)         end
46) %         extr(kImage).mean(iVoxel)     = nanmean(dat);
47) %         extr(kImage).nvx(iVoxel)      = numel(dat);
48)     end
49)     voxelcount = max(voxelcount,subvoxelcount);
50) end   
Christoph Budziszewski git-svn-id: https://svn.dis...

Christoph Budziszewski authored 15 years ago

51)