Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More robust bvecs/bvals compatibility #2602

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

Lestropie
Copy link
Member

Potential solution to #2577. Not a unique solution, but works for me, and the warning message is generated appropriately.

@araikes want to test?

Where the gradient direction vector is zero, but the b-value is non-zero, when FSL's "eddy" attempts to rotate the directions of b>0 volumes according to subject rotation, this results in corrupted gradient directions.
This change prevents such data from reaching "eddy" within dwifslpreproc, by detecting volumes where the gradient vector is zero and the b-value is non-zero but is classified by MRtrix3 as non-zero based on BZeroThreshold and forcing the value within the bvals file to be zero.
Relates to #2577.
@araikes
Copy link

araikes commented Mar 15, 2023

@Lestropie generating a Singularity image for that branch to test today.

@araikes
Copy link

araikes commented Mar 15, 2023

That works. dwifslpreproc produces a valid gradient table (including the variability around the non-zero shell values). Additionally dwigradcheck exports the b-values with 0's.

@Lestropie Lestropie marked this pull request as ready for review March 15, 2023 22:49
@Lestropie Lestropie requested a review from a team March 15, 2023 22:49
@Lestropie Lestropie added this to the 3.0.5 updates milestone Sep 16, 2024
@Lestropie Lestropie changed the title -export_grad_fsl: Clamp some b-values to zero More robust bvecs/bvals compatibility Feb 12, 2025
@Lestropie
Copy link
Member Author

Scope of PR has been expanded from just "clamp b-values interpreted by MRtrix3 as b=0 to a value of 0 when exporting bvals" to "change bvecs&bvals import/export for more robust interplay with FSL", closing #2577 in the process. The new tests (here attributed to mrinfo, but on dev can be more appropriately named) demonstrate the circumstances in which NaN values present in bvecs&bvals are / are not permissible.

Lestropie added a commit that referenced this pull request Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants