We're Hiring!

accessing image metadata

General and open developer discussion about using OMERO APIs from C++, Java, Python, Matlab and more! Please new questions at https://forum.image.sc/tags/omero
Please note:
Historical discussions about OMERO. Please look for and ask new questions at https://forum.image.sc/tags/omero

If you are having trouble with custom code, please provide a link to a public repository, ideally GitHub.

accessing image metadata

Postby yuriy_alexandrov » Thu Feb 20, 2014 12:51 pm

Hi All,

Very brief question - not immediately obvious, but should be trivial to someone with experience.

I use several "set" functions to store Image metadata during OME.tiff creation (extended version of OmeroMatlab's "bfsave"), and this works normally:

Code: Select all
metadata.setUUIDFileName(sprintf(char(file_names{i})),0,i-1);   
%... etc
metadata.setTiffDataFirstZ(toNNI(z-1),0,i-1);
%... etc

The question is how to retrieve these settings from Omero Image when downloading it from the server, i.e. to get the metadata object that will respond to the corresponding "get" functions?

Thanks,
Y.
yuriy_alexandrov
 
Posts: 126
Joined: Thu Oct 25, 2012 2:06 pm

Re: accessing image metadata

Postby wmoore » Fri Feb 21, 2014 9:37 am

Are you first downloading the ome.tiff from OMERO, and then wanting to read from the file using Bio-Formats?

Or are you connecting to OMERO via the Matlab API and wanting to access the Image metadata via the API? Details of the OMERO Matlab API can be found here: https://www.openmicroscopy.org/site/sup ... atlab.html

Cheers,
Will.
User avatar
wmoore
Team Member
 
Posts: 674
Joined: Mon May 18, 2009 12:46 pm

Re: accessing image metadata

Postby yuriy_alexandrov » Fri Feb 21, 2014 11:06 am

Thanks Will,

Are you first downloading the ome.tiff from OMERO, and then wanting to read from the file using Bio-Formats?
Or are you connecting to OMERO via the Matlab API and wanting to access the Image metadata via the API?

The second is more urgent.
The link You sent is very useful but it doesn't show how to access these functions ("getUUIDFileName", etc.)
Actually, I found the alternative solution by retrieving and parsing the Description field
Code: Select all
description = image.getDescription().getValue();   

The Description is set up on OME-tiff import to Omero, however this method involves separate parsing tools.
Using "get.." functions would be cleaner.

It looks like the solution to the first task might be illustrated in OmeroMatlab's "bfopen", as it returns:
Code: Select all
result{s, 4} = r.getMetadataStore();

The documentation shows that the return type "MetadataStore" doesn't include "get" functions
http://downloads.openmicroscopy.org/bio-formats/4.4.10/api/loci/formats/meta/MetadataStore.html

However, it is also written that

All Known Subinterfaces:
IMetadata, OMEXMLMetadata

Here, "IMetadata" contains needed "get" functions.
I'm not sure what it means - could You please clarify?

Best,
Y.
yuriy_alexandrov
 
Posts: 126
Joined: Thu Oct 25, 2012 2:06 pm

Re: accessing image metadata

Postby sbesson » Fri Feb 21, 2014 11:36 am

Hi Yuriy,

the `get` functions you are looking for are part of the `MetadataRetrieve` super interface which `OMEXMLMetadata` extends via `IMetadata`, see

* http://ci.openmicroscopy.org/job/BIOFOR ... rieve.html for Bio-Formats 5
* http://ci.openmicroscopy.org/job/BIOFOR ... rieve.html for Bio-Formats 4

Sebastien
User avatar
sbesson
Team Member
 
Posts: 421
Joined: Tue Feb 28, 2012 7:20 pm

Re: accessing image metadata

Postby yuriy_alexandrov » Fri Feb 21, 2014 12:21 pm

Hi Sebastien,

I am not sure how to build an access "chain" for Omero Image.
Schematically, I guess it might be something like

Image -> metadata -> get functions
or
Image -> Description OMEXML -> metadata -> get functions

Does it make any sense? Is there any code example if it does?

Cheers,
Y.
yuriy_alexandrov
 
Posts: 126
Joined: Thu Oct 25, 2012 2:06 pm

Re: accessing image metadata

Postby i.munro » Tue Feb 25, 2014 1:20 pm

Hi Yuriy

I did some work on accessing meta-data using bioformats.
Perhaps looking at this file:
https://github.com/imunro/Imperial-FLIM ... mensions.m
might help?

Regards

Ian
i.munro
 
Posts: 50
Joined: Thu Apr 25, 2013 1:01 pm

Re: accessing image metadata

Postby i.munro » Fri Feb 28, 2014 1:07 pm

Go to a matlab window

>>r = bfGetReader('test.sdt')
>> omeMeta = r.getMetadataStore

then type omeMeta.getU & then hit tab & you get all the options in a drop down.
i.munro
 
Posts: 50
Joined: Thu Apr 25, 2013 1:01 pm

Re: accessing image metadata

Postby yuriy_alexandrov » Fri Feb 28, 2014 4:27 pm

Thanks Ian, that is very useful.

My question was - how, having an Omero Image only, to get such metadata-rich object providing an access to all these methods.

I hope it is possible and if it is, should also be trivial, - but I just haven't met such example before.

Best,
Y.
yuriy_alexandrov
 
Posts: 126
Joined: Thu Oct 25, 2012 2:06 pm

Re: accessing image metadata

Postby sbesson » Sun Mar 02, 2014 8:12 pm

Hi Yuriy,

what you are looking for is not strictly possible on the OMERO side. To access all metadata, you will need to first retrieve the objects (Channel, Objective...) stored in the database and not loaded by default. Then you can read the desired metadata using the object getter methods.

An alternate solution would be to retrieve the original metadata associated with the image and read all the global and series metadata from there.

Sebastien
User avatar
sbesson
Team Member
 
Posts: 421
Joined: Tue Feb 28, 2012 7:20 pm

Re: accessing image metadata

Postby yuriy_alexandrov » Mon Mar 03, 2014 11:40 am

Thanks Sebastien,
To access all metadata, you will need to first retrieve the objects (Channel, Objective...) stored in the database and not loaded by default. Then you can read the desired metadata using the object getter methods.

An alternate solution would be to retrieve the original metadata associated with the image and read all the global and series metadata from there.

I use the latter method (via Description field), and it works.
I would prefer the former, if the code wasn't too cumbersome, - but as I see that might not be the case.

Thanks again,
Y.
yuriy_alexandrov
 
Posts: 126
Joined: Thu Oct 25, 2012 2:06 pm


Return to Developer Discussion

Who is online

Users browsing this forum: No registered users and 0 guests