Skip to content

Conversation

@Lestropie
Copy link
Member

Initially thought that this was a minor annoyance that only affected specific data, but turns out to have been more widespread. See description in 568b28e.

3.0.5 fails the second of the three new tests. Problem introduced in #3027, so 3.0.4 unaffected.

Even if concatenating two 4D series along the volume axis, where the two gradient tables should be stacked atop one another, mrcat produces a warning about an inability to merge gradient tables. The appropriately concatenated gradient table would still be present in the output image, it would just be an erroneous warning at the terminal.

Involves an addition of test data (in retrospect wasn't strictly necessary, but might be of use elsewhere); so master branch on test_data repo should be forwarded upon PR merge.

Lestropie added 2 commits June 5, 2025 16:44
Erroneous warning issued in circumstance where DWIs are being concatenated along the volume axis and have different phase encoding tables.
Following #3027 in version 3.0.5, commands could produce an erroneous warning whenever concatenating images along the volume axis where those images contained diffusion gradient tables that did not match. Where concatenation occurrs along the volume axis, the gradient table itself gets concatenated rows. This was operating correctly, but underlying function Header::merge_keyval() was issuing erroneous earnings regarding an inability to merge the gradient tables directly prior to the concatenation operation taking place. This could occur if using the multi-file numbered image capability acorss volumes, or if concatenating across image series that contain different gradient tables.
@Lestropie Lestropie requested a review from a team June 5, 2025 10:31
@Lestropie Lestropie self-assigned this Jun 5, 2025
@Lestropie Lestropie added the bug label Jun 5, 2025
@jdtournier jdtournier added this to the 3.0.6 milestone Jun 18, 2025
@Lestropie
Copy link
Member Author

Just to aid in review:
Here's what you get if you do run_tests mrcat on 3.0.5:

# command: mrconvert dwi.mif tmp-[].mif && testing_diff_image tmp-[].mif dwi.mif [ ok ]
mrconvert: copying from "dwi.mif" to "tmp-[].mif"... [==================================================]
testing_diff_image: [WARNING] Error merging DW gradient tables between headers
testing_diff_image: [WARNING] Error merging DW gradient tables between headers
testing_diff_image: [WARNING] Error merging DW gradient tables between headers
testing_diff_image: [WARNING] Error merging DW gradient tables between headers
testing_diff_image: [WARNING] Error merging DW gradient tables between headers
testing_diff_image: [WARNING] Error merging DW gradient tables between headers
testing_diff_image: [WARNING] Error merging DW gradient tables between headers
testing_diff_image: [WARNING] Error merging DW gradient tables between headers
testing_diff_image: [WARNING] Error merging DW gradient tables between headers
testing_diff_image: [WARNING] Error merging DW gradient tables between headers
testing_diff_image: [WARNING] Error merging DW gradient tables between headers
testing_diff_image: [WARNING] Error merging DW gradient tables between headers
testing_diff_image: [WARNING] Error merging DW gradient tables between headers
testing_diff_image: [WARNING] Error merging DW gradient tables between headers
testing_diff_image: [WARNING] Error merging DW gradient tables between headers
testing_diff_image: [WARNING] Error merging DW gradient tables between headers
testing_diff_image: [WARNING] Error merging DW gradient tables between headers
testing_diff_image: [WARNING] Error merging DW gradient tables between headers
testing_diff_image: [WARNING] Error merging DW gradient tables between headers
testing_diff_image: [WARNING] Error merging DW gradient tables between headers
testing_diff_image: [WARNING] Error merging DW gradient tables between headers
testing_diff_image: [WARNING] Error merging DW gradient tables between headers
testing_diff_image: [WARNING] Error merging DW gradient tables between headers
testing_diff_image: [WARNING] Error merging DW gradient tables between headers
testing_diff_image: [WARNING] Error merging DW gradient tables between headers
testing_diff_image: [WARNING] Error merging DW gradient tables between headers
testing_diff_image: [WARNING] Error merging DW gradient tables between headers
testing_diff_image: [WARNING] Error merging DW gradient tables between headers
testing_diff_image: [WARNING] Error merging DW gradient tables between headers
testing_diff_image: [WARNING] Error merging DW gradient tables between headers
testing_diff_image: [WARNING] Error merging DW gradient tables between headers
testing_diff_image: [WARNING] Error merging DW gradient tables between headers
testing_diff_image: [WARNING] Error merging DW gradient tables between headers
testing_diff_image: [WARNING] Error merging DW gradient tables between headers
testing_diff_image: [WARNING] Error merging DW gradient tables between headers
testing_diff_image: [WARNING] Error merging DW gradient tables between headers
testing_diff_image: [WARNING] Error merging DW gradient tables between headers
testing_diff_image: [WARNING] Error merging DW gradient tables between headers
testing_diff_image: [WARNING] Error merging DW gradient tables between headers
testing_diff_image: [WARNING] Error merging DW gradient tables between headers
testing_diff_image: [WARNING] Error merging DW gradient tables between headers
testing_diff_image: [WARNING] Error merging DW gradient tables between headers
testing_diff_image: [WARNING] Error merging DW gradient tables between headers
testing_diff_image: [WARNING] Error merging DW gradient tables between headers
testing_diff_image: [WARNING] Error merging DW gradient tables between headers
testing_diff_image: [WARNING] Error merging DW gradient tables between headers
testing_diff_image: [WARNING] Error merging DW gradient tables between headers
testing_diff_image: [WARNING] Error merging DW gradient tables between headers
testing_diff_image: [WARNING] Error merging DW gradient tables between headers
testing_diff_image: [WARNING] Error merging DW gradient tables between headers
testing_diff_image: [WARNING] Error merging DW gradient tables between headers
testing_diff_image: [WARNING] Error merging DW gradient tables between headers
testing_diff_image: [WARNING] Error merging DW gradient tables between headers
testing_diff_image: [WARNING] Error merging DW gradient tables between headers
testing_diff_image: [WARNING] Error merging DW gradient tables between headers
testing_diff_image: [WARNING] Error merging DW gradient tables between headers
testing_diff_image: [WARNING] Error merging DW gradient tables between headers
testing_diff_image: [WARNING] Error merging DW gradient tables between headers
testing_diff_image: [WARNING] Error merging DW gradient tables between headers
testing_diff_image: [WARNING] Error merging DW gradient tables between headers
testing_diff_image: [WARNING] Error merging DW gradient tables between headers
testing_diff_image: [WARNING] Error merging DW gradient tables between headers
testing_diff_image: [WARNING] Error merging DW gradient tables between headers
testing_diff_image: [WARNING] Error merging DW gradient tables between headers
testing_diff_image: [WARNING] Error merging DW gradient tables between headers
testing_diff_image: [WARNING] Error merging DW gradient tables between headers
testing_diff_image: data checked OK

Code on this PR:

# command: mrconvert dwi.mif tmp-[].mif && testing_diff_image tmp-[].mif dwi.mif [ ok ]
mrconvert: copying from "dwi.mif" to "tmp-[].mif"... [==================================================]
testing_diff_image: data checked OK

Copy link
Member

@jdtournier jdtournier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Took me a while, but it all makes sense, happy to merge.

@jdtournier jdtournier added this pull request to the merge queue Jun 24, 2025
Merged via the queue into master with commit 2c76329 Jun 24, 2025
5 checks passed
@jdtournier jdtournier deleted the mrcat_dwscheme_warning branch June 24, 2025 14:17
Lestropie pushed a commit that referenced this pull request Aug 26, 2025
Suppress erroneous warning RE merging of gradient table
@Lestropie Lestropie restored the mrcat_dwscheme_warning branch August 26, 2025 08:11
@Lestropie Lestropie deleted the mrcat_dwscheme_warning branch August 27, 2025 00:25
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.

3 participants