Overview of NIfTI-MRS
This page provides an overview of the NIfTI-MRS file structure.
The structure of NIfTI-MRS is defined in the standard, which is available online (Zenodo, GitHub).
NIfTI-MRS is derived from the NIfTI standard, preferring (but not requiring) the NIfTI-2 standard. The NIfTI standard is available online (NIfTI, NIfTI-1, NIfTI-2).
File structure
The NIfTI format contains three sections: the data header, optional header extensions, and the data block.
NIfTI Header
NIfTI-MRS reuses the NIfTI data header structure, it is identical to the header structure of the parent standard. Some header fields are constrained or re-utilised for spectroscopy-specific purposes:
The dwell-time of the time domain data is stored in
pixdim[4]
(with units are specified in thexyzt_units
field).Spatial position encoding is identical to the original NIfTI-1 specification, but default values are defined. See the Encoding spatial orientation & position page.
Only complex datatypes may be specified in the
datatype
field (e.g. “DT_COMPLEX”, 32).The
intent_name
filed is used for the NIfTI-MRS version, It is specified using the format mrs_vMajor_minor.
NIfTI Data Block
The NIfTI-MRS data block is used to store up to seven-dimensional complex time-domain data.
Dimensions 1-4 (required)
The first four dimensions are required for a valid NIfTI-MRS file.
Dimensions 1-3 are used for spatial encoding (x, y, and z coordinates). All three spatial dimensions have a size of one for single-voxel data.
Dimension 4 is used to store the time-domain FID (or echo).
Dimensions 5-7 (optional)
Dimension 5-7 are optional. They flexibly encode different dynamic aspects, with the specific purpose and interpretation of each dimension being documented in the header extension.
NIfTI Header Extension
The header extension has the official NIfTI identification code 44, NIFTI_ECODE_MRS. It comprises key-value pairs formatted according to the JSON standard. The header extension contains the minimum necessary metadata required for meaningful interpretation of the spectroscopic data, additional information about optional higher data dimensions, and further optional MRS-specific metadata. For more information on the header extensions structure see the page on the header extension.