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  

|
August 27, 2012 11:47AM
I'm not sure from that description if they are looking for an affine transformation matrix or for the list of parameters. For the affine transformation matrix, our format for the 1D file saved by align_epi_anat.py/3dAllineate defines xyz->xyz both in RAI coordinates. The translations are every 4th number (the last column if laid out as 4 columns by 3 rows), so that might be "a b c j d e f k g h i l" as the one row in the text file.

cat m3d_ns_al2epi0_mat.aff12.1D
# 3dAllineate matrices (DICOM-to-DICOM, row-by-row):
0.995758 0.0152865 0.0198008 2.90661 -0.0164348 0.941894 0.347633 -13.4597 -0.00749007 -0.353944 0.946086 -41.2396

cat_matvec anat_ns_al2epi0_mat.aff12.1D
0.995758 0.0152865 0.0198008 2.90661
-0.0164348 0.941894 0.347633 -13.4597
-0.00749007 -0.353944 0.946086 -41.2396

On the other hand, if you need the list of parameters, these can be saved during alignment by adding "-1dparam_save" to the 3dAllineate options or by extracting an attribute for each sub-brick of the aligned dataset:

3dAttribute -name ALLINEATE_PARAMS_000000 anat_ns_al2epi0+orig
ALLINEATE_PARAMS_000000 = 2.906609 -13.45973 -41.23965 1.299778 20.24949 -1.2141 0.996072 1.004121 1.010128 0.004955 0.005911 -0.004357

In this case, the parameters are listed in order of translation, rotation, scale and shear (x,y,z for each, RAI). Rotation is about the center of the dataset. Translation units are in mm, and rotation is in degrees.
Subject Author Posted

Convert affine transformation for ANTS

Anonymous User August 27, 2012 08:21AM

Re: Convert affine transformation for ANTS

Daniel Glen August 27, 2012 11:47AM

Re: Convert affine transformation for ANTS

Anonymous User August 31, 2012 02:09AM

Re: Convert affine transformation for ANTS

Daniel Glen August 31, 2012 07:16AM