Handling multiple images annotations with unique context #497
-
I know that OpenSeadragon let's you turn on the Is there some out-of-the-box solution for that, or do I have to somehow initialize multiple instances of the annotator and viewer and - at the end - collect all its instances data into one, keeping the particular image filename? Maybe someone already have a solution for something similar and is up to share? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
Hi, by separate context, you mean you'd want to store which image the annotation belongs to, correct? I don't have anything ready right now. But it's a scenario that has come up a few times. FWIW, Annotorious v2 did have a very simple sequence mode plugin that simply kept a record of the annotations per page. I'm also facing a use case myself right now, where I'd have multiple overlay versions of the same image, stacked on top of each other. And then annotation would either be on a specific layer, of the stack as a whole. (Contract not signed yet, so not sure if this is coming.) In any case: both of these solutions would use a single OpenSeadragon viewer and, accordingly, a single Annotator instance. If, instead, you want to spawn multipe OpenSeadragon viewers, then you'd need one dedicated Annotator instance for each viewer. There's actually a package that simplifies handling of multiple Annotators together. I'm using it in this multi-image app. Let me know if that's more what you're looking for and I can explain more. |
Beta Was this translation helpful? Give feedback.
-
Hi, Regarding this setup, I have an app that needs to label images in sequence. i.e. loading image one after another and I am basically swapping the Open Sea Dragon Tile source to load new image. However, loading next image using external state triggers a rerender in the react app and new image loading which causes a bit of jitter. There are events in the OSD previous and next buttons in its sequence mode. I wish to listen to press events and modify the state externally (controlled sequence if you may). They images are replaced more seamlessly using this method. I also need to create a custom reference strip. If we could get a reference to the OSD viewer via the useViewer. Can't seem to set it up. |
Beta Was this translation helpful? Give feedback.
Yes, that's right. Changing the tilesource doesn't affect the annotations. (It might not actually be desirable - see e.g. use case of multiple wavelength photograph layers for the same object.) So you'd have to manage the switch yourself. Either by keeping track of the annotations via events, as you say - or by simply leaving it up to Annotorious + calling
.getAnnotations
/clearAnnotations
before changing the image, and thensetAnnotations
with the annotations for the next image after you changed the image.