Skip to content

mrphysics-bonn/AxonDiameter

Repository files navigation

AxonDiameter

This is a preprocessing pipeline for axon diameter mapping using very high b-values. The preprocessing pipeline can be used for both spiral and EPI data.
The repository also contains the source code of the Pulseq sequence, as well as the Pulseq sequence file in the subfolder "seq".

Instructions

Sequence

The Pulseq sequence can be generated by running the script "write_spiral.py" within the directory "seq/src". The required dependencies can be installed with the provided yml file ("seq/axon_seq.yml").

Preprocessing pipeline

A working docker container containing all software dependencies listed below and example anonomized data can be pulled by running:

docker pull mavel101/axon_mapping

The docker container requires both a valid Matlab license (incl. Image Processing & Parallel Computing toolbox) and the Nvidia container toolkit for GPU usage. The container can be started by running:

docker run -it --rm --gpus all -v /path/to/matlab/license/file:/licenses/license.lic -e MLM_LICENSE_FILE=/licenses/license.lic mavel101/axon_mapping bash

The path to the Matlab license file has to be exchanged. Inside the container the spiral/EPI pipeline can be run using:

cd ~/AxonDiameter
./run_spiral.sh or ./run_epi.sh

The example pipeline does not include the gradient unwarping (step 6) as a proprietary file is needed. Instead the already processed data is found in the data folder ("~/AxonDiameter/data") of the container. Also T1 brain extraction is omitted, as the example data is already brain extracted due to anonomization purposes.

The main processing pipeline is implemented in two shell scripts for spiral and EPI data:

  • Processing for spiral data can be started running scripts/process_spiral.sh #IN_FILE.
  • Processing for EPI data can be started running scripts/process_epi.sh #IN_FILE #IN_FILE_PA.
  • With option "-t" a T1 image can be provided to do white matter segmentation and along-tract evaluation of the axon diameter.
  • Option "-e" selects a maximum-likelihood estimation for spherical harmonic fitting insted of denoising the data directly
  • Option "-m" converts spiral data from complex to magnitude before denoising.

Before processing EPI data, the b-vectors should be corrected with the submodule "correctBmatrixOverflow", which corrects for an integer overflow leading to partly wrong b-vectors. Resulting b-vectors have to be transformed to Nifti space with the function "transformForNifti".

Preprocessing & Axon diameter calculation

  1. Denoising (MRtrix3: "dwidenoise") [1]. If the maximum-likelihood estimator is used for spherical harmonic decomposition (step 8), the denoising is only done to get the noise map.

  2. Convert to magnitude data ("nifti2mag.py")

  3. Gibbs Ringing removal (MRtrix3: "mrdegibbs") [2]

  4. EPI:

    • TOPUP (FSL) [3]
    • Eddy (FSL) [4,5,6]
  5. Spiral

    • Motion correction (FSL Eddy)
  6. Gradient nonlinearity correction (needs scanner specific proprietary file containing the coefficients of the gradient system) [7,8]

  7. Brain masking (Antspy & Antspynet) [9]

  8. Spherical harmonic decomposition to get spherical average per shell & per voxel (MRtrix3: amp2sh [11] or maximum-likelihood estimator [18])

  9. Take the 0th order spherical harmonic and divide by $\sqrt{4\pi}$ to get the powder average [10]

  10. Calculate axon radius maps [12,13]

  11. Calculate relative SNR maps

  12. White matter masking of axon radius maps (FSL FAST [14] & FSL FLIRT [15, 16])

  13. Along-fibre quantification currently only along the left CST (using Dipy & pyAFQ for along-fibre quantification [17,19] and MrTrix for tractography [11])

Requirements

  • MRtrix3 (needs up to commit 3853c58 from https://github.com/lukeje/mrtrix3, that fixes a bug in the Rician bias correction)
  • FSL v6.0.7.3 (older version might work)
  • gradunwarp (included submodule)
  • AxonRadiusMapping (included submodule)
  • Python 3.8 (incl. Numpy, Nibabel 3.2.2 (< version 4))
  • Matlab R2019b
  • Antspy v0.3.8
  • Antspynet v0.2.3
  • Dipy v1.7.0
  • PyAFQ v1.1
  • nipype v1.8.6

References

  1. Cordero-Grande, L. et. al. Complex diffusion-weighted image estimation via matrix recovery under general noise models. NeuroImage, 2019, 200, 391-404, doi: 10.1016/j.neuroimage.2019.06.039

  2. Kellner, E; Dhital, B; Kiselev, V.G & Reisert, M. Gibbs-ringing artifact removal based on local subvoxel-shifts. Magnetic Resonance in Medicine, 2016, 76, 1574–1581

  3. Jesper L. R. Andersson and Stamatios N. Sotiropoulos. An integrated approach to correction for off-resonance effects and subject movement in diffusion MR imaging. NeuroImage, 125:1063-1078, 2016.

  4. Jesper L. R. Andersson and Stamatios N. Sotiropoulos. An integrated approach to correction for off-resonance effects and subject movement in diffusion MR imaging. NeuroImage, 125:1063-1078, 2016.

  5. Jesper L. R. Andersson, Mark S. Graham, Eniko Zsoldos and Stamatios N. Sotiropoulos. Incorporating outlier detection and replacement into a non-parametric framework for movement and distortion correction of diffusion MR images. NeuroImage, 141:556-572, 2016.

  6. Jesper L. R. Andersson, Mark S. Graham, Ivana Drobnjak, Hui Zhang, Nicola Filippini and Matteo Bastiani. Towards a comprehensive framework for movement and distortion correction of diffusion MR images: Within volume movement. NeuroImage, 152:450-466, 2017.

  7. Janke, A., et al. Use of spherical harmonic deconvolution methods to compensate for nonlinear gradient effects on MRI images, MRM, 2004;52(1):115-122

  8. Glasser, M. et. al. The minimal preprocessing pipelines for the Human Connectome Project. Neuroimage, 2013;80:105-24

  9. Cullen N.C., Avants B.B. (2018) Convolutional Neural Networks for Rapid and Simultaneous Brain Extraction and Tissue Segmentation. In: Spalletta G., Piras F., Gili T. (eds) Brain Morphometry. Neuromethods, vol 136. Humana Press, New York, NY

  10. Afzali, et al. Computing the orientational-average of diffusion-weighted MRI signals: a comparison of different techniques. Scientific Reports, 11:14345, 2021

  11. Tournier, J.-D. et. al.. MRtrix3: A fast, flexible and open software framework for medical image processing and visualisation. NeuroImage, 2019, 202, 116137

  12. Veraart, J. et. al. Noninvasive quantification of axon radii using diffusion MRI, eLife, 9:e49855, 2020

  13. Veraart, J. et. al. The variability of MR axon radii estimates in the human white matter, Human Brain Mapping, 42:2201–2213, 2021

  14. Zhang, Y. and Brady, M. and Smith, S. Segmentation of brain MR images through a hidden Markov random field model and the expectation-maximization algorithm. IEEE Trans Med Imag, 20(1):45-57, 2001.

  15. M. Jenkinson and S.M. Smith. A global optimisation method for robust affine registration of brain images. Medical Image Analysis, 5(2):143-156, 2001.

  16. M. Jenkinson, P.R. Bannister, J.M. Brady, and S.M. Smith. Improved optimisation for the robust and accurate linear registration and motion correction of brain images. NeuroImage, 17(2):825-841, 2002.

  17. Yeatman, Jason D., Robert F. Dougherty, Nathaniel J. Myall, Brian A. Wandell, and Heidi M. Feldman. 2012. “Tract Profiles of White Matter Properties: Automating Fiber-Tract Quantification” PloS One 7 (11): e49790.

  18. Sijbers, J., den Dekker, A. J., Scheunders, P., & Van Dyck, D. (1998). Maximum-likelihood estimation of Rician distribution parameters. IEEE Transactions on Medical Imaging, 17(3), 357–361.

  19. Kruper, J., Yeatman, J. D., Richie-Halford, A., Bloom, D., Grotheer, M., Caffarra, S., Kiar, G., Karipidis, I. I., Roy, E., Chandio, B. Q., Garyfallidis, E., & Rokem, A. Evaluating the Reliability of Human Brain White Matter Tractometry. DOI:10.52294/e6198273-b8e3-4b63-babb-6e6b0da10669