DICOM vs NIfTI: Key Differences for Neuroimaging and Research
Quick answer
DICOM is the clinical format: scanners and PACS use it, it stores rich metadata including patient details, and a scan is usually many files (often one per slice). NIfTI (.nii or .nii.gz) is the research format: one file holds a whole 3D or 4D volume with a small header focused on voxel size and orientation. Researchers convert DICOM to NIfTI, most often with dcm2niix, before analysis in tools like FSL, SPM, FreeSurfer or ANTs.
DICOM is the standard for clinical imaging, but anyone who moves into academic neuroimaging quickly meets a second format: NIfTI. Both store brain scans, yet they were designed for very different jobs. On the clinical side I only ever send DICOM to PACS. The moment those scans are used for a research study, they are almost always converted to NIfTI. Here is what changes, and what to watch out for.
At a glance
| DICOM | NIfTI | |
|---|---|---|
| Main use | Clinical care, PACS, diagnosis | Research analysis and data sharing |
| File extension | .dcm, or no extension | .nii, .nii.gz (or a .hdr + .img pair) |
| Files per scan | Usually one per slice; enhanced multi-frame DICOM can hold a whole series | One file per 3D volume or 4D time series |
| Header | Hundreds of tagged elements (patient, study, scanner, protocol) | Fixed header: 348 bytes in NIfTI-1, 540 bytes in NIfTI-2 |
| Patient details | Included by design | Not in the standard fields, but can leak through file names, the free-text description field or sidecar files |
| Orientation | Image Position and Orientation stored per slice | One affine matrix (qform and sform) for the whole volume |
| Scan parameters (TR, TE, b-values) | In the header | Mostly lost; kept in a separate JSON sidecar, bval and bvec files |
| Opened by | PACS, DICOM viewers | FSL, SPM, FreeSurfer, AFNI, ANTs, ITK-SNAP, Python (nibabel) |
DICOM: the clinical standard
DICOM (Digital Imaging and Communications in Medicine) is built for the hospital workflow. Its priority is keeping every image tied to the right patient, exam and equipment, and making devices from different vendors work together.
- Structure: a classic MRI study is a folder of hundreds or thousands of files, usually one 2D slice each. Newer "enhanced" DICOM objects can store a full series in a single multi-frame file.
- Metadata: its biggest strength. Hundreds of standardized tags record the patient, the study, the sequence parameters and the scanner. You can browse them with the DICOM tag viewer.
- Goal: an image that is never separated from its clinical context. Read more in what is a DICOM file.
NIfTI: the research standard
NIfTI comes from the Neuroimaging Informatics Technology Initiative. NIfTI-1 is a modified version of the older ANALYZE 7.5 format, and NIfTI-2 followed in 2011 to allow very large images. It was designed by researchers to make analysis simple, especially for 3D anatomy and 4D functional MRI.
- Structure: one .nii (or compressed .nii.gz) file holds the whole volume, so a brain MRI is one file instead of a folder of slices.
- Header: small and fixed. It stores dimensions, voxel size, data type, scaling and, crucially, how the voxel grid maps to real-world space.
- Goal: data that analysis software can load in one step and compare across many subjects.
Why researchers convert DICOM to NIfTI
- Simplicity: it is far easier for FSL, SPM, FreeSurfer or ANTs to work with one 3D or 4D file than with thousands of 2D slices.
- Spatial orientation: the NIfTI affine says exactly where each voxel sits and which side is left. That is essential when brains from many people are aligned into one template.
- Sharing: the NIfTI header has no fields for names or IDs, which makes it a good starting point for de-identified datasets. It is not the whole job, though (see below).
- Standard layouts: the BIDS (Brain Imaging Data Structure) standard organizes NIfTI files plus JSON sidecars, so tools and collaborators know where everything is.
How the conversion works
The most widely used converter is dcm2niix. A typical command is dcm2niix -z y -b y -o output_folder dicom_folder, which writes compressed .nii.gz files and a JSON sidecar of scan parameters for each series. Diffusion scans also get .bval and .bvec files. SPM, AFNI and FreeSurfer include their own converters too.
Things to check after converting:
- Slice spacing: NIfTI needs evenly spaced slices. Series with gaps or tilted acquisitions may be split or resliced by the converter.
- Orientation: open the result in a viewer and confirm left and right before analysis.
- Missing parameters: anything not in the JSON sidecar is lost from NIfTI, so keep the original DICOM archive.
Is NIfTI automatically anonymous?
Not completely. The standard header fields hold no patient name or ID, but identifying information can still slip through:
- File names: converters often build names from DICOM fields, and those can include the patient name if the naming pattern asks for it.
- The description field: the header has a free-text field that some tools fill.
- JSON sidecars: dcm2niix anonymizes them by default, but with that option off they can include the patient's name, age and weight.
- The face: a high-resolution 3D head scan can be rendered into a recognizable face. Research datasets are usually "defaced" (for example with pydeface) before sharing.
For clinical DICOM you need to share, the DICOM anonymizer removes names, IDs and dates in your browser. See also how to anonymize DICOM files.
Conclusion: the right format for the job
Neither format is better. DICOM is the patient-centered standard that hospitals depend on every day. NIfTI is the streamlined, analysis-ready format that brain imaging research has standardized on. Anyone working between the two, such as clinical researchers or technologists supporting research scans, should keep the original DICOM, convert carefully, and check the result before analysis.
Frequently asked questions
How do I convert DICOM to NIfTI?
Use dcm2niix, the most widely used free converter: point it at the folder of DICOM files and it writes one .nii.gz file per series, plus a JSON sidecar. It is built into MRIcroGL and many BIDS tools. SPM, AFNI and FreeSurfer have their own converters too.
Can I convert NIfTI back to DICOM?
Yes, with tools such as nii2dcm, 3D Slicer or ITK-based scripts, but the result is a new DICOM series without most of the original scan parameters. If you still have the original DICOM, use that for clinical purposes.
What is the difference between .nii and .nii.gz?
They are the same format. A .nii.gz file is simply gzip-compressed, which often makes brain images several times smaller. Almost all neuroimaging tools read both.
What is the difference between NIfTI-1 and NIfTI-2?
NIfTI-2 uses a larger 540-byte header with 64-bit fields, so it can store images with far more voxels. NIfTI-1 has a 348-byte header and is still the most common version.
Can I open NIfTI files in a DICOM viewer?
Usually not. DICOM viewers and PACS expect DICOM. Use a research viewer such as FSLeyes, MRIcroGL, ITK-SNAP or 3D Slicer, or Python's nibabel library.
Comments