Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(rectangle): ROI and Rotation Tool Interaction (RectangleROITool) #1217

Conversation

kom482
Copy link
Contributor

@kom482 kom482 commented Apr 21, 2024

Context

This fix addresses the issue #713 where an error occurred in the interaction between the RectangleROITool and Rotation tools

Changes & Results

  • Added the drawRectByCoordinates function by passing canvasCoordinates and executing precise calculations for rectangle position after applying rotation transform angle.
  • drawRect function was kept for backward compatibility,
  • Refined center, rotation, and radius calculations for the rectangle SVG attributes.
  • Introduced the transform: rotate(angle cx cy) rectangle attribute for appropriate transformations.

Before:
#713 videos

Testing

After:
https://github.com/cornerstonejs/cornerstone3D/assets/2040590/905a7442-f3b4-4ea4-bd7e-386b67f4ff33

Testing:

  1. run yarn example stackAnnotationTools
  2. draw multiply RectangleROITool annotations
  3. change viewport rotation

Checklist

PR

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

Code

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: v16.20.8
  • Browser: Chrome 124.0.6367.60

Copy link

netlify bot commented Apr 21, 2024

Deploy Preview for cornerstone-3d-docs canceled.

Name Link
🔨 Latest commit 27cc6f6
🔍 Latest deploy log https://app.netlify.com/sites/cornerstone-3d-docs/deploys/66253cba263fd900076272d3

Copy link
Member

@sedghi sedghi left a comment

Choose a reason for hiding this comment

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

Looks great. Thanks again for fixing our things.

@sedghi sedghi merged commit 29a3edb into cornerstonejs:main May 15, 2024
9 checks passed
@kom482
Copy link
Contributor Author

kom482 commented May 18, 2024

Thanks!
@sedghi we can close #713 as well

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.

None yet

2 participants