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

[Bug] BidirectionalTool on volume viewport spams ANNOTATION_MODIFIED events #1425

Open
Gabsha opened this issue Aug 15, 2024 · 0 comments
Open

Comments

@Gabsha
Copy link

Gabsha commented Aug 15, 2024

Describe the Bug

I am using Bidirectional annotations on volume viewport and noticed that the the ANNOTATION_MODIFIED event gets fired repeatedly on zooming and panning.

localhost_3000.-.Google.Chrome.2024-08-15.14-16-34.mp4

The event gets fired in _calculateCachedStats, which is called repeatedly in renderAnnotation because the targetId for a volume viewport is a URN string that changes every time the camera is updated (as defined in BaseVolumeViewport)

See:

(Willing to contribute a fix, but not sure the best course of action. Perhaps cached stats should ignore the focalPoint portion of the URN to verify existence.)

Steps to Reproduce

Steps are similar to #1294

  1. Open niftiWithToolsexample: yarn run example niftiWithTools
  2. Add an event listener in the setup function
eventTarget.addEventListener(csToolsEnums.Events.ANNOTATION_MODIFIED,(event)=>{
  console.count(`${event.type}: ${event.detail.annotation.metadata.toolName}`)
})

The current behavior

After placing a BidirectionTool annotation on a volume viewport, a ANNOTATION_MODIFIED event is fired when zooming and panning the viewport.

The expected behavior

The ANNOTATION_MODIFIED event is only fired when the annotation is actually modified (handles moved).

OS

Windows 10

Node version

20.16.0

Browser

Chrome 127.0.6533.101 (Official Build) (64-bit)

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

No branches or pull requests

1 participant