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(CircleROITool) Issue 1489 - CircleROITool fires unnecessary ANNOTATION_MODIFIED events when any part of the annotation is outside the image #1518

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

kom482
Copy link
Contributor

@kom482 kom482 commented Oct 27, 2024

Context

fix for #1489

Positioning a CircleROITool annotation partially or fully outside the image (i.e. in the black border area) in a StackViewport will cause extraneous ANNOTATION_MODIFIED events to be triggered. This can be observed by setting up an event listener that logs to console:

eventTarget.addEventListener(
    csToolsEnums.Events.ANNOTATION_MODIFIED,
    (event) => {
        console.log(`ANNOTATION_MODIFIED: ${event.detail.viewportId} ${event.detail.annotation.annotationUID} ${event.detail.changeType}`);
    }
);

Changes & Results

Before:

circle-before.mp4

After:

circle-fix.mp4

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 Circle tool from the toolbar.
  2. Draw an circle annotation within the volume to confirm normal behavior.
  3. Move the circle annotation outside the volume boundaries.

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: 16.20.2"
  • "Browser: Chrome 125.0.6422.113"

Copy link

netlify bot commented Oct 27, 2024

Deploy Preview for cornerstone-3d-docs ready!

Name Link
🔨 Latest commit 735b040
🔍 Latest deploy log https://app.netlify.com/sites/cornerstone-3d-docs/deploys/671e26011c95150008c45981
😎 Deploy Preview https://deploy-preview-1518--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.

@sedghi sedghi requested a review from IbrahimCSAE December 3, 2024 15:35
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.

1 participant