This lesson is in the early stages of development (Alpha version)

From the scanner to our computer


Teaching: 20 min
Exercises: 10 min
  • What are the main MRI modalities?

  • What’s the first step necessary to start working with MRI data?

  • Understand how different MRI modalities differ and what each one represents

  • Become familiar with converting MRI data from DICOM to NIfTI

Types of MR scans


Sourced from


Sourced from Wagner and Lindquist, 2015


Sourced from

Neuroimaging file formats

Format Name File Extension Origin
DICOM none ACR/NEMA Consortium
Analyze .img/.hdr Analyze Software, Mayo Clinic
NIfTI .nii Neuroimaging Informatics Technology Initiative
MINC .mnc Montreal Neurological Institute
NRRD .nrrd  

From the MRI scanner, images are initially collected in the DICOM format and can be converted to these other formats to make working with the data easier.

Let’s download some example DICOM data to see what it looks like. This data was generously shared publicly by the Princeton Handbook for Reproducible Neuroimaging.

wget -O ../data/0219191_mystudy-0219-1114.tar.gz
mkdir -p ../data/dicom_examples
tar -xvzf ../data/0219191_mystudy-0219-1114.tar.gz -C ../data/dicom_examples
gzip -d ../data/dicom_examples/0219191_mystudy-0219-1114/dcm/*dcm.gz
rm ../data/0219191_mystudy-0219-1114.tar.gz


NIfTI is one of the most ubiquitous file formats for storing neuroimaging data. If you’re interested in learning more about NIfTI images, we highly recommend this blog post about the NIfTI format. We can convert our DICOM data to NIfTI using dcm2niix.

We can learn how to run dcm2niix by taking a look at its help menu.

dcm2niix -help

Converting DICOM to NIfTI

Convert the Princeton DICOM data to NIfTI


mkdir -p ../data/dicom_examples/nii
dcm2niix -z y -o ../data/dicom_examples/nii ../data/dicom_examples/0219191_mystudy-0219-1114/

Key Points