Skip to content

Conversation

@mbellehumeur
Copy link
Contributor

@mbellehumeur mbellehumeur commented Jan 8, 2026

Context

ticket: 18376011052

Changes & Results

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 to have one source (ClippingPlanes[]) for the annotation and the events.
image ### Testing

Checklist

PR

  • My Pull Request title is descriptive, accurate and follows the
    semantic-release format and guidelines.

Code

  • My code has been well-documented (function documentation, inline comments,
    etc.)

Public Documentation Updates

  • The documentation page has been updated as necessary for any public API
    additions or removals.

… 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.
Copy link
Contributor

@igoroctaviano igoroctaviano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, left one comment

// Call setHandlesVisible on the tool instance
if (croppingTool && typeof croppingTool.setHandlesVisible === 'function') {
croppingTool.setHandlesVisible(!croppingTool.getHandlesVisible());
// Call setClippingPlanesVisible on the tool instance
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please review all changes and remove redundant comments

- 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants