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

Aleksandra Tarkowska (Staff) A.Tarkowska at dundee.ac.uk
Fri Jul 3 17:34:57 BST 2015


getMicroscope() gives you wrapper object. You need to get each field.

For more details look at the doc http://downloads.openmicroscopy.org/omero/5.1.2/api/python/omero/omero.gateway.html#omero.gateway._InstrumentWrapper or check OMERO model.

As mentioned before __dict__ is also helpful.

Kind regards
Ola

On 3 Jul 2015, at 15:34, Stephen Taylor <stephen.taylor at imm.ox.ac.uk<mailto: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<mailto: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-<mailto:ome-users-bounces at lists.openmicroscopy.org.uk>

> bounces at lists.openmicroscopy.org.uk<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<mailto: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<mailto: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<mailto: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<mailto: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<mailto: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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openmicroscopy.org.uk/pipermail/ome-users/attachments/20150703/6b6e2c5f/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 12429 bytes
Desc: image001.png
URL: <http://lists.openmicroscopy.org.uk/pipermail/ome-users/attachments/20150703/6b6e2c5f/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 12429 bytes
Desc: image001.png
URL: <http://lists.openmicroscopy.org.uk/pipermail/ome-users/attachments/20150703/6b6e2c5f/attachment-0001.png>


More information about the ome-users mailing list