5c481dda2a46829fb76340a34e881f9b868e9024
Christoph Budziszewski radius frontend enabled, fi...

Christoph Budziszewski authored 15 years ago

1) function [extr voxelcount] = calculateImageData(filenameList, coordlist)
2) 
3) vox = [];
4) % radius = [];
5) nCoords = size(coordlist,1);
6) for iCoord = 1:nCoords
7)    vox = [vox ; coordlist(iCoord).coord];
8) %    radius = [radius , coordlist(iCoord).rad];
9) end
10) 
Christoph Budziszewski radius backend working

Christoph Budziszewski authored 15 years ago

11) voxelcount = 0;
Christoph Budziszewski kleine änderungen code move

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

13) V = filenameList;
14) nImage = numel(V);
Christoph Budziszewski radius frontend enabled, fi...

Christoph Budziszewski authored 15 years ago

15) nVoxel = nCoords;
Christoph Budziszewski refactored to arg-structs!...

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

17)     roicenter = round(inv(V(kImage).mat)*[vox, ones(nVoxel,1)]');
Christoph Budziszewski radius frontend enabled, fi...

Christoph Budziszewski authored 15 years ago

18) %     x = roicenter(1,:);
19) %     y = roicenter(2,:);
20) %     z = roicenter(3,:);
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 radius frontend enabled, fi...

Christoph Budziszewski authored 15 years ago

25)         rad = coordlist(iVoxel).rad;
26)         tmp = spm_imatrix(V(kImage).mat);
27)         vdim = tmp(7:9);
28)         vxrad = ceil((rad*ones(nVoxel,3))./(ones(nVoxel,1)*vdim))';
29)         
Christoph Budziszewski coordTabel works for JZ006

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

31)             x = roicenter(1,iVoxel);
32)             y = roicenter(2,iVoxel);
33)             z = roicenter(3,iVoxel);
Christoph Budziszewski coordTabel works for JZ006

Christoph Budziszewski authored 15 years ago

34)         else
35)             [x y z] = ndgrid(-vxrad(1,iVoxel):sign(vdim(1)):vxrad(1,iVoxel), ...
36)                 -vxrad(2,iVoxel):sign(vdim(2)):vxrad(2,iVoxel), ...
37)                 -vxrad(3,iVoxel):sign(vdim(3)):vxrad(3,iVoxel));
38)             sel = (x./vxrad(1,iVoxel)).^2 + (y./vxrad(2,iVoxel)).^2 + ...
39)                 (z./vxrad(3,iVoxel)).^2 <= 1;
40)             x = roicenter(1,iVoxel)+x(sel(:));
41)             y = roicenter(2,iVoxel)+y(sel(:));
42)             z = roicenter(3,iVoxel)+z(sel(:));
Christoph Budziszewski debugging

Christoph Budziszewski authored 14 years ago

43)             [x y z]
Christoph Budziszewski coordTabel works for JZ006

Christoph Budziszewski authored 15 years ago

44)         end;
45) 
46)         dat = spm_sample_vol(V(kImage), x, y, z,0);
Christoph Budziszewski radius bug fast behoben.

Christoph Budziszewski authored 15 years ago

47)         
Christoph Budziszewski radius backend working

Christoph Budziszewski authored 15 years ago

48)         for iSubVoxel = 1:size(dat,1)
49)             subvoxelcount = subvoxelcount +1;
50)             extr(kImage).dat(subvoxelcount)    = dat(iSubVoxel);
51)         end
52) %         extr(kImage).mean(iVoxel)     = nanmean(dat);
53) %         extr(kImage).nvx(iVoxel)      = numel(dat);
54)     end
55)     voxelcount = max(voxelcount,subvoxelcount);
56) end   
Christoph Budziszewski git-svn-id: https://svn.dis...

Christoph Budziszewski authored 15 years ago

57)