| I have used spm to segment structural scans without normalizing them. I
| understand that spm performs some form of normalization in performing this
| segmentation and then renormalizes the scans back to the original.
It estimates an affine transformation that can map from each voxel in the
image to the approximately equivalent position in the prior probability images.
|
| Is there any straightforward way to get hold of the AC-PC positions
| approximately and return the segmented brain and the original/copy of the
| original/corrected original oriented in a plain perpendicular to the
| approximate AC-PC line?
If I understand correctly, there is no good easy way of doing it with the existing
code. If you don't mind having zooms and stretches in your images, then you can
spatially normalise them by estimating the optimum affine transformation.
Alternatively, you may want to try a rigid body registration between the image
and a template image, but this may not work as well as you hope though.
With a bit of thought and programming, it is possible to extract an optimal
rigid body mapping from an affine transformation (from spatial normalisation).
The best that I can suggest is you try manually reorienting your images via the
<Display> button. Try different rotations and translations until the image is
displayed how you want it. The attached Matlab function can then be used for
reslicing the image(s) 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;
|