Skip to content

dwigradcheck: Enhancements#2902

Open
Lestropie wants to merge 3 commits intodevfrom
dwigradcheck_enhancements
Open

dwigradcheck: Enhancements#2902
Lestropie wants to merge 3 commits intodevfrom
dwigradcheck_enhancements

Conversation

@Lestropie
Copy link
Copy Markdown
Member

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.

Previously, alterations to the gradient table were evaluated exclusively based on axis permutations and flips, in either the real / scanner space or bvec basis. With this change, the command can additionally consider the prospect where the gradient table has been erroneously interpreted as containing coefficients in one basis when in fact those values should have been interpreted in the other basis. This error can be in addition to possible axis permutations and/or flips in one of the two bases.
Further, the command will now yield a non-zero return code if it is determined to be likely that the input gradient table is inappropriate.
@github-actions
Copy link
Copy Markdown

clang-tidy review says "All clean, LGTM! 👍"

@dchristiaens
Copy link
Copy Markdown
Member

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

@Lestropie Lestropie changed the title dwishellmath: Enhancements dwigradcheck: Enhancements May 13, 2024
@Lestropie
Copy link
Copy Markdown
Member Author

🤦‍♂️

Conflicts:
	docs/reference/commands/dwigradcheck.rst
	python/mrtrix3/commands/dwigradcheck.py
	testing/scripts/CMakeLists.txt
@github-actions
Copy link
Copy Markdown

clang-tidy review says "All clean, LGTM! 👍"

- Re-generate command documentation.
- Resolve additions to CLI with augmentations to Python CLI in #2678.
- Resolve some poorly formed code logic identified by pylint.
- Improve progressbar appearance when not printing to a terminal, consistent with #3137.
- Fix export of optimal gradient table.
- Increase tolerance on default test: because a greater spectrum of gradient table alterations are now possible, it is more probable that a table that is not precisely equivalent to the unmodified table will be selected due to chance, but this should not lead to test failure given the stochasticity of the command and the relatively small number of streamlines.
@github-actions
Copy link
Copy Markdown

clang-tidy review says "All clean, LGTM! 👍"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants