AFNI Message Board

Dear AFNI users-

We are very pleased to announce that the new AFNI Message Board framework is up! Please join us at:

https://discuss.afni.nimh.nih.gov

Existing user accounts have been migrated, so returning users can login by requesting a password reset. New users can create accounts, as well, through a standard account creation process. Please note that these setup emails might initially go to spam folders (esp. for NIH users!), so please check those locations in the beginning.

The current Message Board discussion threads have been migrated to the new framework. The current Message Board will remain visible, but read-only, for a little while.

Sincerely, AFNI HQ

History of AFNI updates  

|
May 22, 2012 08:44PM
To be a little more precise:

You can get the 12 parameters of the transformation in 2 different formats from 3dAllineate.

-1Dmatrix_save gives the matrix that takes (x,y,z) in the base image to (x,y,z) in the source image. This matrix has the form

[ a b c d ]
[ e f g h ]
[ i j k l ]

where the letters stand for numbers. The formula for x{source}, for example, is then

x{source} = a*x{base} + b*y{base} + c*z{base} + d

et cetera.

-1Dparam_save stores the 12 parameters that define the above matrix in a more physically intuitive way. These parameters occur naturally in groups of 3

shifts in the x, y, z directions (mm; 0=no shift)
rotations around the z, x, y axes (degrees; 0=no rotation; rotations are about the center of the volume)
scaling along the x, y, z axes (dimensionless; 1=no scaling)
shearing along the y/x, z/x, and z/y planes (dimensionless; 0=no shear)

The very first line in the -1Dparam_save file is a comment that indicates the order of these values.

If you type the command '3dAllineate -HELP | less' and scroll thru the help output, you will find a section called DEFINITION OF AFFINE TRANSFORMATION PARAMETERS -- this section will describe in total detail the relationship between the matrix and the parameters.

Finally, if you really care, then you need to understand that AFNI programs work with (x,y,z) coordinates as defined in the DICOM standard, where +x=Left, +y=Posterior, +z=Superior. In contrast, FSL and SPM work with the x and y coordinates negated wrt DICOM, so if you want to take a matrix file from one software package to another, you had better be aware of these issues, or you will get lost.
Subject Author Posted

1-D Affine Transformation Matrix Arrangement

Evan Luther May 22, 2012 03:05PM

Re: 1-D Affine Transformation Matrix Arrangement

Daniel Glen May 22, 2012 05:10PM

Re: 1-D Affine Transformation Matrix Arrangement

Bob Cox May 22, 2012 08:44PM