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] deselectAnnotation failing when an annotation from ArrowAnnotateTool was cancelled #1696

Open
EugeneQilo opened this issue Dec 11, 2024 · 3 comments

Comments

@EugeneQilo
Copy link

EugeneQilo commented Dec 11, 2024

Describe the Bug

The console gives the following error when an ArrowAnnotateTool annotation is canceled. Rendering and other actions that follow don't get executed as a result
"Unable to set properties TypeError: Cannot set properties of undefined (setting 'isSelected')"

Steps to Reproduce

  1. Render a Stack viewport
  2. Add ArrowAnnotateTool but cancel without adding a label
  3. Run the following script and notice the error
cornerstoneTools.annotation.selection.getAnnotationsSelected().forEach(annotationUID => {
	cornerstoneTools.annotation.selection.deselectAnnotation(annotationUID);
});

The current behavior

Internal exception occur

The expected behavior

Annotation should be removed altogether such that getAnnotationsSelected() doesn't return anything

OS

All

Node version

All

Browser

All

@sedghi
Copy link
Member

sedghi commented Dec 12, 2024

@sedghi sedghi closed this as completed Dec 12, 2024
@EugeneQilo
Copy link
Author

@sedghi can you re-open this one please... I'm deselecting by annotationUID, it is still failing.... I updated my description to use "annotationUID" instead of "annotation"..... getAnnotationsSelected gives you uids which then I'm deselecting one by one

Copy link
Member

sedghi commented Dec 12, 2024

did you call a .render()?

@sedghi sedghi reopened this Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants