Page 1 of 1

Adding tags or key/value pairs during read

PostPosted: Tue Nov 24, 2015 3:34 pm
by kverbist
Hello,

I am writing a software application which involves Omero. Currently I have made a custom MRCReader.java file which is able to handle the MRC 2014 format. The problem is that apparently meta data is not queryable. So I am hoping that I can automatically generate tags, or descriptions during the MRC reading process. Is this possible, and if yes, where do I start?

Regards,
KVerbist

Re: Adding tags or key/value pairs during read

PostPosted: Wed Nov 25, 2015 2:40 pm
by sbesson
Hi,

could you tell us more on how the metadata is stored in your custom reader: is it stored in the OMEXMLMetadataStore or in the global/series metadata tables? Also are you looking at retrieving this metadata using Bio-Formats or OMERO API?

Sebastien

Re: Adding tags or key/value pairs during read

PostPosted: Wed Nov 25, 2015 4:05 pm
by kverbist
Hello,

Basically like this:

in.seek(HEADER_SIZE);
addGlobalMeta("a_tilt", in.readFloat());
addGlobalMeta("b_tilt", in.readFloat());

addGlobalMeta("x_stage", in.readFloat());
addGlobalMeta("y_stage", in.readFloat());
addGlobalMeta("z_stage", in.readFloat());

So it would be great if I could also immediately create key/value pairs at this point between a_tilt, b_tilt, etc. and their respective values.

Regards,
KVerbist

Re: Adding tags or key/value pairs during read

PostPosted: Wed Nov 25, 2015 5:22 pm
by sbesson
Hi,

in.seek(HEADER_SIZE);
addGlobalMeta("a_tilt", in.readFloat());
addGlobalMeta("b_tilt", in.readFloat());


undertstood, so this is metadata not covered by the model that you are currently storing as key/values in the global metadata table.

So it would be great if I could also immediately create key/value pairs at this point between a_tilt, b_tilt, etc. and their respective values.


At the Bio-Formats API level, these values should be stored in the Metadata table and FormatReader.getGlobalMetadata will return it as a Hashtable.

From viewtopic.php?f=6&t=7951&p=16489#p16489, I suspect you want these key/values to be retrievable from the OMERO API after importing the file? Maybe we can migrate to the other thread to discuss the OMERO API options.

Best,
Sebastien