Skip to content

Conversation

@ebald19
Copy link
Contributor

@ebald19 ebald19 commented May 26, 2025

Relating to this issue

Issue

The header values for RescaleSlope and RescaleIntercept were being overwritten to convert the image density to HU. This caused a mismatch between original data and output data on write.

Proposed Changes:

  • Remove overwrite of read in rescale data values in member variables [m_RescaleSlope, m_RescaleIntercept]
  • move HU conversion to inside RescaleToHU function
  • use RescaleToHU as member function which only rescales member data within function scope
  • Adjust test cases to match correct RescaleSlope and RescaleIntercept values

These changes maintain the original header data, and use HU-corrected values only when converting the image data to HU. They also update the header tests to check that the values are maintained as original.

See below for the Scanco read original header values for the test images:

Screenshot 2025-05-26 at 9 31 14 AM Screenshot 2025-05-26 at 9 52 36 AM

@dzenanz dzenanz requested a review from mkuczyns May 26, 2025 16:57
Copy link
Member

@dzenanz dzenanz left a comment

Choose a reason for hiding this comment

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

Looks good on a glance.

@ebald19 ebald19 marked this pull request as ready for review May 26, 2025 18:00
@mkuczyns
Copy link
Collaborator

@dzenanz: Erica (@ebald19) is working with our group over the summer to update the ITKIOScanco module. The PR looks good to me :)

@hjmjohnson hjmjohnson merged commit 18f347c into InsightSoftwareConsortium:main May 27, 2025
2 of 20 checks passed
@ebald19 ebald19 deleted the enhancement/aim-reader-fixes branch June 25, 2025 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants