I’m new to MRtrix3 and tractography analysis, and I’d like to share my code with this community for feedback. Currently my data is a single shell diffusion (b value =1500).
Motion and distortion correction a. mrconvert dicom_dwi-b0_acq-acc6_dir-AP_20230511121012_9.nii AP.mif b. mrconvert AP.mif - | mrmath - mean mean_b0_AP.mif -axis 3 c. dwiextract dwi_den_unr_with_gradients.mif - -bzero | mrmath - mean mean_b0_PA.mif -axis 3 d. mrcat mean_b0_PA.mif mean_b0_AP.mif –axis 3 b0_pair.mif e. dwifslpreproc dwi_den_unr_with_gradients.mif dwi_den_unr_preproc.mif -nocleanup -pe_dir PA -rpe_pair -se_epi b0_pair.mif -eddy_options " --slm=linear "
Bias field Correction dwibiascorrect ants dwi_den_unr_preproc.mif dwi_den_unr_preproc_unbiased.mif -bias bias.mif
Brain mask estimation dwi2mask dwi_den_unr_preproc_unbiased.mif mask_den_unr_preproc_unb.mif
In this step, the dwi2mask command did not work as well and had a few holes. I used the following steps to change the default setting. mrconvert dwi_den_unr_preproc_unbiased.mif sub-02_unbiased.nii bet2 sub-02_unbiased.nii sub-02_masked_0.3 -m -f 0.3 mrconvert sub-02_masked_0.3_mask.nii.gz mask_0.3.mif
I am no expert in this field but I can share a few things I do for my own tractography since I have been working on this topic :
-From what I can see your pipeline seems quite nice but on the mask part I would advise using PCNN3D as I never good masks with dwi2mask (an easy to run MATLAB script is available for PCNN3D, Chuang's Lab - 3D PCNN), it is a brain segmentation algorithm trained for rodent data. If you’re using human data I am unsure if it would work or not but it’s worth to try (you could change hyperparameters such as expected brain size and thus try to fit your data?).
-Your unringing step uses mrdegibbs in 2D but I would rather switch to deGibbs3D made by jdtournier https://github.com/jdtournier/mrdegibbs3D (I believe it’s the 3D mode of mrdegibbs available in the dev branch of MRtrix3 according to the solution in [Mrdegibbs - 3D mode] topic of May 2024).
-Maybe you could input the lmax used by tournier algorithm in your dwi2response tournier. I personally use this table for lmax based on my number of directions :
Nb Dir
lmax
>=6 <15
2
>=15 <28
4
>=28 <66
6
>=66 <91
8
Hope this helps !
Also I am curious as to what kind of algorithm you are using for your tractography afterwards ? tckgen with iFOD2 ? Tensor_Det ? Any use of tcksift or tcksift2 ?
And any particular reasons why you are doing steps 8 to 10 based on the unbiased.mif ? Does it improve your resolution/the amount of streamlines/… ?
your pipeline looks fine, I will however update some steps:
If your acquisition is not a full k-space acquisition, let’s say you have a partial k-space coverage of 7/8 or 6/8, you could change to designer for this step. If your acquisitions is a 3d acquisition, you could use the 3d implemetation of mrdegibbs (as @A.Rossez mentioned)
Brain mask estimation
2.dwi2mask dwi_den_unr_preproc_unbiased.mif mask_den_unr_preproc_unb.mif
In this step, the dwi2mask command did not work as well and had a few holes. I used the following steps to change the default setting.
3.mrconvert dwi_den_unr_preproc_unbiased.mif sub-02_unbiased.nii
4.bet2 sub-02_unbiased.nii sub-02_masked_0.3 -m -f 0.3
5.mrconvert sub-02_masked_0.3_mask.nii.gz mask_0.3.mif
Assuming you have a structural image, I would compute the mask there and then register it to the diffusion space, or maybe use the new dwi2mask command (in the dev branch)
For the response function the recommended algorithm is dhollander even for single shell data, then you only use the csf and wm response functions in your following steps. Alternatively you can use SS3T.