How to access segmentation or SegmentationService

Hi team,

I’m developing a custom extension for OHIF 3.11.0-beta.47 that needs to display current segmentation volumes. However, I’m unable to import SegmentationService from the cornerstone-extension package.

Current Behavior: SegmentationService appears to not be exported from @ohif/extension-cornerstone, while it exists in extensions\cornerstone\src\services\SegmentationService\index.ts

Steps to Reproduce:

  1. Create a custom OHIF extension
  2. Attempt to import: import { segmentationService } from '@ohif/extension-cornerstone'
  3. Import fails - service is not exported

Questions:

  • Is this intentional API design, or should SegmentationService be exported for extension development?
  • What’s the recommended approach for custom extensions to access SegmentationService and segmentation itself?

OHIF Version: 3.11.0-beta.47

Thanks!

SegmentationService can be accessed using folowing code:

import { useSystem } from ‘@ohif/core’;

const { commandsManager, servicesManager } = useSystem();
const { SegmentationService } = servicesManager.services;