Skip to content

fix: convert segment index error to warning with graceful skip - #147

Closed
igoroctaviano wants to merge 1 commit into
masterfrom
fix/seg-labelmap-crashes
Closed

igoroctaviano wants to merge 1 commit into
masterfrom
fix/seg-labelmap-crashes

Conversation

@igoroctaviano

Copy link
Copy Markdown
Collaborator

When a SEG frame is missing SegmentIdentificationSequence in both per-frame and shared functional groups, the code now logs a warning and skips that frame instead of throwing an error that aborts the entire segmentation loading.

Error fixed:

Error: Could not retrieve the segment index. Aborting segmentation loading.

Change:

- throw new Error('Could not retrieve the segment index. Aborting segmentation loading.');
+ console.warn('Could not retrieve the segment index for frame ' + i + ', skipping this frame.');
+ continue;

This follows the same pattern already used for missing imageIds (lines 587-589) and makes SEG loading more resilient to non-standard or incomplete DICOM SEG files.

DICOM Compliance:

Per DICOM PS3.3 C.8.20.3.1, SegmentIdentificationSequence is required for LABELMAP segmentations, but graceful degradation is preferred over hard failure when encountering non-compliant files.

Related:

When a SEG frame is missing SegmentIdentificationSequence in both
per-frame and shared functional groups, the code now logs a warning
and skips that frame instead of throwing an error that aborts the
entire segmentation loading.

This follows the same pattern already used for missing imageIds
(lines 587-589) and makes SEG loading more resilient to non-standard
or incomplete DICOM SEG files.

Per DICOM PS3.3 C.8.20.3.1, SegmentIdentificationSequence is required
for LABELMAP segmentations, but graceful degradation is preferred over
hard failure when encountering non-compliant files.

This branch is being deployed

1 queued deployment
fork-pr-approval — 0f9c5137 Deployed Oct 6, 2026 by igoroctaviano via playwright-tests (24.15.0) #125
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.

1 participant