Skip to content

Fix bit_allocation 1 for decode_pixel_data#668

Merged
Enet4 merged 13 commits intoEnet4:masterfrom
Cryt1c:segmentation-fix
Aug 14, 2025
Merged

Fix bit_allocation 1 for decode_pixel_data#668
Enet4 merged 13 commits intoEnet4:masterfrom
Cryt1c:segmentation-fix

Conversation

@Cryt1c
Copy link
Copy Markdown
Contributor

@Cryt1c Cryt1c commented Jul 28, 2025

#654 only implemented bit_allocation == 1 for decode_pixel_data_frame(index) but missed it for decode_pixel_data().

  1. Added the code to decode_pixel_data() for data with bit_allocation == 1
  2. Added a test for decode_pixel_data() for data with bit_allocation == 1

BTW: Is decode_pixel_data() the same as decode_pixel_data(0)?

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.

Oof! Thank you for spotting this nevertheless!

BTW: Is decode_pixel_data() the same as decode_pixel_data(0)?

It is not. :) decode_pixel_data will take and decode all pixel data found in the file (all frames!), which may be useful if the intent is to build a voxel volume. Working each frame one by one through the other method will be more efficient.

Cryt1c and others added 2 commits July 29, 2025 11:09
Co-authored-by: Eduardo Pinho <enet4mikeenet@gmail.com>
Co-authored-by: Eduardo Pinho <enet4mikeenet@gmail.com>
@Cryt1c Cryt1c requested a review from Enet4 July 29, 2025 09:13
@Cryt1c
Copy link
Copy Markdown
Contributor Author

Cryt1c commented Aug 8, 2025

I have also extended the tests to check all decode_pixel_data(0..2) and to_dynamic_image(0..2)

@Cryt1c Cryt1c requested a review from Enet4 August 8, 2025 15:08
@Enet4 Enet4 added A-lib Area: library C-pixeldata Crate: dicom-pixeldata bug This is a bug labels Aug 12, 2025
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.

Looks great, thanks again!

@Enet4 Enet4 merged commit 0a7c3bc into Enet4:master Aug 14, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-lib Area: library bug This is a bug C-pixeldata Crate: dicom-pixeldata

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants