8000 Add segment for background if required. by michaelonken · Pull Request #534 · QIICR/dcmqi · GitHub
[go: up one dir, main page]

Skip to content

Add segment for background if required. - #534

Closed
michaelonken wants to merge 3 commits into
masterfrom
Fix_Background_in_converted_Labelmaps
Closed

michaelonken wants to merge 3 commits into
masterfrom
Fix_Background_in_converted_Labelmaps

Conversation

@michaelonken
Copy link
Copy Markdown
Member

When converting DICOM binary segmentations to DICOM labelmaps, some pixels are likely not covered from any of the the segments. Since the pixels are initially set to 0, all non-covered pixels will be "background" and must be marked as such.

This is done by scanning all pixels after conversion and if a 0 is found, a segment using codes for denoting "background" will be inserted automatically.

The alternative would be to set Pixel Padding Value. This could be introduced as an option later, but for now the background segment seems to be better supported by consuming applications.

When converting DICOM binary segmentations to DICOM labelmaps,
some pixels are likely not covered from any of the the segments.
Since the pixels are initially set to 0, all non-covered pixels
will be "background" and must be marked as such.

This is done by scanning all pixels after conversion and if a 0 is
found, a segment using codes for denoting "background" will be inserted
automatically.

The alternative would be to set Pixel Padding Value. This could be
introduced as an option later, but for now the background segment
seems to be better supported by consuming applications.
Also for the newly added background segment, don't write
(0062,000D) Recommended Display CIELab Value either.

Also some minor changes.
@sonarqubecloud
sonarqubecloud Bot commented May 8, 2026
Copy link
Copy Markdown

@fedorov
fedorov commented May 12, 2026
Copy link
Copy Markdown
Member

Superseded by #535

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.

2 participants

0