Hi Joe,
> I have two data sets which I can use SPM to register one to the other.
> Here comes the question: can I possibly convert (register) say a voxel
> of coordinate (x,y,z) at floating volume to (x',y',z') on the space of the
> reference space?
You can. How easily depends on how you registered them. If they are
just rigidly or affinely registered (e.g. with realign, or coreg,)
then the matrices in the vol.mat fields (after mapping the images with
spm_vol) relate the coordinate systems quite simply.
E.g. something like:
xyz1 = [x y z 1]'; % -- voxel (homogeneous) coords, image 1
XYZ1 = vol1.mat*[xyz1 1];
% -- world coords (in both *registered* images)
xyz2 = vol2.mat\XYZ1; % voxel coords, image 2
If you've used non-linear normalisation, or SPM5's unified
segmentation and normalisation, then the easiest way appears to be to
convert the sn.mat (or inv_sn.mat, check the first post below
carefully to be sure which you want) into a deformation field, and
then read the voxels from this, see the following:
http://www.jiscmail.ac.uk/cgi-bin/webadmin?A2=ind0702&L=SPM&P=R47018
and the parts of this which are relevant for reading from the
deformation field, after you have read the above,
http://www.jiscmail.ac.uk/cgi-bin/webadmin?A2=ind0702&L=SPM&P=36372
Best,
Ged.
|