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>
This commit is contained in:
authored and GitHub committed 2026-02-18 20:31:43 -05:00
1 parent c75cbc2a89
commit b35354120a
11 files changed
+174 -48

No files matched your search

@@ -1,11 +1,11 @@
---
sidebar_position: 1
sidebar_label: 3.11 -> 3.12 beta
sidebar_label: 3.11 -> 3.12
---
# Migration Guide
This guide provides information about migrating from OHIF version 3.11 to version 3.12 beta
This guide provides information about migrating from OHIF version 3.11 to version 3.12
## Optional: Migrate modes to extend `modes/basic`
@@ -0,0 +1,15 @@
---
id: index
sidebar_position: 1
sidebar_label: 3.12 -> 3.13
title: 3.12 to 3.13 Migration Guide
---
import DocCardList from '@theme/DocCardList';
import { useCurrentSidebarCategory } from '@docusaurus/theme-common';
# 3.12 to 3.13 Migration Guide
This guide covers changes when upgrading from OHIF version 3.12 to version 3.13.
<DocCardList items={useCurrentSidebarCategory().items.filter(item => item.docId !== 'migration-guide/3p12-to-3p13/index')} />
@@ -0,0 +1,51 @@
---
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.