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] PlanarFreehandROITool fires unnecessary ANNOTATION_MODIFIED events when an open contour is drawn #1491

Open
ScottShingler opened this issue Oct 3, 2024 · 0 comments

Comments

@ScottShingler
Copy link

Describe the Bug

Creating an open contour using the PlanarFreehandROITool on 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}`);
    }
);

This becomes a crippling issue when you have multiple viewports and need to force the other viewports to render so that the annotation is updated. Because of the extraneous ANNOTATION_MODIFIED event, it ends up causing an infinite feedback loop. I have created a repro that demonstrates this: cornerstone-annotation-spam-repro

This behaviour seems to have only started after #1372 was merged in.

Steps to Reproduce

  1. Draw an open contour on an image in a StackViewport

The current behavior

Extra ANNOTATION_MODIFIED events are triggered when the annotation is completed.

The expected behavior

A single ANNOTATION_MODIFIED event should be triggered once when the annotation is completed.

OS

Windows 11

Node version

18.20.3

Browser

Edge 129.0.2792.52 (Official build) (64-bit)

@ScottShingler ScottShingler changed the title [Bug] PlanarFreehandROITool fires unnecessary ANNOTATION_MODIFIED events when an open contour is drawn [Bug] PlanarFreehandROITool fires unnecessary ANNOTATION_MODIFIED events when an open contour is drawn Oct 3, 2024
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