Skip to content

ENIGMA Diffusion Weighted Imaging Data Preprocessing Tutorial

Ryan Cali edited this page May 24, 2023 · 36 revisions

Before You Begin - Required Software

FSL - https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/FslInstallation
MRtrix3 - https://www.mrtrix.org/download/

First Steps - Understanding Your Data

Diffusion-Weighted Imaging (DWI) Volume Files and Corresponding Gradient Tables

  • There are 4 files that are required for us to reach our end goal in diffusion-weighted image processing of fitting a specific model to our data. In this case, we are focused on fitting the diffusion tensor model or 'DTI'. These required files are detailed below with explanations as to how they integrate with the main DWI volume.

  • This tutorial uses the data included in this repository that can be found here which assumes a directory structure like the one pictured below.

1 . The DWI Volume

  • Here we can see a screen capture of the header of our DWI volume in our terminal. We used the command 'mrinfo' to generate an output containing the image header information. In this case, we can see that our image is of 128 x 128 x 75 x 65 dimensions. This means that we have a 3-dimensional image of matrix size 128x128x75 with 64 diffusion volumes plus 1 b0 volume. In the movie, we can see our diffusion volumes from volume 0 to 64 (the bright image at the end being our b0 volume).

The entire diffusion volume as a movie.


2. The DWI JSON File

  • Below the JSON files associated with our acquisition is displayed. This file should be generated when you convert your raw dicom data to nifti (.nii or .nii.gz). The JSON file or "sidecar" contains a wide variety of information pertaining to data acquisition.

  • For our purposes, we are most interested in the fields "EstimatedTotalReadoutTime" and "PhaseEncodingAxis." Readout time tells us the time it took the MRI scanner to acquire the data and phase encoding axis tells us the direction at which the acquisition began and ended. Phase encoding axis is generally Anterior-Posterior, Superior-Inferior, or Left-Right, and can also be the inverse. We will note the readout time as 0.045 and save this to be used in our dwifslpreproc command when we do eddy current correction.

dwi_json

The DWI bvec and bval files

3. bvecs


dwi_bvec

4. bvals

dwi_bval

Preprocessing Pipeline

Step_1 Script - PCA-Based Denoising

Command: dwidenoise

Pre and Post-denoising

  • Here you can see the results of performing principal component analysis(PCA)-based denoising on our data. Pictured left is the raw volume, and right the denoised volume.

Image 1 Image 2

Step_2 Script - Removal of Gibbs Ringing Artifacts

Gibbs ringing artifacts are often seen in magnetic resonance imaging (MRI) where we are transforming MR signals into a series of 2D images. This occurs when we reduce our sample of frequencies when constructing a Fourier series. Gibbs artifacts can be seen in the image to the right.

Image 1

Source: mriquestions/gibbs-artifact

Command: mrdegibbs

Step_3 Script - Creating a Brain Mask With dwi2mask dwi2mask

  • In this step, we create a mask containing solely the brain tissue, removing the skull and all non-brain tissue from the DWI volume. This new brain-only volume will be used as our input to the next step where we will correct for Eddy-induced currents and motion-related artifacts. NOTE: The performance of dwi2mask can vary widely from dataset to dataset, and brain to brain. To account for this, it is recommended that you download the development version of MRtrix which includes an option to explore masking across several different algorithms when running the dwi2mask command. Additionally, it offers the option to generate a 'consensus' mask by averaging the results from several masking algorithms.
Screenshot 2023-05-09 at 7 26 41 PM

Command: dwi2mask

Step_4 Script - Eddy Current and Motion Correction

Command: dwifslpreproc

Step_5 Script - Creating a Post-Eddy Brain Mask With dwi2mask

Now that we have corrected our data for eddy-induced currents, we must mask the corrected data to ensure that when we perform tensor fitting in the final step, it is only done within the corrected brain area. We apply the mask that is generated in this step to the command in step 6 with the -m option.

Command: dwi2mask

Step_6 Script - Fitting Tensors to The Diffusion Volume

Screenshot 2023-05-23 at 5 14 56 PM

Command: dtifit