Skip to content

More robust bvecs/bvals compatibility#2602

Merged
daljit46 merged 7 commits intomasterfrom
bval_clamp_zero
Apr 9, 2025
Merged

More robust bvecs/bvals compatibility#2602
daljit46 merged 7 commits intomasterfrom
bval_clamp_zero

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
@jdtournier
Copy link
Member

Ok, that one took a bit of fixing up for the merge. It might be wise to run this PR through your testing again, unless that's already all taken care of with a regular ./run_test binaries run?

@jdtournier
Copy link
Member

This seems to work as expected in my (limited) testing - happy to approve. But someone else will need to approve before we can merge...

@daljit46 daljit46 enabled auto-merge April 9, 2025 08:05
@daljit46 daljit46 added this pull request to the merge queue Apr 9, 2025
Merged via the queue into master with commit 7843bfc Apr 9, 2025
5 checks passed
@daljit46 daljit46 deleted the bval_clamp_zero branch April 9, 2025 09:22
Lestropie added a commit that referenced this pull request Jun 18, 2025
Code error introduced in cf7e637 as part of #2602.
@Lestropie Lestropie mentioned this pull request Sep 2, 2025
Lestropie added a commit that referenced this pull request Sep 3, 2025
- #2968: Absent
- #3049: Absent
- #2767: Partially absent
- # 3027: Almost all absent (the new tests were in place but that was all)
- #3047: Absent
- #3071: Absent
- #3011: Fill in gaps of changes that were applied to #3011 prior to its derivation from #2917.
- #2609: Fixed a couple of small omissions.
- #2602: Bits and pieces missing.
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.

5 participants