[ome-users] Reading Metadata from a script

Will Moore will at lifesci.dundee.ac.uk
Mon Sep 19 16:46:43 BST 2011


Hi Stefan,

Try this code:


image = conn.getObject("Image", imageId)
om = image.loadOriginalMetadata()

if om is not None:
     print "original_metadata"
     print "    File Annotation ID:", om[0].getId()

     print "global_metadata"
     for keyValue in om[1]:
         if len(keyValue) > 1:
             print "   ", keyValue[0], keyValue[1]
         else:
             print "   ", keyValue[0], "NOT FOUND"

     print "series_metadata"
     for keyValue in om[2]:
         if len(keyValue) > 1:
             print "   ", keyValue[0], keyValue[1]
         else:
             print "   ", keyValue[0], "NOT FOUND"


Hope that helps,

   Will.


On 19 Sep 2011, at 16:13, Stefan Dürrenberger wrote:

> Hi,
>
> I'm trying to write a script for OMERO to export images and some
> metadata. There are a few examples for images, but I can't find any  
> for
> exporting metadata. I'm looking especially for data listed under
> Acquisition/Original Metadata/GlobalMetadata in Insight.
>
> Does anyone have an example script for me or pointers to more
> documentation?
>
> thanks,
>
> Stefan
>
>
>
> -- 
> Stefan Dürrenberger
> Universität Basel
> Zentrum für Mikroskopie (ZMB)
> Klingelbergstrasse 50
> CH-4056 Basel
> Tel.: +41-(0)61-267 14 05
> Fax: +41-(0)61-267 14 10
>
> Email: stefan.duerrenberger at unibas.ch
>
> _______________________________________________
> ome-users mailing list
> ome-users at lists.openmicroscopy.org.uk
> http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users

William Moore
Wellcome Trust Centre for Gene Regulation & Expression
College of Life Sciences
MSI/WTB/JBC Complex
University of Dundee
Dow Street
Dundee  DD1 5EH
United Kingdom

Phone 01382 386364
http://openmicroscopy.org








More information about the ome-users mailing list