Files
ohif-viewer/platform/docs/docs/migration-guide/3p12-to-3p13/segmentation-service.md
T
b35354120a fix(segmentation overlay): update viewport ds list upon seg delete - OHIF-2425 (#5729)
- add segmentationExists check to getSopClassHandlerModule
- now firing SEGMENTATION_REMOVED and SEGMENTATION_REPRESENTATION_REMOVED events
- centralized segmentation removal in a listener
- when a segmentation is deleted (completely), remove it from all viewports it overlays
- when a segmentation is removed from a viewport, remove it as overlay from the viewport

---------

Co-authored-by: Joe Boccanfuso <joe.boccanfuso@radicalimaging.com>
Co-authored-by: Bill Wallace <wayfarer3130@gmail.com>
2026-02-18 20:31:43 -05:00

52 lines
1.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
sidebar_position: 2
sidebar_label: SegmentationService
title: SegmentationService API change
---
# SegmentationService – method rename
The `SegmentationService` method for removing segmentation representations from a viewport has been renamed to better reflect its behavior.
## Change
| 3.12 (old) | 3.13 (new) |
|------------------------------------|-----------------------------------|
| `removeSegmentationRepresentations` | `removeRepresentationsFromViewport` |
The signature is unchanged:
```ts
removeRepresentationsFromViewport(
viewportId: string,
specifier?: {
segmentationId?: string;
type?: SegmentationRepresentations;
}
): void
```
## Migration
Replace calls to `removeSegmentationRepresentations` with `removeRepresentationsFromViewport`.
**Before (3.12):**
```ts
segmentationService.removeSegmentationRepresentations(viewportId);
// or with a specifier:
segmentationService.removeSegmentationRepresentations(viewportId, { segmentationId });
```
**After (3.13):**
```ts
segmentationService.removeRepresentationsFromViewport(viewportId);
// or with a specifier:
segmentationService.removeRepresentationsFromViewport(viewportId, { segmentationId });
```
## Reason
The new name makes it clear that the method removes representations from a specific viewport, rather than removing segmentations globally.