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

Change monochrome reinterpretation requirements from pixel data readers #498

Merged
merged 3 commits into from
Apr 14, 2024

Conversation

Enet4
Copy link
Owner

@Enet4 Enet4 commented Apr 13, 2024

This fixes a mismatch between the pixel data readers' monochrome output and the way that said output was being used, thus fixing cases where the photometric interpretation was being erroneously changed from MONOCHROME1 to MONOCHROME2 for encapsulated pixel data.

Summary

  • [encoding] (change) change expectations of PixelDataReader to match implementations
    • When decoding monochrome images, decode and decode_frame should retain the photometric interpretation of the source object (monochrome1 or monochrome2)
      This is the most intuitive approach with less effort for decoders. It does not apply to GDCM integration though, which will convert monochrome1 images to monochrome2.
  • [pixeldata] fix photometric interpretation reset after pixel data decoding
    • decoding a monochrome image no longer implies a change to the photometric interpretation

…mplementations

When decoding monochrome images,
  `decode` and `decode_frame`
  should retain the photometric interpretation
  of the source object
  (monochrome1 or monochrome2)
This is the most intuitive approach with less effort for decoders.

Plus clarify that the frame index is 0-based
…oding

- decoding a monochrome image
  no longer implies a change to the photometric interpretation
@Enet4 Enet4 added bug This is a bug breaking change Hint that this may require a major version bump on release A-lib Area: library C-encoding Crate: dicom-encoding C-pixeldata Crate: dicom-pixeldata labels Apr 13, 2024
@Enet4 Enet4 added this to the DICOM-rs 0.7 milestone Apr 13, 2024
- gdcm decoder will also convert monochrome1 to monochrome2
@Enet4 Enet4 merged commit 41687d7 into master Apr 14, 2024
4 checks passed
@Enet4 Enet4 deleted the change/monochrome-reinterpretation branch April 14, 2024 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lib Area: library breaking change Hint that this may require a major version bump on release bug This is a bug C-encoding Crate: dicom-encoding C-pixeldata Crate: dicom-pixeldata
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant