Neuroimaging Datatypes🔗
This page will explain the many different datatypes involved in MRI research, from the raw images acquired from the scanner to the processing pipeline outputs.
The typical sequences taken at an MRI visit are structural scans (a T1w and/or a T2w), fieldmaps, and functional runs (rest or task). Structural scans provide information about the anatomy of the brain. Fieldmaps are used for distortion correction. They are a pair of images taken in the two directions of how the scanner moves to take an image, normally either Left to Right and Right to Left (LR/RL) or Anterior to Posterior and Posterior to Anterior (AP/PA). These images are used to correct for the "lag" that happens when scanning, which causes the front or back of the brain to become distorted. The functional runs collect the BOLD signal of the brain and can be used to investigate brain connectivity. Diffusion weighted images (DWI) are also sometimes collected for investigate the tractography of the brain.
DICOM🔗
DICOMs are the standard file format that is collected from the scanner. Fun fact, DICOM stands for Digital Imaging and Communications in Medicine. DICOM files have a .dcm ending. These files store the imaging data as well as header information that indicates information about the scanning participant and scan sequence. You can access the header information with dcmdump (included in the dcmtk module on MSI) or you can use the pydicom package in Python.
These raw files take up tons of space and are complicated to work with, as a single DICOM is often only one frame of the MRI scan. This is part of the reason they need to be converted to the NIfTI format. We don't often work directly with DICOMs, except maybe looking at them with ITK-SNAP to check the data quality.
NIfTI🔗
NIfTI is the standard file format for working with MRI data. Another fun fact, NIfTI stands for Neuroimaging Informatics Technology Initiative. This format compiles all of the DICOMs from a run into one file and significantly decreases the size of the data by storing it more efficiently. NIfTIs store volumetric data. These files have a .nii or .nii.gz ending.
GIFTI🔗
GIFTI (Geometry format under the Neuroimaging Informatics Technology Initiative) is another standard file format for surface MRI data. They are Geometry NIfTI files and store the surface mesh data. These files have a .gii ending. These filetypes are outputs from processing pipelines. Some example filetypes include
.shape.gii- can store information such a cortical thickness and curvature.surf.gii- stores the different surface information, like midthickness, pial, and white surfaces.label.gii- stores label data that can be mapped to a .surf.gii file and a label table specifiying the names and colors for label data.func.gii- functional surface data
For more in-depth reading on GIFTI files, see the GIFTI format specification pdf.
CIFTI🔗
CIFTI (Connectivity Informatics Technology Initiative) is a sort of expanded NIfTI that can hold more data. These files store volumetric and surface data. These file types are outputs from processing pipelines and analysis methods. Since these are basically just expanded NIfTI files, they also have .nii endings. There are two general types of CIFTI files, dense files and parcellated files. Dense files have data for the entire brain and are used for whole brain connectivity analyses. Parcellated files have the data split out by a parcellation file and are used for analyses looking at average ROI/parcel connectivity. Some example filetypes include
.dtseries.nii/.ptseries.nii- raw timeseries data, every column is a TR and every row is the signal at that grayordinate/parcel.dscalar.nii/.pscalar.nii- scalar map across vertices/voxels, usually 1-D matrix.dconn.nii/.pconn.nii- correlation matrix of the dtseries data, how every grayordinate is associated with every other grayordinate.dlabel.nii/.plabel.nii- stores named label maps across vertices/voxels (basically the same as dscalar but with named maps)
You can read more about CIFTI files (and how to work with them in R) in this ciftiTools paper and in the CIFTI-2 format specification.
BIDS🔗
BIDS is a standard directory structure and filenaming convention used in MRI research. It stands for Brain Imaging Data Structure. The BIDS standard allows researchers and practitioners to easily navigate and understand the contents of the dataset by providing a consistent organization of the data. When we convert DICOMs to NIfTIs, we also rename the files to be in the BIDS standard, as this is what most pipelines and tools will expect. When we have converted a subjects raw data to NIfTIs in this format, we will refer to that data as the BIDS data. Processing pipeline outputs are also BIDS valid, although we normally just refer to them as derivatives.
Below is an examples of a BIDS directory structure for a participant of the ABCD study.
|--dataset_description.json
|--README
|--CHANGES
|--participants.tsv
|--task-(MID|nback|rest|SST)_bold.json
|--sub-SUBID
|--ses-SESID
|--anat
|--sub-SUBID_ses-SESID(_rec-normalized)_(T1w|T2w).json
|--sub-SUBID_ses-SESID(_rec-normalized)_(T1w|T2w).nii.gz
|--dwi
|--sub-SUBID_ses-SESID_dwi.bval
|--sub-SUBID_ses-SESID_dwi.bvec
|--sub-SUBID_ses-SESID_dwi.json
|--sub-SUBID_ses-SESID_dwi.nii.gz
|--fmap
|--sub-SUBID_ses-SESID_(acq-dwi_)dir-(AP|PA)_run-0#_epi.json
|--sub-SUBID_ses-SESID_(acq-dwi_)dir-(AP|PA)_run-0#_epi.nii.gz
|--func
|--sub-SUBID_ses-SESID_task-(MID|nback|rest|SST)_run-0#_bold.json
|--sub-SUBID_ses-SESID_task-(MID|nback|rest|SST)_run-0#_bold.nii.gz
Data Workflow🔗
MRI data needs to be processed for a variety of reasons. First of all, the data collected from the scanner has lots of "background noise" that needs to get filtered out. There are also motion artifacts from the participants moving in the scanner (just breathing is enough movement to cause an artifact!) and distortion due to the magnetic field of the scanner and the direction that the scanner takes the image. Processing the data "cleans" it up and also extracts meaningful information about the brain structure and function. It is important for the data the be processed in a replicable way, so that the data can be compared and used for subsequent analyses. This is why we use standardized pipelines for our processing. Outlined below are the general steps for MRI data processing.
- DICOM to BIDS - convert raw DICOMS to NIFTIs using the BIDS format
- NORDIC - a thermal denoising algorithm to reduce unstructured noise
- BIBSnet - for infant processing, creates a better brain segmentation and mask to feed into infant processing pipeline
- Pre-processing (ABCD-BIDS or fMRIprep/NiBabies) - anatomical processing (intensity correction, alignment, tissue segmentation, normalization, surface reconstruction) and functional processing (brain mask, motion and distortion correction) with outputs mapped to a standard atlas space
- Post-processing (XCP-D) - further functional processing to generate denoised BOLD images, parcellated time series, and functional connectivity matrices
- Further analyses - template matching is a popular next step but there are many options
This is only a brief overview of the general steps of MRI data processing. We have dedicated pages to almost each of these steps to explain in further detail how to do each step, including a processing workflow section to explain how to process data on MSI.
For questions, suggestions, or to note any errors, post a Github issue.