There are a number of matrices that can be displayed here in order to
represent the affine mapping. I can't remember what I actually used for this
display, but if you really want to know, then you can look around line 331 of
spm_coreg.m.
Q = inv(VF.mat\spm_matrix(x(:)')*VG.mat);
text(0,0.5, sprintf('X1 = %0.3f*X %+0.3f*Y %+0.3f*Z
%+0.3f',Q(1,:)),'Parent',ax);
text(0,0.3, sprintf('Y1 = %0.3f*X %+0.3f*Y %+0.3f*Z
%+0.3f',Q(2,:)),'Parent',ax);
text(0,0.1, sprintf('Z1 = %0.3f*X %+0.3f*Y %+0.3f*Z
%+0.3f',Q(3,:)),'Parent',ax);
VG.mat is the voxel-to-world mapping of the reference image. VF.mat is the
voxel-to-world mapping of the moved image, and x are the estimated
parameters.
Best regards,
-John
On Tuesday 03 January 2006 11:36, Wardak, Mirwais wrote:
> Dear SPMers,
>
>
>
> I co-registered a PET image with an MR image using the "Co-register and
> Reslice" function on SPM2. As a result, I got a PET.mat file along with my
> resliced aligned PET image. I also received a figure titled "normalized
> mutual information coregistration" that had the following formulas written
> down:
>
>
>
> x1=c1*x-c2*y-c3*z+K1
>
> y1=c4*x+c5*y-c6*z+K2
>
> z1=c7*x+c8*y+c9*z-K3
>
>
>
> (where c1-c9 and K1-K3 are constants)
>
>
>
> I know that SPM takes an image from "Voxel Space" to "World Space/SPM
> defined space" by using the .mat file. The .mat file being a 4X4
> transformation matrix. In other words, from my understanding, SPM takes a
> voxel location indexed at coordinates (x0,y0,z0) on my PET image and
> applies the matrix file to register it into world space (i.e., our aligned
> space of the MR and PET image).
>
>
>
> M=our 4X4 transformation matrix as defined by our .mat file and V=[x0, y0,
> z0]
>
>
>
> Let's say in this case, M=[d1, d2, d3, d4; d5, d6, d7, d8; d9, d10, d11,
> d12; 0, 0, 0,1], where d1-d11 are values determined by the computational
> mathematics behind SPM in aligning my source PET with my target MR.
>
>
>
> Our world space now equals:
>
>
>
> W=M*[V';1], where V' is the transpose of V and [V';1] is a 4X1 matrix.
> This can also be shown as:
>
>
>
> [x1;y1;z1;1] = W= M*[x0;y0;z0;1]
>
>
>
> W vector, in this case, will equal a 4X1 matrix that holds the coordinates,
> [x1;y1;z1;1], in world space/SPM defined space. Thus, we have transformed
> our original voxel coordinates, (x0, y0, z0) into our new aligned space
> with coordinates (x1, y1, z1).
>
>
>
> Now, here is where I am confused. Why are the constants in the formulas
> written in my "normalized mutual information coregistration" figure not
> equal to the numbers I get in my .mat file? Shouldn't they be equal?
>
>
>
> I mean, M*[x0;y0;z0;1] should equal [x1; y1;z1;1] and therefore c1 should
> equal d1 and c2 should equal d2 and c3 should equal d3 and K1 should equal
> d4, and so forth. As mentioned previously, c1, c2, c3 and K1 are the
> values I have shown in the figure titled "normalized mutual information
> coregistration."
>
>
>
> Why am I not getting these to be equal?
>
>
>
> Any help would be greatly appreciated.
>
>
>
> Sincerely,
>
> MW
|