Skip to content

BUG: Match planar DICOM pixel byte order to the transfer syntax - #1250

Open
galafis wants to merge 1 commit into
imageio:masterfrom
galafis:fix-planar-dicom-byte-order
Open

galafis wants to merge 1 commit into
imageio:masterfrom
galafis:fix-planar-dicom-byte-order

Conversation

@galafis

@galafis galafis commented Oct 24, 2026

Copy link
Copy Markdown

Fixes #1249.

Planar writing packs the source array bytes directly, so a uint16 array can be written under a DICOM transfer syntax with the opposite byte order and read back with changed pixel values. Resolve the transfer syntax before packing and convert to its byte order.

The synthetic round-trip regression covers both source byte orders and both little/big-endian transfer syntaxes. Before the fix, two mismatched-order cases fail while two matching-order controls pass. After the fix, the pydicom plugin tests pass without remote fixtures (23 passed, 10 skipped with -m "not needs_internet"). Python 3.12.14, NumPy 2.5.4, pydicom 3.0.2, ImageIO 2.38.1. Format and diff checks pass. No full-plugin or full-package suite pass is claimed.

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.

pydicom planar writer stores source byte order under a different transfer syntax

1 participant