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  

|
bob cox
January 28, 2003 07:47PM
As you seem to have discovered, to properly overlay EPI datasets, or functional datasets derived from EPI datasets, onto anatomical (SPGR or MPRAGE) datasets, you have to get the coordinate origins correct. However, you can fix the origins later with the 3drefit program.

One question is whether any of the original datasets you inherited were created with the proper z offset. Possibly not. If you run "3dinfo dataset+orig" on these datasets, it will print out lines like

Data Axes Orientation:
first (x) = Anterior-to-Posterior
second (y) = Superior-to-Inferior
third (z) = Left-to-Right [-orient ASL]
R-to-L extent: -74.000 [R] -to- 73.600 [L] -step- 1.200 mm [124 voxels]
A-to-P extent: -119.531 [A] -to- 119.531 [P] -step- 0.938 mm [256 voxels]
I-to-S extent: -119.531 -to- 119.531 [S] -step- 0.938 mm [256 voxels]

(not formatted very nicely here, I'm afraid). This shows that the dataset z-axis is oriented Left-to-Right and that its range is 74R to 73.6L. Since these values are NOT centered on z=0, this dataset did have a z-axis offset entered when it was created.

You might be able to use something like
3drefit -dzorigin 14.3 anat+orig
to change the z-axis offset of the anatomical dataset to bring it into alignment with the EPI and EPI-derived functional datasets. How you get the magic value "14.3" is the trick, of course. If you have the original GE I.* files, you could use the "ge_header" command to get some information about these files; for example

% ge_header /home/cox/data/AFNI_sample_01/EPI_run1/I.02880
File /home/cox/data/AFNI_sample_01/EPI_run1/I.02880
nx=64 ny=64 skip=7904 swap=YES compressed=NO bits-per-pixel=16
dx=3.75 dy=3.75 dz=4 zoff=-28.8 orient=RLSI xoff=120 yoff=120 TR=2s TE=25ms

shows that the slice offset of this file is -28.8 mm. By comparing the slice offset of the EPI data to the anatomical data, you should be able to compute the value for "-dzorigin". You should probably work on a copy of the dataset (made with 3dcopy?) so you don't screw things up too much when playing around with 3drefit.

It would be simplest to move the anatomical to match the EPI, since there is (usually) only one anatomical dataset. However, if you have already set the Talairach markers in the anatomical, changing the anatomical's z-origin will leave the markers in a bad way, since they are stored in (x,y,z) coordinates, not voxel index coordinates, in the .HEAD file. If you change the relationship between voxel indexes (i,j,k) and (x,y,z), then the markers will no longer be in the anatomically correct locations. Probably the simplest thing to do in this case would be to manually reset the markers - it isn't that hard, after all.

hope this helps -- bobcox
Subject Author Posted

to3d and -zSLAB option

David Ludlow January 28, 2003 01:54PM

Re: to3d and -zSLAB option

David Ludlow January 28, 2003 01:58PM

Re: to3d and -zSLAB option

bob cox January 28, 2003 07:47PM

Re: to3d and -zSLAB option

teodora December 17, 2003 09:49AM