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 18, 2015 01:04PM
I think this is all okay. Namely, the slices do map based on the orientation of the dataset. Slice 0 gets the first time offset, slice 1 the next and so on. Refitting the orientation doesn't change the data, so slice 0 is still the same data, and the same correction should occur. We generally think of the xyz order as the storage order. AFNI_ORIENT should have no effect. Some other ways to look at slice timing:


# reorient RAI original dataset to RAS. 3dresample wipes out the offsets
3dresample -orient RAS -prefix epi_r1_RAS -inset epi_r1+orig.


3dinfo -prefix -slice_timing epi_r1*.HEAD
epi_r1 0.000000|1.030302|0.060606|1.090908|0.121212|1.151514|0.181818|1.212120|0.242424|1.272726|0.303030|1.333332|0.363636|1.393938|0.424242|1.454544|0.484848|1.515150|0.545454|1.575756|0.606060|1.636362|0.666666|1.696968|0.727272|1.757574|0.787878|1.818180|0.848484|1.878786|0.909090|1.939392|0.969696
epi_r1_RAS 0.000000|0.000000|0.000000|0.000000|0.000000|0.000000|0.000000|0.000000|0.000000|0.000000|0.000000|0.000000|0.000000|0.000000|0.000000|0.000000|0.000000|0.000000|0.000000|0.000000|0.000000|0.000000|0.000000|0.000000|0.000000|0.000000|0.000000|0.000000|0.000000|0.000000|0.000000|0.000000|0.000000


# get time attributes from header. Resampled dataset is missing offsets
3dAttribute -all epi_r1+orig. | grep TAXIS
TAXIS_NUMS = 152 33 77002 -999 -999 -999 -999 -999
TAXIS_FLOATS = 0 2 0 -17.65058 3 -999999 -999999 -999999
TAXIS_OFFSETS = 0 1.030302 0.060606 1.090908 0.121212 1.151514 0.181818 1.21212 0.242424 1.272726 0.30303 1.333332 0.363636 1.393938 0.424242 1.454544 0.484848 1.51515 0.545454 1.575756 0.60606 1.636362 0.666666 1.696968 0.727272 1.757574 0.787878 1.81818 0.848484 1.878786 0.90909 1.939392 0.969696

3dAttribute -all epi_r1_RAS+orig. |grep TAXIS
TAXIS_NUMS = 152 0 77002 -999 -999 -999 -999 -999
TAXIS_FLOATS = 0 2 0 0 0 -999999 -999999 -999999

You can also get the time offset in the graph viewer of the afni GUI. Click on a time point, and the computed time is shown at that index and voxel. Similar to Isaac's selection, you can apply a slice timing correction you want with the "tpattern @filename" option to apply by slice or with the "-voxshift" option to use a dataset.

You might notice there are more fields in that TAXIS_FLOATS attribute than might seem necessary. 3dvolreg and 2dimreg can support a more complicated slice timing pattern that allow for duplication of slices. They map to these fields in the dataset header structure :

/*! Struct to hold information about the time axis of a 3D+time datset.

For 3D+t datasets, there are ntt 3D times; the i-th one is centered
at ttorg + ttdel*ii seconds, for ii=0..ntt-1.
Also, ttdur = duration of each sample in time.

If ( nsl > 0 && toff_sl != NULL), then the data was acquired as
slices, not as a 3D block. The slicing direction must be the
dataset (not DICOM) z-axis. The extra offset for the data at
z is given by computing isl = (z - zorg_sl) / dz_sl + 0.5; the
extra offset is then toff_sl[isl]. Note that dz_sl might be
different from the dataxes zzdel because the dataset might actually
be made up of duplicated slices (see program abut.c).

All this is computed using the routine THD_timeof().

When transformed, all the slice stuff will be ignored. That's
because the warped dataset z-direction will not be the same as the
original dataset's z-direction.
*/

typedef struct {
int type ; /*!< TIMEAXIS_TYPE */
int ntt ; /*!< Number of time points */
float ttorg ; /*!< Time origin (usually 0) */
float ttdel ; /*!< Fondly known as TR */
float ttdur ; /*!< Duration of image acquisition (usually not known) */

int units_type ; /*!< one of the UNITS_ codes */

int nsl ; /*!< Number of slice-dependent time offsets */
float * toff_sl ; /*!< toff_sl is time offset for slice #1 */
float zorg_sl ; /*!< z-coordinate origin for slice offsets */
float dz_sl ; /*!< z-coordinate spacing for slice offsets */
} THD_timeaxis ;
Subject Author Posted

clarify mapping of tpattern to slices for 3dTshift

fissell August 18, 2015 11:30AM

Re: clarify mapping of tpattern to slices for 3dTshift

Isaac Schwabacher August 18, 2015 12:11PM

Re: clarify mapping of tpattern to slices for 3dTshift

Daniel Glen August 18, 2015 01:04PM

Re: clarify mapping of tpattern to slices for 3dTshift

fissell August 18, 2015 02:28PM

Re: clarify mapping of tpattern to slices for 3dTshift

rick reynolds August 18, 2015 04:18PM

Re: clarify mapping of tpattern to slices for 3dTshift

Daniel Glen August 18, 2015 06:34PM