| In SPM96 "Defaults" allowed performance of spatial normalisation choosing
| the number of parameters. As far as I can see this has gone in SPM99. In a
| clinical setting it is not appropriate to warp or distort the anatomy that
| the neurosurgeon subsequently will operate on. On the other hand it is
| useful to approximately reorient all images to a standard line of
| presentation using a 6 parameter fit to a template, which on the same time
| places an approximate origin.
| The align procedure could be used, but the parameters would need to be
| copied or renamed.
It sounds like you should be using the coregister option rather than spatial
normalisation. The rigid body transformation parameters can be extracted
from the .mat file that is either created or modified by the coregistration
routine. Alternatively, you could use the Display option to manually
reorient your images. The attached file would allow you to write
reoriented images in the transverse orientation with 1mm isotropic
resolution.
Best regards,
-John
function reorient(PP)
% Re-orient images
% The function reslices the input images to a resolution of 1mm.
% Output images (with the prefix "r") are written in the transverse
% orientation (using information from the ".mat" files).
%_______________________________________________________________________
% %W% John Ashburner %E%
if nargin<1, PP = spm_get(Inf,'*.img','Select file to reorient'); end;
VV = spm_vol(PP);
for V=VV',
d = V.dim(1:3);
c = [ 1 1 1 1
1 1 d(3) 1
1 d(2) 1 1
1 d(2) 1 1
d(1) 1 1 1
d(1) 1 d(3) 1
d(1) d(2) 1 1
d(1) d(2) 1 1]';
tc = V.mat(1:3,1:4)*c;
mx = round(max(tc,[],2)');
mn = round(min(tc,[],2)');
mat = spm_matrix([mn-1]);
dim = (mat\[mx 1]')';
VO = V;
[lpath,name,ext] = fileparts(V.fname);
VO.fname = fullfile(lpath,['r' name ext]);
VO.dim(1:3) = dim(1:3);
VO.mat = mat;
spm_progress_bar('Init',dim(3),'reslicing...','planes completed');
VO = spm_create_image(VO);
for i=1:dim(3),
M = inv(spm_matrix([0 0 -i])*inv(VO.mat)*V.mat);
img = spm_slice_vol(V,M,dim(1:2),1);
spm_write_plane(VO,img,i);
spm_progress_bar('Set',i)
end;
spm_progress_bar('Clear');
end;
return;
|