- 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>
52 lines
1.4 KiB
Markdown
52 lines
1.4 KiB
Markdown
---
|
||
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.
|