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

[MRG] handle (0028,0101) "Bits Stored" in numpy handler #2026

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pbailey-hf
Copy link

@pbailey-hf pbailey-hf commented Mar 13, 2024

Describe the changes

Handle the "Bits Stored" tag when interpreting pixel data in the numpy handler.

Tasks

  • Unit tests added that reproduce the issue or prove feature is working
  • Fix or feature added
  • Code typed and mypy shows no errors
  • Documentation updated (if relevant)
  • Unit tests passing and overall coverage the same or better

@pbailey-hf
Copy link
Author

This addresses an issue similar to #1149 when interpreting pixel data with the numpy handler.

Copy link

codecov bot commented Mar 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.19%. Comparing base (5612f56) to head (b06c9a5).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2026   +/-   ##
=======================================
  Coverage   98.19%   98.19%           
=======================================
  Files          73       73           
  Lines       12203    12209    +6     
=======================================
+ Hits        11983    11989    +6     
  Misses        220      220           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pbailey-hf pbailey-hf changed the title [WIP] handle (0028,0101) "Bits Stored" in numpy handler [MRG] handle (0028,0101) "Bits Stored" in numpy handler Mar 14, 2024
@scaramallion
Copy link
Member

The current pixel_data_handlers backend is probably going to be deprecated in the v3.0 release, so this should really be added to the _apply_sign_correction() function in pixels.decoders.base with an updated DecodeRunner._test_for("sign_correction").

DICOM reference is Part 5, Section 8. One thing I haven't noticed before (in relation to the High Bit value):

Receiving applications may not assume anything about the contents of unused bits, and in particular may not assume that they are zero, or that they contain sign extension bits.

This may end up causing some issues with the way view_only works, annoyingly...

@pbailey-hf
Copy link
Author

Thanks for the feedback. I'll rework it soon.

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.

None yet

2 participants