Skip to content

Conversation

tblock79
Copy link
Contributor

Context

Most tools, including the Stack Scroll and Zoom tool, allow adjusting the mouse-movement direction via the tool configuration (typically by the setting "invert"). The WindowLevelTool currently does not have this flexibility. This small PR adds this functionality, allowing the mouse movement direction to be adjusted separately for the window center and window width.

Changes & Results

Added tool configuration with members "invertWidth" and "invertCenter", and adjusted the event handler for mouse movement accordingly.

Testing

  • Run the "Basic Stack Manipulation" example
  • Add a configuration for the WindowLevelTool with:
    toolGroup.addTool(WindowLevelTool.toolName, { invertCenter: true, invertWidth: true });
  • Validate that the mouse directions for changing the window level have flipped

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.

Tested Environment

  • "OS: Windows 11"
  • "Node version: 22.17.0"
  • "Browser: Chrome 142.0, Firefox 143.0"

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