On 29/05/06, Remi Vieux <[log in to unmask]> wrote:
> Hi,
> % V.mat - a 4x4 affine transformation matrix mapping from
> % voxel coordinates to real world coordinates.
> This question may sound really stupid but does the matrix computed and
> stored in the .mat has special properties, for example is it a symmetric
> matrix or anything else?
Hi Remi,
The matrix is the homogeneous representation of an affine
transformation. Basically an affine transformation is the combination
of a linear transformation and a translation. A linear transformation
in this context is the most general linear mapping between two sets of
3D coordinates, which could be represented by multiplication by a
general 3x3 matrix. This matrix has 9 elements, and need not have any
special properties or constraints, so has 9 degrees of freedom. It is
usual however, to only want to consider transformations that don't
flip the coordinate system, which requires that the determinant of
this matrix is positive. A determinant of zero would "squash" one or
more dimensions, e.g. a whole volume would map onto a single plane,
which is almost certainly undesirable. You can also think of the 9 dof
as 3 rotations about the axes, 3 scales (along each axis), and 3 skews
or shears of the axes.
The translation adds three degrees of freedom, for a total of 12 for a
full affine transformation. Homogeneous coordinates basically add a 1
as a fourth element of the coordinate vector, this allows a matrix
multiplication to include the translation that would otherwise require
a vector addition. These homogeneous 4 element vectors are transformed
with a 4x4 matrix, but the final row of this matrix (assuming a
pre-multiplication convention -- I've not checked, but I think this is
what spm2 uses) will be [0 0 0 1] for an affine transformation, hence
there are still only 12 alterable elements for the 12 dof. Since the
determinant of the 4x4 matrix can be given by the elements of the
bottom row multiplied by the 3x3 determinants, it is equal to the 3x3
linear transform determinant, and so again, usually strictly positive.
These are the only special properties that I am aware of, the matrix
certainly need not be symmetric (but could be in special cases, e.g.
no translation, no rotation, and no skews, will give a diagonal matrix
with just the three scales and the homogenous 1 on the diagonal; and
as expected, a 4x4 identity matrix will leave the coordinates
unchanged).
I hate typing out algebra in emails, but if the above isn't clear, let
me know and I'll write something and email a scan of it.
Best,
Ged.
|