[ome-devel] get annotations java code
    Dominik Lindner (Staff) 
    d.lindner at dundee.ac.uk
       
    Tue Jun  5 09:16:28 BST 2018
    
    
  
Hi Thomas,
there is, it's in the DataManagerFacility (might actually be clearer to move that to the MetadataFacility though):
https://downloads.openmicroscopy.org/omero/5.4.5/api/omero/gateway/facility/DataManagerFacility.html#attachAnnotation-omero.gateway.SecurityContext-T-omero.gateway.model.DataObject-
In general a lot of functionality a typical client has to deal with is wrapped in one of the Facility classes:
https://downloads.openmicroscopy.org/omero/5.4.5/api/omero/gateway/facility/Facility.html
Although there are still two big parts missing which is importing images to the server and rendering. This is so
tightly coupled to the OMERO.insight code, I've not managed yet to move that to the Java gateway.
Kind Regards,
Dominik
On 5 Jun 2018, at 00:36, Thomas Boudier <boudier.t at wehi.edu.au<mailto:boudier.t at wehi.edu.au>> wrote:
-------- Forwarded Message --------
Subject:        Re: [ome-devel] get annotations java code
Date:   Tue, 5 Jun 2018 09:36:06 +1000
From:   Thomas Boudier <boudier.t at wehi.edu.au><mailto:boudier.t at wehi.edu.au>
To:     Dominik Lindner (Staff) <d.lindner at dundee.ac.uk><mailto:d.lindner at dundee.ac.uk>
Hi Dominik,
Thanks, I was a bit confused I guess between Facility classes. Maybe in the future you may  want to also have some setAnnotations methods ;-) .
Here my code for information :
Map<String, String> map = new HashMap<>();
        MetadataFacility metadataFacility = gateway.getFacility(MetadataFacility.class);
        List<AnnotationData> list = metadataFacility.getAnnotations(ctx, image);
        for (AnnotationData annotationData : list) {
            //IJ.log("" + annotationData.getClass().getName() + " " + annotationData.getLastModified());
            if (annotationData instanceof MapAnnotationData) {
                MapAnnotationData mapAnnotationData = (MapAnnotationData) annotationData;
                //IJ.log("FOUND PAIR " + mapAnnotationData.getContentAsString());
                String[] data = mapAnnotationData.getContentAsString().split("=");
                map.put(data[0], data[1]);
            }
        }
Many thanks.
Best,
Thomas
The University of Dundee is a registered Scottish Charity, No: SC015096
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openmicroscopy.org.uk/pipermail/ome-devel/attachments/20180605/a367765f/attachment.html>
    
    
More information about the ome-devel
mailing list