To register two images of the same subject, the objective is to be able
to map from voxels in one image to voxels in the other. Doing this
requires the "voxel to world" matrices in the headers. So, to go from
image 1 (whos voxel-to-world mapping is M1) to image 2 (whose mapping is
M2), you would need to:
1) Map from voxels in image 1 to world space (multiply by M1)
2) Rotate and translate this world space into alignment with the world
space of image 2 (multiply by R)
3) Map from this world space back to voxels in image 2 (multiply by the
inverse of M2).
So the overall matrix is: M2\R*M1
And the mapping from voxels in image 2 to those in image 1 is:
The six parameters computed by spm_coreg are as described in
spm_matrix.m . They paramaterise R (or its inverse). Going back from a
matrix R to the parameters can be done by spm_imatrix.
On Fri, 2010-05-21 at 13:42 +0100, Dan Golding wrote:
> I would like to find the 12 parameters for an affine transformation between two nifti images. I have been looking into using spm_coreg and spm_matrix but I couldn't quite understand how to use them form their help. spm_coreg outputs 6 parameters, I'm not sure what these 6 are?
> Also is there a function that does the reverse of spm_matrix, i.e. one that can take an affine transformation matrix and split it into 3 rotations, 3 scalings etc...?
John Ashburner <[log in to unmask]>