Page 1 of 1

Is there a way to retrieve OME-XML for MapAnnotation?

PostPosted: Tue Jan 29, 2019 11:53 am
by Kouichi_C_Nakamura
Hello,

This is related to "Is there a way to retrieve OME-XML directly from OMERO?" http://www.openmicroscopy.org/community ... f=4&t=8624

Is there a way to retrieve OME-XML for MapAnnotation that is on OMERO?

My understanding is that OME XML supports MapAnnotation, because it's on the list.

https://docs.openmicroscopy.org/ome-mod ... e-xml.html

However, when I extract OME-XML for an image from OMERO, that OME-XML does not contain the information of the attached or linked MapAnnotation.

I think that, in order to keep track of changes in metadata, version controlling the exported OME-XML for MapAnnotation may be useful.

Best,
Kouichi

Re: Is there a way to retrieve OME-XML for MapAnnotation?

PostPosted: Wed Jan 30, 2019 11:06 am
by mtbc
Dear Kouichi,

First, the bad news: OMERO metadata export is incomplete, very much so in some regards such as with the acquisition-related metadata. You can see in the methods following https://github.com/openmicroscopy/openm ... .java#L978 what of annotation export has been implemented. Map annotations are a later addition to the model and we did not yet get around to adding the corresponding methods for them in that class. Anything omitted from among that class' methods is omitted from export. Fortunately, there is also miscellaneous good news:

Really, that class could probably be produced by code generation from the XML model mapping files. That's a somewhat large and risky undertaking but probably worth a go: then metadata export would be far more complete. It's not on our current roadmap but may happen someday.

Simply adding similar methods for handling map annotations should get them included in export. Two bits of good news there: (a) We'll get around to this anyway because we want to encourage fetching metadata from IDR in which map annotations are very important. (b) In the meantime before a server PR one can still try this client-side: e.g., see how OMERO.downloader writes XML for annotations starting from https://github.com/ome/omero-downloader ... .java#L390. That client uses the query service to fetch the OMERO object then implements those same methods from the server to convert the data into an OMEXMLMetadata instance which can provide the XML representation. (It also doesn't yet have the map annotation methods in its AnnotationMetadata class but client-side you can probably more easily experiment with adding them if trying a similar approach.)

In OME-TIFF export there is actually some implicit versioning. When you look at an LSID in the XML then after the UUID one has "..._x:y" at the end where x is the OMERO object ID and y is effectively a version: there may be large non-consecutive gaps but a higher number still means a later version. I do not know that the schema formally requires this but in practice it seems to be how things are.

Cheers,
Mark

Re: Is there a way to retrieve OME-XML for MapAnnotation?

PostPosted: Wed Jan 30, 2019 11:49 am
by Kouichi_C_Nakamura
Thank you for the detailed reply.

Given the circumstance, I'll probably wait for the official support of MapAnnotation XML export rather than developing it myself. It's something nice to have, but not crucial, at the moment for myself.

I initially thought every object in OMERO is internally represented and defined by OME-XML (so exporting XML should be straightforward). But clearly, this guess was wrong.

Re: Is there a way to retrieve OME-XML for MapAnnotation?

PostPosted: Mon Apr 15, 2019 8:15 am
by mtbc
Dear Kouichi,

Internally OMERO is working with its own object model as defined at https://docs.openmicroscopy.org/latest/ ... bject.html rather than the schema definition at https://www.openmicroscopy.org/Schemas/ ... 6/ome.html. We have increasingly tried to align the two models but there is still some manual "impedance matching" going on and with map annotations being a more recent addition to the model I guess that we had not yet got around to adding all their connectors/translators between the OMERO model and the OME Data Model. Another significant current metadata gap in the exported OME-XML is some of the acquisition-related metadata. OMERO 5.5.0 will ship with the MapAnnotation connectors so then you should find that you can add key-value pairs to an image, export it as OME-TIFF, reimport it and find that the new import has those same key-value pairs.

Cheers,
Mark

Re: Is there a way to retrieve OME-XML for MapAnnotation?

PostPosted: Mon Apr 15, 2019 11:20 am
by Kouichi_C_Nakamura
> OMERO 5.5.0 will ship with the MapAnnotation connectors so then you should find that you can add key-value pairs to an image, export it as OME-TIFF, reimport it and find that the new import has those same key-value pairs.

Thanks. This sounds like good progress!