How to Draw Annotations in OHIF Viewer from Saved World Coordinates in Database?

I am currently working on a medical imaging project using the OHIF viewer to display and annotate 3D images. I use cornerstone3D’s lengthTool to do annotations in MPR view, and I can save the world coordinates of these annotations to my database.

Here is what I can do so far:

  • Users can create annotations on 3D images in the OHIF viewer.
  • I can save the world coordinates of these annotations to my database.
  • I can retrieve the saved annotations from the database when the study is loaded.

My current challenge:

I need to draw these annotations back onto the several viewports in the OHIF viewer. The annotations are stored as world coordinates in the format { x: Number, y: Number, z: Number }, defining the start and the end of the line to be drawn.

Thank you in advance for the help!

so basically you need to add the annotations back into the measurement service, i think this is a really common use case i will add it to the FAQ soon

Hello @alireza,
Did you add this use case in the FAQ ?

another example is here too
https://www.cornerstonejs.org/live-examples/dynamicallyaddannotations

1 Like