STANDARD TEMPLATES

As part of a large group of changes to the way AFNI deals with templates and atlases, AFNI now includes support for a limited selection of standard templates - TLRC, MNI, MNI_ANAT. Data may be aligned to any of these spaces, and the whereami program and GUI will compute the transformations among the spaces automatically.

Space definition

Datasets are now marked with an attribute, TEMPLATE_SPACE, that marks them with the space to which they are aligned. To be clear, the "space" is a description of location associated with some template. The space is used to indicate a spatial correspondence among all datasets that share the same space. So any position in one space should be the same as the corresponding position in another dataset.

Not only are the subject datasets marked with a space, template and atlas datasets used by AFNI are also marked with a space. The space is either defined by the template itself, or the dataset has been aligned to another template of that space. AFNI is distributed with templates and atlases in TLRC and MNI spaces.

Aligning data to a template and spaces

Support for these spaces is included with @auto_tlrc so that alignment to a specific template will assign the template's space to the aligned dataset. Each of the templates distributed with AFNI that include "TT" in the prefix are in Talairach space (TLRC). "MNI" in the template prefix signifies MNI space. See the datasets included in the afni binary directory for the full list. In usage mode 2, @auto_tlrc will carry over the parent dataset's space to the child dataset. Similarly, adwarp will also apply the space of the parent dataset to the child output. Other programs that do alignment and transformation, like align_epi_anat.py, 3dAllineate, 3dvolreg, 3dWarpDrive, 3dWarp, 3drotate, 3dresample, 3dfractionize, ..., do not update the space to a template explicitly. For these, the program may include options for a master dataset. In those cases, the output should match the space of the master dataset. In other cases, you may need to manually set the space of the output dataset.

Seeing and changing the space of a dataset

A few utilities provide support for use of spaces. To find out the space of a dataset, use the 3dinfo command. 3dinfo will report the template space at the beginning of its output. To assign or reassign a space to a dataset, use the command 3drefit -space (ORIG/ACPC/TLRC/MNI/MNI_ANAT).

Implicit use of space and inheritability

Other programs in AFNI should allow the automatic inheritance of the space attribute from the master or first dataset input. 3dcalc, 3dcopy and others should follow this behavior. Not all programs have been verified to follow this behavior, so please check.

NIFTI support

The NIFTI format includes support for Talairach and MNI space in the qform and s-form code fields. AFNI will assign the corresponding space to the dataset and inherited datasets. Note NIFTI does not include a code for MNI_ANAT space.

whereami in the AFNI GUI

The AFNI GUI uses the template space of the dataset in the interactive whereami GUI when computing the current location by transforming the position in the dataset's space to the position in the Talairach-space atlases provided with afni. The transformations between MNI and TLRC spaces are computed using the Brett transform, a two-step affine transformation procedure. The coordinates are reported in the whereami GUI for TLRC, MNI and MNI_ANAT spaces. The coordinates of the space of the dataset are constructed to match the coordinates reported on the upper left coordinates display in the AFNI menu.

whereami command

The whereami command has the option -space to include support for coordinate input in any of the allowed spaces. Alternatively, the -dset option supplied with a dataset name will use the space of the dataset to compute the transformations to use with its atlases.

Environment variables and Default Behavior

Wherever the dataset has no space explicitly set, the space is assumed from the "view" part of the dataset name. For example, if the dataset, anat+tlrc, has no TEMPLATE_SPACE attribute, then the space will be assumed to be the default space of TLRC. If the environment variable, AFNI_DEFAULT_STD_SPACE, is set, then its value will be used as the name of the space for those datasets that are missing a space attribute.

Advanced Space, Template and Atlas support (in development)

A new NIML format (XML type) database can be configured to provide a list of spaces, templates, atlases and transformations. The whereami command includes support for transformations among spaces even when there is no direct transformation but instead must go through intermediate spaces. Coordinates may be transformed from any defined space to any other as long as a connection may be found. The whereami command can show the chain of spaces, transformations and concatenated transformations among a source and destination space.