Page 1 of 1

how/where to set various metadata in ome.tiff file

PostPosted: Fri Feb 16, 2018 7:22 am
by dsudar
Hi team,
I'm creating ome.tif files using bfconvert from a set of individual tiffs (using the pattern trick). That works fine and the resulting files are properly handled by ImageJ and OMERO import.
However, pretty much none of the metadata from the original tiff files survives the bfconvert step and I would like to add some critical metadata needed for the downstream steps. That brought up some questions:

1) where to add X and Y resolution info:there are quite a number of possible places: a) in the XML header in the <XMLAnnotations section, b) in the <Pixels ... /Pixels> section, c) per: http://www.openmicroscopy.org/community ... 77&p=16128, TIFF tags 282 and 283, and d) the EXIF IFD appears to have another set of tags incl. 296 for the units. OMERO import appears to listen to b) when importing my file but shows either c) or d) in the Original Metadata. tiffinfo and presumably all regular tiff readers also only look at TIFF tags. What is your recommendation on where to set these values?

2) adding additional metadata: I'd like to set a bunch of Instrument metadata and while I can manually edit the XML header (using tiffcomment | xmlindent to get it and then tiffcomment -set to push that back in) that is not a scalable workflow. Are there some nice utilities to insert such metadata into ome.tiff files?

Thanks,
- Damir

Re: how/where to set various metadata in ome.tiff file

PostPosted: Fri Feb 16, 2018 2:43 pm
by dgault
Hi Damir,

The best option for storing the resolution in an OME-TIFF would be option (b) using the Pixels in the OME-XML. When reading a TIFF file using any of the TIFF based readers the IFD tags 282 and 283 are read and added to the Pixels in the OME-XML. So when using bfconvert for example the values from these tags will be used in the OME-XML Pixels. For OME-TIFF specifically it will then be this Pixels physical size which is being read as per the OMERO import.

As for the process of adding the metadata, here is no standalone tool that would easier. The alternative solution would be to do so programatically using the OME API's for reading and writing TIFF and OME-TIFF.

David Gault