-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
fix(segmentation overlay): update viewport ds list upon seg delete - OHIF-2425 #5729
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
dxlin
wants to merge
11
commits into
OHIF:master
Choose a base branch
from
dxlin:fix/updateViewportDSListUponSegDelete
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
b7702c8
-remove display set from viewport when segmentation deleted
dxlin 30c256e
-fix for deleting segmentations creating within viewer (and not commi…
dxlin b0ea40d
Merge branch 'master' of https://github.com/ohif/viewers into fix/upd…
dxlin 3f048b9
-prevent duplicate segmentation removal (deleteSegmentation and then …
dxlin 4a236b6
Merge branch 'master' of https://github.com/ohif/viewers into fix/upd…
dxlin 68c52c1
-handle remove from viewport command (similar to delete, but keep dis…
dxlin 84d1bdb
Merge remote-tracking branch 'origin/master' into fix/updateViewportD…
jbocce da73b2f
PR feedback:
jbocce 3047ced
Merge remote-tracking branch 'origin/master' into fix/updateViewportD…
jbocce 0b34cc9
Merge remote-tracking branch 'origin/master' into fix/updateViewportD…
jbocce f01ad6a
PR feedback.
jbocce File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -247,7 +247,7 @@ class SegmentationService extends PubSubService { | |
|
|
||
| eventTarget.removeEventListener( | ||
| csToolsEnums.Events.SEGMENTATION_REMOVED, | ||
| this._onSegmentationModifiedFromSource | ||
| this._onSegmentationRemovedFromSource | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this makes more sense than what was there before. Now we actually fire the SEGMENTATION_REMOVED event! |
||
| ); | ||
|
|
||
| eventTarget.removeEventListener( | ||
|
|
@@ -267,7 +267,7 @@ class SegmentationService extends PubSubService { | |
|
|
||
| eventTarget.removeEventListener( | ||
| csToolsEnums.Events.SEGMENTATION_REPRESENTATION_REMOVED, | ||
| this._onSegmentationRepresentationModifiedFromSource | ||
| this._onSegmentationRepresentationRemovedFromSource | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same goes for this one. |
||
| ); | ||
|
|
||
| eventTarget.removeEventListener( | ||
|
|
@@ -1284,14 +1284,14 @@ class SegmentationService extends PubSubService { | |
|
|
||
| /** | ||
| * Clears segmentation representations from the viewport. | ||
| * Unlike removeSegmentationRepresentations, this doesn't update | ||
| * Unlike removeRepresentationsFromViewport, this doesn't update | ||
| * removed display set and representation maps. | ||
| * We track removed segmentations manually to avoid re-adding them | ||
| * when the display set is added again. | ||
| * @param viewportId - The viewport ID to clear segmentation representations from. | ||
| */ | ||
| public clearSegmentationRepresentations(viewportId: string): void { | ||
| this.removeSegmentationRepresentations(viewportId); | ||
| this.removeRepresentationsFromViewport(viewportId); | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -1307,7 +1307,7 @@ class SegmentationService extends PubSubService { | |
| } | ||
|
|
||
| /** | ||
| * It removes the segmentation representations from the viewport. | ||
| * Removes segmentation representations from the viewport. | ||
| * @param viewportId - The viewport id to remove the segmentation representations from. | ||
| * @param specifier - The specifier to remove the segmentation representations. | ||
| * | ||
|
|
@@ -1317,7 +1317,7 @@ class SegmentationService extends PubSubService { | |
| * If a type specifier is provided, only the segmentation representation with the specified type are removed. | ||
| * If both a segmentationId and type specifier are provided, only the segmentation representation with the specified segmentationId and type are removed. | ||
| */ | ||
| public removeSegmentationRepresentations( | ||
| public removeRepresentationsFromViewport( | ||
| viewportId: string, | ||
| specifier: { | ||
| segmentationId?: string; | ||
|
|
@@ -1861,7 +1861,7 @@ class SegmentationService extends PubSubService { | |
|
|
||
| eventTarget.addEventListener( | ||
| csToolsEnums.Events.SEGMENTATION_REMOVED, | ||
| this._onSegmentationModifiedFromSource | ||
| this._onSegmentationRemovedFromSource | ||
| ); | ||
|
|
||
| eventTarget.addEventListener( | ||
|
|
@@ -1881,7 +1881,7 @@ class SegmentationService extends PubSubService { | |
|
|
||
| eventTarget.addEventListener( | ||
| csToolsEnums.Events.SEGMENTATION_REPRESENTATION_REMOVED, | ||
| this._onSegmentationRepresentationModifiedFromSource | ||
| this._onSegmentationRepresentationRemovedFromSource | ||
| ); | ||
|
|
||
| eventTarget.addEventListener( | ||
|
|
@@ -2120,6 +2120,14 @@ class SegmentationService extends PubSubService { | |
| }); | ||
| }; | ||
|
|
||
| private _onSegmentationRepresentationRemovedFromSource = evt => { | ||
| const { segmentationId, viewportId } = evt.detail; | ||
| this._broadcastEvent(this.EVENTS.SEGMENTATION_REPRESENTATION_REMOVED, { | ||
| segmentationId, | ||
| viewportId, | ||
| }); | ||
| }; | ||
|
|
||
| private _onSegmentationModifiedFromSource = ( | ||
| evt: cstTypes.EventTypes.SegmentationModifiedEventType | ||
| ) => { | ||
|
|
@@ -2140,6 +2148,16 @@ class SegmentationService extends PubSubService { | |
| }); | ||
| }; | ||
|
|
||
| private _onSegmentationRemovedFromSource = ( | ||
| evt: cstTypes.EventTypes.SegmentationRemovedEventType | ||
| ) => { | ||
| const { segmentationId } = evt.detail; | ||
|
|
||
| this._broadcastEvent(this.EVENTS.SEGMENTATION_REMOVED, { | ||
| segmentationId, | ||
| }); | ||
| }; | ||
|
|
||
| private _onAnnotationCutMergeProcessCompletedFromSource = evt => { | ||
| const { segmentationId } = evt.detail; | ||
| this._broadcastEvent(this.EVENTS.SEGMENTATION_ANNOTATION_CUT_MERGE_PROCESS_COMPLETED, { | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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')} /> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When an RTSTRUCT contour segmentation was deleted completed and then reloaded it wouldn't. So this check forces the reload when it no longer exists.