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(EllipticalROITool) Issue 1294 - Ellipse tool spamming ANNOTATION_MODIFIED events when it is outside volume #1295

Merged
merged 7 commits into from
Jun 5, 2024

Conversation

kom482
Copy link
Contributor

@kom482 kom482 commented May 30, 2024

Context

Fix for Issue 1294

The Ellipse tool is generating excessive ANNOTATION_MODIFIED events when it is placed outside the volume boundaries. This behavior is unexpected and leads to performance issues, such as event flooding and potential application slowdowns.

Issue was generated because of lack area and area units for ellipse annotation with in this specific scenario.

Fixed by allowing calculation of area for ellipse annotation even if it's not in in mage volume.

Changes & Results

Before: Issue 1294 video

After:
https://github.com/cornerstonejs/cornerstone3D/assets/2040590/2884ccf9-d53c-4e6d-a155-d1c7ad5d8387

Testing

  1. Open stackAnnotationTools example: yarn run example stackAnnotationTools
  2. Subscribe annotations modified event
eventTarget.addEventListener(csToolsEnums.Events.ANNOTATION_MODIFIED,(event)=>{
  console.count(`${event.type}: ${event.detail.annotation.metadata.toolName}`)
})
  1. Select the Ellipse tool from the toolbar.
  2. Draw an ellipse within the volume to confirm normal behavior.
  3. Move the ellipse outside the volume boundaries.

Checklist

PR

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

Code

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

  • (N/A) I have run the yarn build:update-api to update the API documentation, and have
    committed the changes to this PR. (Read more here https://www.cornerstonejs.org/docs/contribute/update-api)

Public Documentation Updates

  • (N/A) The documentation page has been updated as necessary for any public API
    additions or removals.

Tested Environment

  • "OS: Windows 11
  • "Node version: 16.20.2
  • "Browser: Chrome 125.0.6422.113

Copy link

netlify bot commented May 30, 2024

Deploy Preview for cornerstone-3d-docs ready!

Name Link
🔨 Latest commit 9542da9
🔍 Latest deploy log https://app.netlify.com/sites/cornerstone-3d-docs/deploys/66588dee2ab98500084c835b
😎 Deploy Preview https://deploy-preview-1295--cornerstone-3d-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

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.

Thanks again

@sedghi sedghi merged commit b2b4d7f into cornerstonejs:main Jun 5, 2024
10 checks passed
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