Skip to content

Fix native floating-point frame decoding - #441

Merged
CPBridge merged 1 commit into
ImagingDataCommons:masterfrom
yinkev:bugfix/lazy-float-pixel-frames
Jul 26, 2026
Merged

CPBridge merged 1 commit into
ImagingDataCommons:masterfrom
yinkev:bugfix/lazy-float-pixel-frames

Conversation

@yinkev

@yinkev yinkev commented Jul 25, 2026 •

Copy link
Copy Markdown
Contributor

Closes #436.

Summary

  • decode native FloatPixelData and DoubleFloatPixelData frames through ImageFileReader
  • pass the detected pixel-data keyword into the shared frame decoder
  • avoid requiring integer-only BitsStored and PixelRepresentation attributes for floating-point pixel modules
  • add multi-frame float32 and float64 regression coverage, including negative fractional values

Root cause

ImageFileReader detected floating-point pixel tags while scanning the file, but read_frame() discarded that information. It then required integer Pixel Data attributes and called decode_frame() with its integer default keyword, so valid floating-point DICOM images failed before decoding.

Validation

  • regression fails on upstream/master with missing BitsStored
  • python -B -m pytest tests/test_io.py::TestImageFileReader::test_read_float_pixel_data -q
  • full tests/test_io.py: 111 passed, 9 skipped
  • repository-documented pytest --flake8: 2,022 passed, 178 expected optional-dependency skips
  • python -B -m flake8 src/highdicom/io.py tests/test_io.py
  • git diff --check

Signed-off-by: kyinhub <kevinpyin@gmail.com>
@yinkev
yinkev force-pushed the bugfix/lazy-float-pixel-frames branch from e917d14 to 11542a5 Compare July 26, 2026 02:23

@CPBridge CPBridge left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for catching this

@CPBridge
CPBridge merged commit d102ef9 into ImagingDataCommons:master Jul 26, 2026
13 checks passed
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.

ImageFileReader fails to decode native floating-point pixel data

2 participants