MRtrix3 / mrtrix3

MRtrix3 provides a set of tools to perform various advanced diffusion MRI analyses, including constrained spherical deconvolution (CSD), probabilistic tractography, track-density imaging, and apparent fibre density
http://www.mrtrix.org
Mozilla Public License 2.0
294 stars 181 forks source link

dwigradcheck: Enhancements #2902

Open Lestropie opened 6 months ago

Lestropie commented 6 months ago

Am currently in the process of generating data & analyses for verifying the handling of DWI metadata, both raw and derivative, both slice / phase encoding and gradient table (especially with the pesky bvec esoterics). Am aiming particularly for resolution of #2477 and for verifying correct interpretation of subsequently derived diffusion model fibre orientations in https://github.com/bids-standard/bids-bep016.

A known limitation of the original implementation of dwigradcheck is that it considered exclusively axis permutations and flips. It failed to consider the prospect of a historically common misunderstanding where a user believed dw_scheme and bvec/bvals to be merely transposes of one another, and would therefore apply that operation erroneously. Here I've finally gotten around to addressing this. In retrospect it was not the most crucial of enhancements for me to put effort into, given that the dataset I'm working with always has image axes aligned with the scanner axes, but it was nevertheless annoying that the command was doing twice as much work as it needed to in that case. Plus I wanted to have the command emit a non-zero return code if it considers the input gradient table to be incorrect, as this allows me to use it for automated verification of metadata handling.

github-actions[bot] commented 6 months ago

clang-tidy review says "All clean, LGTM! :+1:"

dchristiaens commented 6 months ago

I presume the title should say "dwigradcheck" instead of "dwishellmath"?

Lestropie commented 6 months ago

🤦‍♂️