NIfTI (Neuroimaging Informatics Technology Initiative) is a widely used medical imaging file format for storing 3D and 4D volumes such as MRI, CT, and PET. Evolving from the Mayo Clinic’s ANALYZE 7.5 format of the 1990s, NIfTI was formalized in the early 2000s to standardize research-grade storage with a single-volume design and a rich header, and it has since become a de facto standard in neuroimaging and AI imaging workflows.
A NIfTI file typically appears as .nii or a compressed .nii.gz. Legacy pairs .hdr/.img are also seen.
Unlike DICOM, which stores images as many per-slice files bundled with extensive clinical metadata, NIfTI consolidates a study or series into a single volume with a compact header. The header contains voxel dimensions, data type, spatial orientation, and an affine transform (qform/sform) that maps voxel indices to real-world coordinates. This makes NIfTI ideal for tasks like registration, segmentation, and model training where consistent orientation and fast I/O matter.
Two main versions exist: NIfTI-1, the original, and NIfTI-2, which expands certain fields to support very large datasets. Both handle static 3D volumes and time-series (4D) data, so you can store, for example, a functional MRI run with hundreds of timepoints. The format is extensible, allowing optional metadata “extensions” without breaking compatibility.
For AI data pipelines, NIfTI is convenient because it:
Example
Scenario: You have a MRI scan of a patient’s brain. The scanner exports hundreds of DICOM slice files. You convert them into one NIfTI file, say, 'patient01_T1.nii.gz.'
What the NIfTI holds: The entire 3D volume plus a small header that records voxel size (e.g., 1 mm), image orientation, and a transform that tells software where the brain sits in real-world space. In plain terms: it’s one compact file that knows the image’s “shape” and “which way is up.”
Why this helps: A radiologist (or your medical image labeling tool) draws a tumor region and saves it as 'patient01_T1_mask.nii.gz.' Because both files share the same grid and orientation, the mask snaps perfectly onto the MRI without manual alignment. Now you can:
- measure tumor volume,
- train a segmentation model,
-register the scan to a standard atlas, or
-combine multiple modalities (e.g., T1, T2, FLAIR) with consistent geometry.