[ome-users] Dumping out metadata for each image id

William Moore will at lifesci.dundee.ac.uk
Fri Jul 3 22:15:22 BST 2015


Hi Steve,

 I think you will find most of what you need in this example:

https://github.com/openmicroscopy/openmicroscopy/blob/develop/examples/Training/python/Metadata.py

 Hope that helps,

  Cheers,

   Will.




On 3 Jul 2015, at 15:34, Stephen Taylor <stephen.taylor at imm.ox.ac.uk> wrote:

> Hi Ola,
>  
> I tried:
>  
> dataset = conn.getObject("Dataset", datasetId)
> print "\nDataset:%s" % datasetId
> print "=" * 50
> dataset = conn.getObject("Dataset", datasetId)
> print "\nImages in Dataset:", dataset.getName()
>  
> # get all the images for that dataset
> for image in dataset.listChildren():
>     instrument = image.getInstrument()
>     print "Microscope %s " % instrument.getMicroscope();
>  
> All the images return "None" though in the UI we have
>  
> <image001.png>
>  
> Do I have to get “model” and “manufacturer” somehow?
>  
> Thanks!
>  
> Steve
>  
> > -----Original Message-----
> > From: ome-users [mailto:ome-users-bounces at lists.openmicroscopy.org.uk]
> > On Behalf Of Aleksandra Tarkowska (Staff)
> > Sent: 03 July 2015 14:26
> > To: OME User Support List
> > Subject: Re: [ome-users] Dumping out metadata for each image id
> >
> > Hi Steve
> >
> > You can do it via loading instruments:
> >
> >
> > instrument = conn.getObject("Image", imageid).getInstrument()
> >
> > print instrument.__dict__
> >
> > Or access directly
> >
> > instrument.getMicroscope()
> > instrument.getObjectives()
> > instrument.getFilters()
> > instrument.getDichroics()
> > instrument.getDetectors()
> > instrument.getLightSources()
> >
> >
> >
> > I hope that helps
> >
> > Kind regards
> > Ola
> >
> >
> >
> >
> >
> > On 03/07/2015 14:09, "Stephen Taylor" <stephen.taylor at imm.ox.ac.uk>
> > wrote:
> >
> > >Hi Josh,
> > >
> > >Thanks for your reply. I tried printing image._obj, it does contain some
> > >data but it doesn't seem to contain all the data I was expecting, for
> > >example:
> > >
> > >Objective:
> > >Model:
> > >Manufacturer:
> > >Nominal magnification:
> > >Lens NA:
> > >Immersion:
> > >
> > >Correction:
> > >
> > >Working distance:
> > >
> > >Etc
> > >
> > >How can I get access to these?
> > >
> > >Thanks,
> > >
> > >Steve
> > >
> > >> -----Original Message-----
> > >> From: ome-users [mailto:ome-users-
> > bounces at lists.openmicroscopy.org.uk]
> > >> On Behalf Of Josh Moore
> > >> Sent: 03 July 2015 13:30
> > >> To: OME User Support List
> > >> Subject: Re: [ome-users] Dumping out metadata for each image id
> > >>
> > >> On Fri, Jul 3, 2015 at 2:14 PM, Stephen Taylor
> > >> <stephen.taylor at imm.ox.ac.uk> wrote:
> > >> > Hi,
> > >>
> > >> Hi Stephen,
> > >>
> > >>
> > >> > I'd like to be able to dump out the metadata for each image using the
> > >> Python API in OMERO.  I can do something like :
> > >> >
> > >> > image = conn.getObject("Image", imageId)
> > >> > print image.getName(), image.getDescription()
> > >> >
> > >> > but is there a way of returning all the available metadata for that
> > >>image
> > >> that is stored in the database? i.e. not having to specify getXXXX for
> > >>each
> > >> property?
> > >>
> > >> Are you looking to have it in a particular format? If not, print
> > >> image._obj should show you what's available.
> > >>
> > >> ~Josh.
> > >>
> > >>
> > >> > Thanks for any help,
> > >> > Steve
> > >> _______________________________________________
> > >> ome-users mailing list
> > >> ome-users at lists.openmicroscopy.org.uk
> > >> http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users
> > >_______________________________________________
> > >ome-users mailing list
> > >ome-users at lists.openmicroscopy.org.uk
> > >http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users
> >
> >
> > The University of Dundee is a registered Scottish Charity, No: SC015096
> > _______________________________________________
> > ome-users mailing list
> > ome-users at lists.openmicroscopy.org.uk
> > http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users
> _______________________________________________
> ome-users mailing list
> ome-users at lists.openmicroscopy.org.uk
> http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openmicroscopy.org.uk/pipermail/ome-users/attachments/20150703/5c85ba0e/attachment.html>


More information about the ome-users mailing list