Skip to content

[pixeldata] Add support for PixelFirst planar configuration (#129)#575

Merged
Enet4 merged 1 commit intoEnet4:masterfrom
abustany:129-planar-config
Oct 25, 2024
Merged

[pixeldata] Add support for PixelFirst planar configuration (#129)#575
Enet4 merged 1 commit intoEnet4:masterfrom
abustany:129-planar-config

Conversation

@abustany
Copy link
Copy Markdown
Contributor

Hi,

this PR adds a very simple interleave function to handle planar pixel configurations when decoding pixel data. I only have planar RGB8 files to test, but I don't see why 16-bit files would behave very differently...

The interleave implementation is very simple, but seems to yield decent performance (30ms to interleave a 12MP image on my 10 year old laptop). I experimented with a more "imperative" version with for loops which ended up being slower (probably because of bound checks), and a simple SSE implementation based on mm_shuffle_epi8 wasn't significantly faster either.

@Enet4 Enet4 self-requested a review October 22, 2024 11:09
@Enet4 Enet4 linked an issue Oct 22, 2024 that may be closed by this pull request
@Enet4 Enet4 added A-lib Area: library C-pixeldata Crate: dicom-pixeldata labels Oct 22, 2024
Copy link
Copy Markdown
Owner

@Enet4 Enet4 left a comment

Choose a reason for hiding this comment

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

The code is sound and clean. I would not worry too much about optimizing it aggressively at this time. It is great to have support for the pixel first planar configuration. Much appreciated! 👍

@Enet4 Enet4 merged commit c82ccc6 into Enet4:master Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-lib Area: library C-pixeldata Crate: dicom-pixeldata

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Account for Planar Configuration

2 participants