Preprocessing DTI Data Using FSL

From VISTA LAB WIKI

Jump to: navigation, search

This page describes an alternative method for computing tensors from NIFTI data using the FSL tool-kit.
NOTE: see the dtiRaw code as an alternative to the FSL preprocessing described here.

Contents

[edit] Correction for Eddy Current Spatial Distorion (~30min)

    Use FSL's Diffusion Toolkit to eddy correct: a. Click on FDT Diffusion on the main FSL menu window b. From the pull down window change ProbTrack Probabilistic tracking to Eddy current correction c. For the Diffusion weighted data select the Analyze file containing the diffusion images d. A default output file name will be provided and you should change this to something more meaningful to your study e. The reference volume should be set to 0 as the B0 data are usually the first volume in your data file The command line operation that does this is eddy_correct: Usage: eddy_correct <4dinput> <4doutput> <reference_no> reference_no is the index of the reference image (a non diffusion-weighted image). For example, eddy_correct dwi eddy_corrected 0 Warning: Do *not* use the name "vol" for your input to this step. Doing so will cause namespace clashes with FSL! This step outputs an eddy corrected dataset in NIFTI format.

[edit] Create a Binary Mask of the Brain (~1min)

    Click on BET Brain Extraction on the main FSL menu window a. The Input image is the eddy current corrected from step 1 b. Click to view Advanced Options and select Generate binary brain mask image c. The default fractional intensity threshold of .5 should work for your data d. Click Apply to create the mask The command line operation that does this is bet2: Usage: bet2 <input_fileroot> <output_fileroot> [options] You should specify "-m" as an option, to create the mask image. If necessary, you can also specify the fractional intensity threshold using the "-f" option. Different values of this parameter control the size of the mask. (Smaller values result in larger brain outline estimates.) The default value of 0.5 probably works for your data. For example, bet2 eddy_corrected bet -m The output will be called bet_mask.nii.gz

[edit] Calculate the Tensors (~5min)

    This step fits tensors to the diffusion weighted images you have processed. From FSL's Diffusion Toolkit use the pull down menu to select DTIFit Reconstruct diffusion tensors a. Use the pull-down menu to select DTIFit Reconstruct diffusion tensors b. Select Specify input files manually and enter the appropriate files c. Click Go D. Your output files from this step can be used to create a DT6 file for mrDiffusion The command line operation that does this is dtifit: Usage: dtifit -k <dti data file> -o <output basename> -m <brain mask> -r <gradient directions file> -b <gradient b-values file> For example, dtifit -k eddy_corrected -o dtifit -m bet_mask -r bvecs -b bvals dtifit will produce 9 output files:
    • dtifit_S0.nii.gz - b0 image (FSL calls this "S0" instead)
    • dtifit_FA.nii.gz - FA image
    • dtifit_MD.nii.gz - mean diffusivity image
    • dtifit_L1...L3 - primary, secondary, tertiary eigenvalues
    • dtifit_V1...V3 - primary, secondary, tertiary eigenvectors

    You can then use these files as input to produce a "DT6" file, as described in the next section.

    Note: you may want to check out CATNAP. I think it uses the FSL tools, but wraps them in some nice matlab GUI code to facilitae all of these steps.

[edit] Create DT6 File

    The next step is to create a DT6 file for use with our interactive visualization software. This processing is done inside Matlab using the mrVista tools. This step also depends on some tools from SPM (SPM2 or SPM5). Make sure you have both mrVista and SPM2 or SPM5 installed in your path. To make the DT6 file, use the dtiMakeDt6FromFsl function:
      dtiMakeDt6FromFsl([b0FileName], [t1FileName])

    This function takes a set of images from FSL's DTI image files and saves them out in a dt6 matlab file. You should specify the FSL S0 (usually b=0) file as input (a file dialog will pop-up if you don't).

    If you also supply a t1 image (optionally), then the function attempts to align the DTI image to this image. If it is omitted, then no spatial transform will be performed. If you do supply a t1, it's best if the ac-pc alignment is set propery. For NIFTI files, you can use our mrAnatSetNiftiXform function (in the VISTASOFT Anatomy tools).

Personal tools