feat: volume cropping - #2139
Merged
wayfarer3130 merged 134 commits intoJul 28, 2025
Merged
Conversation
…ion and clipping planes
…n VolumeViewport3D and update ZoomTool to handle clipping planes during zoom
… drag callbacks for improved interaction
…d improve clipping planes handling
- Imported VolumeCroppingTool in the tools index file. - Exported VolumeCroppingTool alongside other manipulation tools.
…r VolumeCroppingTool - Added a check in TrackballRotateTool to allow rotation only for VOLUME_3D viewports. - Refactored VolumeCroppingTool to remove slab thickness handling and rotation points. - Introduced reference lines for better annotation management. - Updated annotation interfaces and removed unused methods related to slab thickness. - Enhanced handle selection logic and improved code readability.
…te sphere color based on axis
…r/cornerstone3D into feat-volume-cropping
…nality and update clipping plane references
…functions and enhancing sphere state management
…ng in VolumeCroppingControlTool
…handling in VolumeCropping tools
…e bindings and improve annotation handling
… and adjust zoom level in example
…trolTool to enhance sphere handling and event management
…entation handling in VolumeCropping tools
…ng for sphere colors
…dling in VolumeCroppingTool
…able initialCropFactor and clean up reference line handling
…for enhanced cropping control
… line colors for improved clarity
sedghi
reviewed
Jul 21, 2025
sedghi
reviewed
Jul 21, 2025
…ing a dedicated method
…visibility methods
…rientation utility function
…n for improved cropping
…n for spheres based on volume diagonal
…un on different series.
…erenceUID to identify events.
…l and VolumeCroppingControlTool interactions
…bility control methods for cropping handles and planes
…d improve code clarity
…eck for existing clipping planes
igoroctaviano
approved these changes
Jul 25, 2025
igoroctaviano
left a comment
Contributor
There was a problem hiding this comment.
LGTM, great work @mbellehumeur
…s bun run dev:fast)
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.
Context
ticket: 9248395925
This pull request adds two tools: VolumeCroppingTool and VolumeCroppingControlTool.
The VolumeCroppingTool acts on a VRT viewport and provides the ability to crop the volume using control spheres/handles along the axial, sagittal and coronal axis and the corners of the cropping volume.
The display of the control spheres can be enabled/disabled through the setHandlesVisible/ getHandlesVisible methods.
The VolumeCroppingControlTool acts on 1, 2 or 3 orthographic viewports and adds reference lines that control the cropping volume and react to changes in the cropping volume.
Messaging between the tools is handled through Cornerstone events that are validated by the series instance UID of the volume. Therefore the tools do not need to be in the same tool group as the volume cropping tool. Multiple cropping & control instances can be used on different series in the same display.
Configurable items of the VolumeCroppingTool are the following:
The volumeCroppingTool example demonstrates the two tools working together.
A dropdown box allows to select the number of orthographic viewports for the VolumeCroppingControl tool: 1, 2 or 3.
There are two toggle buttons to toggle the display of the control spheres and clipping planes:
The toggle buttons demonstrate the use of the following public methods:
Changes & Results
New files are VolumeCropping, VolumeCroppingControl and index.js for the example.
Testing
Run the example and use the spheres to modify the cropping. The volume should change the control lines in the orthogonal views as well.
Use the control lines in the orthogonal views to change the cropping volume.
Use the 'Toggle 3D handles' button to hide/show the control spheres.
In OHIF, do not use the 'run dev:fast' option. It will cause rendering problems when moving the first sphere quickly. Use 'bun run dev'.
Checklist
PR
semantic-release format and guidelines.
Code
etc.)
Public Documentation Updates
additions or removals.