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

Tolerance for dw_scheme differences on header merge #3027

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

Conversation

Lestropie
Copy link
Member

Closes #3015.

As part of this change, I decided that the "b=0 threshold" is more appropriate in dwi/gradient.h rather than dwi/shells.h, since it may be applied to individual volumes rather than shells. Here it's used to say "if two images both have a b=0 volume here, then their diffusion gradient tables are compatible; I don't care if their unit directions are different".

Also fixed some transitive includes in the process.

The new tests should hopefully demonstrate the fix:

  • Without this PR, the two "dw_scheme" entries only have to differ by one least significant digit to result in the whole diffusion gradient table being discarded.
  • But conversely, if two images undergo an operation and their diffusion gradient tables are totally incompatible, it'll still be dropped.

(They also neatly demonstrate why having just a list of tests per command is restrictive;
with ctest I'll be able to name these tests according to what they are actually evaluating,
which isn't specific to any one command)

This prevents the diffusion gradient table from being discarded when merging the key-value contents of two image headers (eg. mrcalc, mrmath) due to inconsequential differences in their string representations from floating-point imprecision.
Closes #3015.
@Lestropie Lestropie added the bug label Oct 22, 2024
@Lestropie Lestropie added this to the 3.0.5 updates milestone Oct 22, 2024
@Lestropie Lestropie requested a review from a team October 22, 2024 03:47
@Lestropie Lestropie self-assigned this Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add tolerance to gradient table mismatch on header merge
1 participant