Feature/ rotate clipping planes in volume cropping tool#2547
Merged
wayfarer3130 merged 23 commits intocornerstonejs:mainfrom Feb 27, 2026
Merged
Feature/ rotate clipping planes in volume cropping tool#2547wayfarer3130 merged 23 commits intocornerstonejs:mainfrom
wayfarer3130 merged 23 commits intocornerstonejs:mainfrom
Conversation
… orientation based on image orientation patient values
…e functionality and UI improvements - Updated the volume cropping tool to include toggles for clipping planes and handles. - Improved instructions for user interaction with clipping planes. - Added new utility functions for handling clipping planes, including copying and calculating adaptive sphere radius. - Introduced constants for clipping plane indices and tolerances. - Enhanced the tool's ability to handle rotated volumes and maintain proper clipping plane orientation. - Added new utility functions for line intersection and color conversion. - Refactored existing code for better clarity and maintainability.
…Orientation function and its documentation
…larity in clipping plane updates
igoroctaviano
suggested changes
Jan 9, 2026
Contributor
igoroctaviano
left a comment
There was a problem hiding this comment.
LGTM, left one comment
…n toggle button functionality
- Removed redundant code for updating sphere positions and clipping planes. - Introduced utility methods for better clarity and maintainability. - Enhanced error handling by using a consistent error variable naming convention. - Improved the organization of the code related to corner and face sphere calculations.
…state changes - Added event listener for VOLUMECROPPING_TOOL_CHANGED when the tool is enabled. - Removed event listener to prevent memory leaks when the tool is disabled. - Cleaned up commented-out code for better clarity in viewport initialization and tool selection logic.
…ne management - Introduced utility methods for retrieving volume actors and mappers. - Simplified clipping plane application logic by consolidating related functionality. - Improved error handling in viewport retrieval and ensured safe access to viewports info. - Cleaned up redundant code for better maintainability and clarity.
…ove clarity - Removed unnecessary comments throughout the code to enhance readability. - Streamlined the logic for handling annotations and viewport updates. - Improved organization of event listener management for tool state changes.
igoroctaviano
approved these changes
Feb 4, 2026
wayfarer3130
requested changes
Feb 26, 2026
Collaborator
wayfarer3130
left a comment
There was a problem hiding this comment.
A few changes to simplify things and move them into packages to be shared.
Collaborator
|
For the example, can you add shift+drag to rotate the crop mapping |
…llehumeur/cornerstone3D into feat/rotate-clippling-planes
…normalize for direction vectors
…ion and simplify corner position calculation
…ng vec3.scaleAndAdd
…ing vec3.dot for improved accuracy
…ng addLine3DBetweenPoints and calculateAdaptiveSphereRadius functions
…tegrate it into core package
wayfarer3130
approved these changes
Feb 27, 2026
wayfarer3130
added a commit
that referenced
this pull request
Apr 10, 2026
* feat(rendering): Add function to calculate acquisition plane reformat orientation based on image orientation patient values * feat(volumeCropping): Enhance volume cropping tool with clipping plane functionality and UI improvements - Updated the volume cropping tool to include toggles for clipping planes and handles. - Improved instructions for user interaction with clipping planes. - Added new utility functions for handling clipping planes, including copying and calculating adaptive sphere radius. - Introduced constants for clipping plane indices and tolerances. - Enhanced the tool's ability to handle rotated volumes and maintain proper clipping plane orientation. - Added new utility functions for line intersection and color conversion. - Refactored existing code for better clarity and maintainability. * refactor(getCameraVectors): Remove unused getAcquisitionPlaneReformatOrientation function and its documentation * refactor(volumeCroppingTool): Remove commented-out code and improve clarity in clipping plane updates * Removed 'virtual' annotations from control tool -remnamnts from the crosshair tool * refactor(volumeCroppingTool): Remove commented-out code for clarity in toggle button functionality * refactor(volumeCroppingControlTool): Remove unused methods and variables * refactor(volumeCroppingTool): Simplify sphere and clipping plane updates - Removed redundant code for updating sphere positions and clipping planes. - Introduced utility methods for better clarity and maintainability. - Enhanced error handling by using a consistent error variable naming convention. - Improved the organization of the code related to corner and face sphere calculations. * refactor(volumeCroppingControlTool): Manage event listeners for tool state changes - Added event listener for VOLUMECROPPING_TOOL_CHANGED when the tool is enabled. - Removed event listener to prevent memory leaks when the tool is disabled. - Cleaned up commented-out code for better clarity in viewport initialization and tool selection logic. * refactor(volumeCroppingTool): Enhance code structure for clipping plane management - Introduced utility methods for retrieving volume actors and mappers. - Simplified clipping plane application logic by consolidating related functionality. - Improved error handling in viewport retrieval and ensured safe access to viewports info. - Cleaned up redundant code for better maintainability and clarity. * refactor(volumeCroppingControlTool): Clean up commented code and improve clarity - Removed unnecessary comments throughout the code to enhance readability. - Streamlined the logic for handling annotations and viewport updates. - Improved organization of event listener management for tool state changes. * Applied Agents.md * Use existing ImageToWorld * refactor(VolumeCroppingTool): Simplify diagonal calculation using vec3.distance * refactor(VolumeCroppingTool): Replace manual normalization with vec3.normalize for direction vectors * refactor(VolumeCroppingTool): Remove calculateNewCornerPosition function and simplify corner position calculation * refactor(VolumeCroppingTool): Optimize line extension calculation using vec3.scaleAndAdd * refactor(VolumeCroppingTool): Enhance orientation detection by utilizing vec3.dot for improved accuracy * refactor(VolumeCroppingTool): Modularize 3D drawing utilities by adding addLine3DBetweenPoints and calculateAdaptiveSphereRadius functions * feat(colorUtilities): Add convertColorArrayToRgbString utility and integrate it into core package * feat(volumeCroppingTool): Add shift-drag to ratate the clipping planes --------- Co-authored-by: Bill Wallace <wayfarer3130@gmail.com>
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: 18376011052
Changes & Results
feat(volumeCropping): Enhance volume cropping tool with clipping plane functionality and UI improvements
Checklist
PR
semantic-release format and guidelines.
Code
etc.)
Public Documentation Updates
additions or removals.