mrtrix3 processes DTI data code - DWI data for probability tracking and cellulose tracking

Posted by padams on Mon, 20 Sep 2021 13:15:21 +0200

mrtrix3 processes DTI data code - DWI data for probability tracking and cellulose tracking

DWI pretreatment

1. Data preparation

DWI and T1 data of subjects were placed in the same folder / home/hitlab/hitlab/GS/data/tt1/text. The data type is DICOM format.

2. Data conversion

Principle description: the DICOM data of DWI is converted into mif format. mif format is the format customized by MRtrix, and stores image information, image header file and gradient information at the same time.

mrconvert /home/hitlab/hitlab/GS/data/tt1/text/DTI dwi.mif

In addition, if you convert. Nii.gz. Bvec. Bval file to. mif file, you can use

mrconvert -fslgrad bvecs.txt bvals.txt biascorr.nii biascorr.mif

Principle description: convert the T1 raw data DICOM collected from the magnetic resonance scanner into NIFTI format and use dcm2nii

dcm2nii /home/hitlab/hitlab/GS/data/tt1/text/DTI

3. Data denoising

Principle description: remove image thermal noise and increase signal-to-noise ratio SNR

dwidenoise dwi.mif dwi_denoised.mif

4. DWI data preprocessing

Principle description: including demagnetization sensitive artifact, eddy current induced artifact and motion effect. This step relies on FSL- rpe_header means to extract phase encoding from ab initio information for demagnetizing sensitive artifacts. If phase encoding is not used in the image, demagnetization sensitive artifacts are not required.

dwifslpreproc dwi_denoised.mif dwi_denoised_preproc.mif -rpe_header

5. Extract bo image

fslroi dwi.nii.gz b0.nii.gz 0 -1 0 -1 0 -1 0 1

6. Generate mask

Principle description: mask is generated to limit the scope of image analysis in the following steps, not outside the brain

dwi2mask dwi_denoised_preproc.mif dwi_mask.mif

7. Image signal standardization

Principle description: global intensity normalization mainly corrects the whole DWI image by estimating the non-uniformity of low-frequency signal of b0 image. Using FSL

Dwibiascorrect fsl dwi_denoised_preproc.mif dwi_denoise_preproc_bias.mif -mask dwi_mask.mif

QC: mrview dwi_denoised_preproc_bias.mif -roi.load dwi_mask.mif

8. Generate parameter graph

Principle description: the tensor file is estimated from DWI, and then various parameter diagrams are generated, including fractional anisotropy (FA), mean diffusivity (MD), axial diffusivity (AD) and radial diffusivity (RD).

dwi2tensor dwi_denoise_preproc_bias.mif tensor.mif 
tensor2metric -fa FA.nii.gz tensor.mif 
tensor2metric -adc MD.nii.gz tensor.mif
tensor2metric -ad AD.nii.gz tensor.mif
tensor2metric -rd RD.nii.gz tensor.mif

T1 pretreatment

1. Register T1 to DTI

Principle description: the main purpose of T1 is to locate the dMRI map. The advantage of registering T1 to DTI instead of DTI to T1 is that there is no need to adjust the direction of diffusion gradient. Firstly, T1 is registered to dMRI space (rigid body transformation + standard mutual information similarity + trilinear interpolation).

/usr/share/fsl/5.0/bin/flirt -in /home/hitlab/hitlab/GS/data/tt1/text/coT1.nii -ref /home/hitlab/hitlab/GS/data/tt1/text/b0.nii.gz -out /home/hitlab/hitlab/GS/data/tt1/text/r182 -omat /home/hitlab/hitlab/GS/data/tt1/text/r182.mat -bins 256 -cost normmi -searchrx -180 180 -searchry -180 180 -searchrz -180 180 -dof 6 -interp trilinear


2. Extracting ROI of region of interest

Principle description: this step needs to be customized by the user. For example, if the user wants to see the fibers passing through the bilateral pons, find the index es of the bilateral forebrain in the lookuptable, which are 133 and 134, and then generate the binary mask of the pons

fslmaths r182.nii.gz -thr 133 -uthr 134 -bin r182_roi1

Here - thr 133 is to ignore labels with grayscale less than 133, - uthr 134 is to ignore labels with answers greater than 134, and - bin is a binary operation

Fiber tracking (ROI based)

1. Method 1: using ROI as seed point for fiber tracking (DTI method)

tckgen dwi_denoised_preproc_bias.mif track_roi1.tck -algorithm Tensor_Det -select 2000 -mask dwi_mask.mif -seed_image r182_roi1.nii.gz

2. Method 2: using ROI as seed point for fiber tracking (CSD method)

tckgen wmfod.mif track_roi1.tck -seed_image r182_283Labels_roi1.nii.gz -mask dwi_mask.mif -select 2000

3. Extract fiber statistics

Principle description: the statistical values include the average length of fibers, the number of fibers, etc., and the results are returned directly by the console.
tckstats track_roi1.tck

Extract fiber DTI parameter value
Principle description: the generated text file includes the FA, MD, AD and RD mean values of each fiber bundle.

tcksample track_roi1.tck FA.nii.gz FA_roi1.txt -stat_tck mean
tcksample track_roi1.tck MD.nii.gz MD_roi1.txt -stat_tck mean
tcksample track_roi1.tck AD.nii.gz AD_roi1.txt -stat_tck mean
tcksample track_roi1.tck RD.nii.gz RD_roi1.txt -stat_tck mean

Fiber tracking (whole brain based)

1. Method 1: DTI method (default)

Principle description: if the dMRI data is scanned according to the DTI protocol, the conventional processing is modeled with tensor under the DTI framework. The advantages are small amount of computation and good interpretability. The disadvantage is that voxels with cross fibers are easy to catch up with the wrong fiber direction.

tckgen dwi_denoised_preproc_bias.mif track.tck -algorithm Tensor_Det -select 20000 -mask dwi_mask.mif -seed_image dwi_mask.mif

2. Method 2: CSD method

Principle description: CSD is a HARDI technology, which mainly carries out diffusion modeling for high b-value and multi gradient dMRI data. Firstly, the response function is estimated, which is the key to the next spherical deconvolution; Then the spherical deconvolution CSD is carried out. The spherical deconvolution model can estimate the dispersion distribution of each voxel, which is essentially different from the tensor triaxial estimation of DTI; Then, by default, the probabilistic fiber tracking method is used to randomly set seed points in the mask area, and the fiber bundle tracking is carried out from each seed point until the specified number of fiber bundles is completed; Finally, SIFT correction is carried out to remove some bad fibers, so that the number of local fibers is directly proportional to the real local nerve fiber density.

dwi2response tournier dwi_denoised_preproc_bias.mif response.txt
dwi2fod csd dwi_denoised_preproc_bias.mif response.txt wmfod.mif -mask dwi_mask.mif
tckgen wmfod.mif CSDtrack.tck -seed_image dwi_mask.mif -mask dwi_mask.mif -select 2000000
tcksift CSDtrack.tck wmfod.mif CSDtrack_sift.tck -term_number 100000

Here is the whole brain fiber tracking, - select is the number of fibers expected to be tracked, which can be customized by the user.

QC: tckedit CSDtrack_sift.tck track.tck -number 10000
mrview 182.nii.gz -tractography.load track.tck

The whole brain fiber tracking method was used to extract local fibers.

tckedit track.tck track_roi1.tck -include r182_roi1.nii.gz

3. Extract fiber statistics

Principle description: the statistical values include the average length of fibers, the number of fibers, etc., and the results are returned directly by the console.

tckstats track_roi1.tck

4. Extract fiber DTI parameter value

Principle description: the generated text file includes the FA, MD, AD and RD mean values of each fiber bundle.

tcksample track_roi1.tck FA.nii.gz FA_roi1.txt -stat_tck mean
tcksample track_roi1.tck MD.nii.gz MD_roi1.txt -stat_tck mean
tcksample track_roi1.tck AD.nii.gz AD_roi1.txt -stat_tck mean
tcksample track_roi1.tck RD.nii.gz RD_roi1.txt -stat_tck mean

Topics: Linux