Fix overlapping segmentation render issues - #2170
Open
rodrigobasilio2022 wants to merge 22 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR expands segmentation modules to fully support multi-volume data, updates type definitions to unify actor handling, and refines error handling and progress reporting in segmentation operations.
- Introduce
volumeIds,getVolumeIds, andgetPrimaryVolumeIdutilities for multi-volume support - Refactor core segmentation utilities and state manager to iterate over multiple volumes
- Update type definitions in
LabelmapTypesandIActorto unify single- and multi-volume actors
Reviewed Changes
Copilot reviewed 36 out of 36 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/core/src/types/LabelmapTypes.ts | Updated segmentation data types, introduced volumeIds |
| packages/tools/src/utilities/segmentation/validateLabelmap.ts | Enhanced validation for multi-volume & stack inputs |
| packages/tools/src/utilities/segmentation/getSegmentIndexAtWorldPoint.ts | Iterates over volumeIds for world‐point lookup |
| packages/tools/src/utilities/segmentation/getSegmentIndexAtLabelmapBorder.ts | Iterates over volumeIds for border‐point lookup |
| packages/tools/src/tools/displayTools/Labelmap/addLabelmapToElement.ts | Refactored to handle multiple volume inputs |
Comments suppressed due to low confidence (1)
packages/tools/src/tools/displayTools/Labelmap/addLabelmapToElement.ts:178
- [nitpick] The function name is missing a capital 'L' in 'LabelMap' for readability and consistency (
_ensureLabelMapDataVolumeHasVolumeId). Consider renaming to follow camel-case conventions.
function _ensurelabelMapDataVolumeHasVolumeId(
…one3D into pr/rodrigobasilio2022/2170
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This pull request introduces multi-volume support across multiple modules, refines type definitions for actors, and enhances segmentation handling. Key changes include the addition of multi-volume processing capabilities, updates to type definitions, and improvements to segmentation state management.
Multi-Volume Support Enhancements:
packages/core/src/utilities/isValidVolume.ts: UpdatedisValidVolumeto handle multi-volume segmentations by splitting image IDs into groups based on the number of images per volume. Added validation logic for each group. [1] [2] [3]packages/labelmap-interpolation/src/utilities/interpolateLabelmap.ts: ModifiedinterpolateLabelmapto process multiple segmentation volumes iteratively, updating progress dynamically and handling failures gracefully. [1] [2]packages/tools/src/stateManagement/segmentation/SegmentationStateManager.ts: Added support for multi-volume segmentation by splitting image IDs into groups and updating references accordingly. Enhanced helper methods to return arrays of arrays for multi-volume scenarios. [1] [2] [3]Type Definition Updates:
packages/core/src/types/IActor.ts: IntroducedViewportActortype to unify various actor types (Actor,VolumeActor,ImageActor,ICanvasActor) and updatedActorEntryto useViewportActor. [1] [2]packages/core/src/types/index.ts: Exported the newViewportActortype for broader usage across modules. [1] [2]Segmentation Handling Improvements:
packages/polymorphic-segmentation/src/Labelmap/convertContourToLabelmap.ts: AddednumberOfImagesproperty to segmentation-related return objects for better multi-volume handling. [1] [2]packages/tools/src/eventListeners/segmentation/labelmap/performVolumeLabelmapUpdate.ts: RefactoredperformVolumeLabelmapUpdateto usegetPrimaryVolumeIdfor improved segmentation volume retrieval. [1] [2]