[ome-devel] Reading xml comment with ome-files c++

Sebastien Besson (Staff) s.besson at dundee.ac.uk
Tue Apr 4 12:21:44 BST 2017


Hi Lionel,

A couple of additions to this thread more specific to the C++ library

On 3 Apr 2017, at 16:03, Simone Leo <s.z.leo at dundee.ac.uk<mailto:s.z.leo at dundee.ac.uk>> wrote:

Hi Lionel,

In addition to what Ian suggested for reading the XML metadata out of an
OME-TIFF file, since Bio-Formats 5.4.0 you can also write a dataset as
binary-only OME-TIFF + companion XML file. The relevant PR is
https://github.com/openmicroscopy/bioformats/pull/2773, which also
contains some command line examples.

Regards,

Simone

On 03/04/2017 15:49, Munro, Ian wrote:
Hi Lionel

I’m not sure if this is of use but the command line tools can be
downloaded from http://downloads.openmicroscopy.org/bio-formats/5.4.0/
“tiffcomment’ can then be used to extract the .xml from a file
piping the output to “xmlindent” can be useful for easier reading.

Hope that helps.

Ian


On 3 Apr 2017, at 14:25, Lionel Fafchamps <lionel at fafchamps.com<mailto:lionel at fafchamps.com>
<mailto:lionel at fafchamps.com>> wrote:

* snip *

My current strategy is now to split the data into a separate
multichannel stack for each xy position and time point.  Each one of
these files is entirely self-contained with regards to the metadata,
so that they can be portable.  In addition to these, I would like to
write a companion xml file to bring together everything as a dataset.
I’m attempting to do this by setting the companion file tiffdata tags
manually to the correct filename/ifd, though as yet it does not seem
to work if the UUID of the file is not also included in the tag.

Overall, the strategy reads fine. The conditions of usage for the partial OME-XML support of the OME-TIFF specification are described in the format specification [1]. One current limitation is that each OME-TIFF must contain either the full OME-XML metadata or a minimal metadata referring to a master/companion file. We are looking into relaxing some of these rules especially for companion files. It might be good to see a public OME-TIFF sample fileset using the strategy you described above so that we can discuss the potential shortcomings.

[1] https://www.openmicroscopy.org/site/support/ome-model/ome-tiff/specification.html#partial-ome-xml-metadata

I’ve tried using the OMETIFFReader to get the uuid/xml comment out of
the individual stacks but I haven’t been able to find any function
that would let me do so.  Does anybody have any suggestions?

In order to access the individual UUIDs, you should be able to use the FormatReader API and the MetadataStore to retrieve the individual attributes. Alternatively, you can use the low-level TIFF API to read the ImageDescription Tag of the first IFD and extract the raw XML comment [2]

[2] https://github.com/openmicroscopy/ome-files-performance/blob/v0.1.0/src/main/cpp/metadata-performance.cpp#L88

Additionally, would you consider this a reasonable way to solve this
problem?  If there is a better way, I’d be happy to hear of it!

As mentioned by Simone, we are working on improving the writing of companion filesets using the OME-TIFF writer. Bio-Formats 5.4.0 includes a change going into that direction and we aim to include a similar feature in the next release of OME Files. [3]

[3] https://trello.com/b/WFYWCvoV/ome-files-0-4-0

Best,
Sebastien



Thanks for your help,
Lionel Fafchamps
_______________________________________________
ome-devel mailing list
ome-devel at lists.openmicroscopy.org.uk<mailto:ome-devel at lists.openmicroscopy.org.uk>
<mailto:ome-devel at lists.openmicroscopy.org.uk>
http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel



_______________________________________________
ome-devel mailing list
ome-devel at lists.openmicroscopy.org.uk<mailto:ome-devel at lists.openmicroscopy.org.uk>
http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel


The University of Dundee is a registered Scottish Charity, No: SC015096
_______________________________________________
ome-devel mailing list
ome-devel at lists.openmicroscopy.org.uk<mailto:ome-devel at lists.openmicroscopy.org.uk>
http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel


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-devel/attachments/20170404/5238f694/attachment.html>


More information about the ome-devel mailing list