fix: Navigate to contour should work #5718
Open
+233
−1
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.
Context
The navigate to contour segmentation only worked for rehydrated contours or for any labelmap/volumes.
This PR adds code to navigate to the next contour. This requires that the viewport already display the right orientation viewport
Changes & Results
Added jumpToSegmentNext that differentiates between labelmaps and contours, using the existing logic for labelmaps.
Added a _getContourViewReferences that gets an array of view references indexed by slice index.
Added logic to get the closest view reference, or the next view reference if there isn't a closest.
Updated docs for SegmentationService
Testing
Load segmentation mode
Create a contour segmentation on a volume (should also test with a stack viewport that isn't a volume)
Draw several contours on several slices - you can vary the segment index if you want
Click on the segment index in the right hand panel to navigate to the "next" contour index for that segment.
Try the same thing with labelmaps - which will always navigate to center (might be a TODO to implement for labelmap to allow navigation to "next".
Checklist
PR
semantic-release format and guidelines.
Code
etc.)
Public Documentation Updates
additions or removals.
Tested Environment