Skip to content.

Neuroimaging Informatics Technology Initiative

Personal tools
You are here: Home » NIfTI-1 Data Format » AFNI extension in NIfTI-1.1

AFNI extension in NIfTI-1.1

Document Actions
The AFNI extension (ecode=4) to the NIfTI-1.1 header is described.

AFNI uses extension ecode=4 to store some "extra" data in the NIfTI-1.1 files that it writes. The content of the extension is an XML document, whose elements contain some of the "AFNI dataset attributes" that would normally be written to an AFNI .HEAD file. A fragment of such an extension is given below:

<?xml version='1.0' ?>
  ni_form="ni_group" >
  atr_name="HISTORY_NOTE" >
 "[rwcox@ilmarin: Tue May 10 14:59:07 2005] 3dTcat -prefix q.nii v1_time+orig v2_time+orig~"
Within the root element (named "AFNI_attributes") is a collection of other elements, all named "AFNI_atr". Each of these encodes an array of characters (as in the "String" example above), an array of floats, or an array of ints. Each "AFNI_atr" element has an XML attribute named "atr_name", whose RHS value is the name that it gets in the AFNI internal dataset struct; in the example, the name is "HISTORY_NOTE".

Some of the information that can be stored in this extension is

  • A permanent globally unique ID string for the dataset. This is used in AFNI to maintain inter-dataset links.
  • A string label for each 3D (x,y,z) volume, useful for GUI purposes.
  • A list of 'tagged' points, each with (x,y,z) coordinates and a string label. AFNI can display these overlaid on the dataset, and can register one volume's tags to another (i.e., the 3dTagalign program).
  • A list of min and max values in each 3D (x,y,z) volume.
  • The history of AFNI commands that have been applied that resulted in this dataset (as shown in the example above). Other user notes can also be attached (via the Notes plugin in the AFNI GUI, or the 3dNotes program on the command line).
All AFNI dataset attributes that do not conflict with the content of the NIfTI-1.1 header are written to the extension. A list of AFNI dataset attributes can be found at The AFNI dataset attributes that are not written to the NIfTI-1.1 file are listed below:
  • IDCODE_STRING   (the dataset ID code is stored in the root element "self_idcode" XML attribute).
  • DATASET_DIMENSIONS   (conflicts with dim)
  • ORIENT_SPECIFIC   (conflicts with the qform and/or sform)
  • ORIGIN   (ditto)
  • DELTA   (conflicts with pixdim)
  • TAXIS_NUMS   (conflicts with dim_info, slice_code, etc.)
  • TAXIS_FLOATS   (ditto)
  • TAXIS_OFFSETS   (ditto)
  • BYTEORDER_STRING   (not needed; dim[0] signals this)
  • BRICK_TYPES   (incompatible with NIfTI-1.1)
  • BRICK_FLOAT_FACS   (ditto)
  • STAT_AUX   (ditto)
  • LABEL_1   (is obsolete in AFNI)
  • LABEL_2   (ditto)
  • DATASET_NAME   (ditto)

This XML format is also going to be used in the new AFNI .HEAD file, which will supersede the older format sometime in the summer of 2005.

 This feature was added to AFNI on 10 May 2005 - RWCox.

Created by Data Format Working Group
Last modified 2005-06-02 15:44

Powered by Plone

This site conforms to the following standards: