Page 1 of 1

accessing image metadata

PostPosted: Thu Feb 20, 2014 12:51 pm
by yuriy_alexandrov
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.

Re: accessing image metadata

PostPosted: Fri Feb 21, 2014 9:37 am
by wmoore
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.

Re: accessing image metadata

PostPosted: Fri Feb 21, 2014 11:06 am
by yuriy_alexandrov
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.

Re: accessing image metadata

PostPosted: Fri Feb 21, 2014 11:36 am
by sbesson
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

Re: accessing image metadata

PostPosted: Fri Feb 21, 2014 12:21 pm
by yuriy_alexandrov
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.

Re: accessing image metadata

PostPosted: Tue Feb 25, 2014 1:20 pm
by i.munro
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

Re: accessing image metadata

PostPosted: Fri Feb 28, 2014 1:07 pm
by i.munro
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.

Re: accessing image metadata

PostPosted: Fri Feb 28, 2014 4:27 pm
by yuriy_alexandrov
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.

Re: accessing image metadata

PostPosted: Sun Mar 02, 2014 8:12 pm
by sbesson
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

Re: accessing image metadata

PostPosted: Mon Mar 03, 2014 11:40 am
by yuriy_alexandrov
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.