Remi Vieux wrote:
> I thought that when there was no .mat
> associated, then VF.mat and VG.mat would be the unity matrix, but look
> at the result of examining this variable in the debugger:
>>> VG.mat
>
> ans =
>
> -1.0200 0 0 131.0700
> 0 1.0200 0 -131.0700
> 0 0 1.7000 -85.8500
> 0 0 0 1.0000
Hi Remi,
This matrix gives the mapping from voxel indices (1,2,...,number of
voxels in each dimension) to world coordinates in mm.
The numbers on the leading diagonal are the voxel dimensions
(1.02*1.02*1.7 mm^3), the x-dimension is negative to indicate that
this Analyze image should be reflected (you presumably have
defaults.analyze.flip set in your spm_defaults).
The fourth row, with it's final 1, is there because the matrix is
intended for multiplying homogeneous vectors (which also have a 1
tacked on the end), basically this allows the translation (usually a
vector-addition) to be performed with (pre-)multiplication by this matrix.
Here, this "translation" is really indicating the centre of the
volume. The world coordinates of voxel index [1 1 1], are given by
(above matrix)*[1 1 1 1]' (note tacked-on homogeneous 1) and are:
[130.05 -130.05 -84.15], and the origin of the world coorinates can be
found by inv(above matrix)*[0 0 0 1]' and would be at voxel:
[128.5000 128.5000 50.5000].
By which I guess that your volume is 256*256*100, right? There is room
for some confusion here, since some conventions (e.g. C/C++, FSL, ...)
have the indices counting up from zero, while others (Matlab, SPM,
...) start at 1, hence 128.5 is half way between 1 and 256, and
therefore in the dead centre of the volume.
When registering two images, various conventions are possible, but I
believe SPM maps world to world. This transform matrix should then be
the identity in your case of self-self registration.
At risk of making an already over-long email longer, I'll quickly
mention NIfTI images (as preferred by e.g. SPM5 and FSL) which can
have a more complicated voxel-world mapping (two of them in fact!).
The images contain a "qform" mapping (which is a 9 degree of freedom
rigid+scales mapping) intended to be set based on the dicom headers so
that it maps voxels to real scanner-based coordinates in mm from the
isocentre; and an "sform" mapping (which is a general 12 dof affine
transform) intended to map voxel coordinates to some "standard space"
such as AVG152 (MNI/ICBM whatever you want to call it!).
Hope all that helps!
Ged.
|