Closed xgrg closed 2 months ago
Hi, I admit the api is confusing here, the details that you want are the draw display details that you get from app.getDrawDisplayDetails()
. You can find examples of it in the https://github.com/ivmartel/dwv-jqmobile project.
Side note: I'm working on https://github.com/ivmartel/dwv/issues/1020 to store annotations as DICOM SR that will change quite a lot the draw api.
Thank you very much for your quick reply. I actually had tested it with:
dc = app.getActiveLayerGroup().getActiveDrawLayer().getDrawController()
details = dc.getDrawDisplayDetails()
dc.updateDraw(details)
But I am getting the same error as with getDrawStoreDetails()
with the message [updateDraw] Cannot find group with id: undefined
.
I am looking for a way to load vector-based annotations (namely bounding boxes and polygons - therefore Rectangle
and Roi
in dwv
terminology) by providing their coordinates.
Any help would be highly appreciated! Thank you again.
Ah, got it, getDrawDisplayDetails
returns a DrawDetails[]
and udpateDraw
expects a single DrawDetails
.
Oh! Fantastic! Thank you so much @ivmartel, it helps a lot.
Just wondering, are you suggesting that moving to DICOM SR will have an impact on the support of vector-based annotations?
Yes! The problem with the current annotations is that their format is not standard and that they lack 3D information. With DICOM SR I wish to improve this and allow for easier annotation sharing with external tools.
Understood. In our use case I assume we are going to keep needing the support of vector-based data. We will see how it develops then. Thank you @ivmartel!
Hi @ivmartel , I looked for some example on how to use
DrawController.updateDraw
but I could not find any. I understood from the documentation that the function takes some drawing details and updates a corresponding drawing with the provided data. Therefore what I don't understand is why the following gives an error.[updateDraw] Cannot find group with id: undefined
details
looks like:I can't figure where the problem comes from. I am trying to load some annotations from a set of coordinates/metadata provided in a text file.
Thank you again for your valuable help. Greg