Segmentation errors

Describe Your Question

background

when using the OHIF viewer with segmentations we would run into a few errors when attempting to load the segmentations. We are seeking guidance on how we can triage and diagnose the issue.

Specifically, we have created segmentation masks (which marks different regions of interest in the image) and converts them into a standardized DICOM-SEG format. The DICOM-SEG files are generated using highdicom, taking a source DICOM dataset as reference. A 3D numpy array (segmentation mask) containing integer labels is used along with a mapping dictionary that connects these label values to segment names. For each unique label present in the mask, the function creates custom coded concepts using a “CUSTOM” scheme designator, which define both the segment category and type. These are incorporated into segment descriptions that specify the properties of each segmented region. The original label values are then remapped to consecutive segment numbers starting from 1, and this remapped mask is used as the pixel array in the final DICOM-SEG object. The segmentation object is created with the source DICOM as reference image, binary segmentation type, and includes the segment descriptions along with metadata like manufacturer and model information.

at a high level, we use this process to generate the segmentations:

  1. Processes the segmentation mask:
  • Finds all unique labels in the mask (excluding 0, which typically represents background)
  • Creates descriptions for each segment found in the image
  1. For each segment, it:
  • Creates standardized codes to describe what each segment represents
  • Assigns properties and categories to each segment
  • Marks them as “MANUAL” segments (though this seems to be used for AI-generated segmentations too)
  1. Remaps the labels:
  • Converts the original label numbers to consecutive segment numbers
  • Creates a new mask with these standardized numbers
  1. Finally, creates the DICOM-SEG object with:
  • The processed segmentation mask
  • All segment descriptions
  • Required metadata (manufacturer info, series descriptions, etc.)
  • Unique identifiers for the series and instance

Which OHIF version you are using : v3.9.2

issue

When the segmentations are opened in the segmentation viewer, we would encountered a few errors (screenshots attached)

  • cannot read properties of undefined (reading ‘volumeId’)
  • incompatible view refs: undefined!==

If this matters - I do want to note that these files are relatively large (500MB+), not sure if that would cause issues though.

Can you post your anonymized data to github?