Skip to content

Support overlays - #820

Merged
Enet4 merged 3 commits into
Enet4:masterfrom
feliwir:overlays
Aug 19, 2026
Merged

Support overlays#820
Enet4 merged 3 commits into
Enet4:masterfrom
feliwir:overlays

Conversation

@feliwir

@feliwir feliwir commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

This PR adds 2 new functions to the PixelDecoder trait:

  • decode_overlays: This decodes all OverlayPlanes present in the file as vec
  • decode_overlay: This decodes a single OverlayPlane by it's index

There's currently one default implementation in overlay.rs, which is used by all PixelDecoder implementations
Additionally i added support to the toimage crate, with the following options:

  • overlays: A toggle to enable overlay burnins (defaults to false)
  • overlay-color: A repeating argument which can be used to change the default overlay color (default is white)
  • overlay-file: If overlays stored in a separate file (presentation state) these can be passed here

This closes #818

@Enet4 Enet4 assigned Enet4 and unassigned Enet4 Aug 6, 2026
@Enet4 Enet4 added enhancement A-lib Area: library A-tool Area: tooling C-pixeldata Crate: dicom-pixeldata C-toimage Crate: dicom-toimage labels Aug 6, 2026
@feliwir feliwir changed the title Support overlays #818 Support overlays Aug 6, 2026

@Enet4 Enet4 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thank you for working on this, it looks solid and extensive! I wasn't even expecting support for legacy overlay planes embedded in the pixel data, but we might as well keep it. 😅

I would only like for the overlay error reason field to be refactored (more details inline) before we get this upstream.

Comment thread pixeldata/src/lib.rs Outdated
Comment thread pixeldata/src/attribute.rs
@feliwir
feliwir requested a review from Enet4 August 13, 2026 11:57

@Enet4 Enet4 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

OK, looks good! Thank you! 👍

@Enet4
Enet4 merged commit 3d38d57 into Enet4:master Aug 19, 2026
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 A-tool Area: tooling C-pixeldata Crate: dicom-pixeldata C-toimage Crate: dicom-toimage enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add option to merge overlay into pixeldata

2 participants