Rendering KO modalities

Question

We are trying to render KO modalities in OHIF 3.10, which is currently not supported out of the box. To achieve this, we created a custom extension for rendering KO modalities. For example, in a CT study, if 2 images are marked as KO images, the series chooser should display a KO series. When we click on the KO series, it should show only those 2 images that are marked as KO.

Currently, we tried implementing this by filtering out the 2 images from the actual displaySet and attempting to render them. However, it is not working as expected. It seems to be referring to the cached displaySet. We also tried deleting the cached displaySet and re-adding it, but we were unable to add it back.

We are unsure if our approach is correct. Has anyone tried something similar or has any suggestions on how to handle this?


OHIF Version

  • OHIF Version: 3.10

What steps can we follow to reproduce the issue?

  1. Create a CT study with 2 images marked as KO.
  2. Implement a custom SOPClassHandlerModule and ViewportModule for KO.
  3. Attempt to filter the KO images from the displaySet and render them.
  4. Observe that the KO series does not render correctly.

Code Snippet

Here is the code snippet we are using to filter and render the KO images:

function _getDisplaySetsFromSeries(instances, servicesManager) {
  const filteredInstances = instances.filter(instance => {
    return instance.isReferencedByKeyObject; // Custom flag for KO references
  });

  filteredInstances.forEach(instance => {
    const displaySet = new DicomKODisplaySet({
      metadata: instance,
      useInstanceMetadata: true,
      displaySetInstanceUID: utils.guid(),
      SOPInstanceUID: instance.SOPInstanceUID,
      SeriesInstanceUID: instance.SeriesInstanceUID,
      StudyInstanceUID: instance.StudyInstanceUID,
      SOPClassUID: instance.SOPClassUID,
      SeriesDescription: 'Key Object Selection',
      servicesManager,
    });

    displaySet.Modality = 'KO';
    displaySet.initialize();
    displaySets.push(displaySet);
  });

  return displaySets;
}

What We Have Tried

  • Filtering the KO images from the displaySet.
  • Deleting the cached displaySet and re-adding it.
  • Creating a custom SOPClassHandlerModule and ViewportModule.

What Is Not Working

  • The KO series is not rendering correctly.
  • The displaySet seems to refer to the cached version, and changes are not reflected.

Expected Behavior

  • The series chooser should display a KO series.
  • Clicking on the KO series should render only the images marked as KO.

Any Suggestions?

Has anyone implemented something similar or has suggestions on how to handle this? Are we missing something in our approach? Any help would be appreciated!