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] Can't add RectangleROITool or CircleROITool dynamically #1607

Open
daker opened this issue Nov 19, 2024 · 0 comments
Open

[Bug] Can't add RectangleROITool or CircleROITool dynamically #1607

daker opened this issue Nov 19, 2024 · 0 comments
Assignees

Comments

@daker
Copy link

daker commented Nov 19, 2024

Describe the Bug

I am trying to add a rectangle annotation but i am facing some issues

Note it can be good if we can have more examples for dynamically adding RectangleROITool, CircleROITool and AngleTool like what was done LengthTool.

Steps to Reproduce

    const points: Point3[] = [
      [-35.685298919677734, -9.446551322937012, 30.00376319885254], 
      [-18.081600189208984, 4.328248500823975, 30.00376319885254],
      [-35.685298919677734, 4.328248500823975, 30.00376319885254],
      [-18.081600189208984, -9.446551322937012, 30.00376319885254]
    ]
    cornerstoneTools.utilities.annotationHydration(
      viewport,
      RectangleROITool.toolName,
      points
    );
    cornerstoneTools.utilities.triggerAnnotationRenderForViewportIds([
      viewport.id,
    ]);

The current behavior

@cornerstonejs_tools.js?v=e6db9132:23788 Uncaught TypeError: Cannot read properties of undefined (reading '0')
    at drawHandle (@cornerstonejs_tools.js?v=e6db9132:23788:20)
    at @cornerstonejs_tools.js?v=e6db9132:23830:5
    at Array.forEach (<anonymous>)
    at drawHandles (@cornerstonejs_tools.js?v=e6db9132:23829:16)
    at RectangleROITool.renderAnnotation (@cornerstonejs_tools.js?v=e6db9132:32896:11)
    at handleDrawSvg (@cornerstonejs_tools.js?v=e6db9132:24408:33)
    at Array.forEach (<anonymous>)
    at @cornerstonejs_tools.js?v=e6db9132:24412:20
    at draw (@cornerstonejs_tools.js?v=e6db9132:23641:3)
    at AnnotationRenderingEngine._triggerRender (@cornerstonejs_tools.js?v=e6db9132:24404:5)

The expected behavior

A rectangle annotation is displayed

OS

Windows 11

Node version

16.14.0

Browser

Chrome 131.0.6778.70

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

2 participants