cornerstoneTools icon indicating copy to clipboard operation
cornerstoneTools copied to clipboard

How to Get The Tool Data on "onClick" on that annotaion

Open Jaganvk29 opened this issue 3 years ago • 3 comments

Prerequisites

  • [ Yes] Which version are you using? (Is it latest?)
  • [Yes ] Are you reporting to the correct repository?
  • [ Yes] Did you search existing issues? (Were any related?)

Description

I am trying to add Label on the annotation like OHIF Measurement Table , so i wanted to get the data on Selected Annotations and set the active annotation programmatically If this feature is possible ? OHIF_annotaion_label

Jaganvk29 avatar Sep 15 '22 10:09 Jaganvk29

I also have this question. Can someone answer it?

luchen666 avatar Nov 13 '22 04:11 luchen666

I also have this question. Can someone answer it? I got This Example in the cornerstone3d site, i think it's not possible in legacy (cornerstone-tools) example -> https://www.cornerstonejs.org/live-examples/annotationselectionandlocking examples list -> https://www.cornerstonejs.org/docs/examples

Jaganvk29 avatar Nov 13 '22 05:11 Jaganvk29

Annotations have no "selected" event that can be triggered. My way is :

  1. Add a listener to watch the MOUSE_CLICK event.
  2. Get the canvas coordinates and use pointNearTool to check if your point is near the annotation(return true or false).https://github.com/cornerstonejs/cornerstoneTools/blob/73cd5224782cc757275b495178c7889ba95eb152/src/tools/annotation/LengthTool.js note: you can use toolStateManager to match the annotations you added and the measurement data can also be found viatoolStateManager.

Theadmaster avatar Jun 29 '23 08:06 Theadmaster