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

Pixel data decoder is too eager and always returns bytes #294

Open
1 of 3 tasks
Tracked by #125
Enet4 opened this issue Oct 9, 2022 · 0 comments
Open
1 of 3 tasks
Tracked by #125

Pixel data decoder is too eager and always returns bytes #294

Enet4 opened this issue Oct 9, 2022 · 0 comments
Labels
A-lib Area: library C-encoding Crate: dicom-encoding

Comments

@Enet4
Copy link
Owner

Enet4 commented Oct 9, 2022

There are currently two known limitations with the PixelRWAdapter::decode signature.

  • It is an all or nothing operation: the decoder will decode all frames and push the decoded outcome onto the destination, even if there is interest in working with frames only on demand.
    • Adapters can now read frames independently. In addition, If the consumer specifies the interest in a specific frame, it is currently possible to issue that only that frame is retrieved and decoded from an object (Decode a single frame via object pixel data decoding API #421). However, this decoding is still done eagerly, before the user decides how to transform it. Due to the in-memory nature of the default DICOM object implementation, this may still be too expensive in more demanding modalities.
  • The solution so far has been to decode all data onto a Vec<u8>, which allows consumers to reuse memory for future decoding, but it exposes the decoded data in a way which may be slightly inconvenient to work with if Bits Allocated is greater than 8. Maybe there could be a nicer data structure giving the best of both worlds.

A future reiteration of the pixel data adapters should bring changes to the PixelRWAdapter interface to fulfill at least the first requirement. It is still unclear how far one can go with the second requirement.

@Enet4 Enet4 added the A-lib Area: library label Oct 9, 2022
@Enet4 Enet4 added the C-encoding Crate: dicom-encoding label Dec 10, 2022
@Enet4 Enet4 changed the title [encoding] Pixel data decoder is too eager and always returns bytes Pixel data decoder is too eager and always returns bytes Dec 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lib Area: library C-encoding Crate: dicom-encoding
Projects
None yet
Development

No branches or pull requests

1 participant