I have 2 images A.nii and B.nii that are co-registered to each other.
I took image A.nii, along with many others, and realigned them to another image ref.nii using SPM's "Realign: Estimate & Reslice" module, which gives rref.nii, rA.nii, ...etc.
Now what I want to do is reapply the transformation done by the realignment module to image B.nii.
I though I could extract the transformation matrix using spm_get_space and spm_imatrix, like this:
MF = spm_get_space('A.nii');
MG = spm_get_space('rA.nii');
MR = MF/MG;
params = spm_imatrix(MR);
I then used the params variable to attempt to realign B.nii using SPM's "Reorient Images" module, but the resulting image was not in alignment with rA.nii.
How can I realign image B.nii to be in alignment with image rA.nii?
*I can't realign/co-register image B.nii directly to rA.nii because they are fundamentally incompatible; A.nii was actually an ROI image created out of B.nii.
|