[ome-devel] Do you need to create all Metadata before adding image data

Roger Leigh rleigh at dundee.ac.uk
Mon Nov 28 12:46:17 GMT 2016


On 25/11/16 17:47, Michael Ellis wrote:
> Can anyone tell me if it is necessary to create all the metadata before
> adding any images when using BioFormats ImageWriter.
>
> In particular, I am creating an one.tiff file with multiple series, the
> exact number of image series may be unknown at the time of opening the file.
>
> Should this be possible?

When using ImageWriter, you are required to provide all of the metadata
up front when calling setMetadataRetrieve.  (These interfaces were
originally intended for file format conversion, rather than acquisition,
which is why it's less flexible than we would like.)

However, in the case of OME-TIFF, the metadata is not serialised to
OME-XML and stored in the TIFF until the last moment, so it should be
possible in practice to modify it as you go.  However, that's an
implementation detail which is "use at own risk", should the
implementation ever change.  It's also relying upon the metadata not
being copied internally by the writer, so that you can continue to
modify it yourself, which is also an implementation detail which could
potentially change.

There are alternative ways to write OME-TIFF though.  You could use a
companion file
(http://www.openmicroscopy.org/site/support/ome-model/ome-tiff/specification.html#partial-ome-xml-metadata)
and create that after you have stored all your images.  This can be
updated on the fly if you desire, so you could create one TIFF per
series, and this would allow you to checkpoint the OME-XML regularly
during acquisition, in case of a fault of any kind.  However, this isn't
(yet) supported by ImageWriter or OmeTiffWriter--you would need to write
each TIFF directly, and then create the OME-XML from the metadatastore
yourself.


Regards,
Roger

--
Dr Roger Leigh -- Open Microscopy Environment
Wellcome Trust Centre for Gene Regulation and Expression,
College of Life Sciences, University of Dundee, Dow Street,
Dundee DD1 5EH Scotland UK   Tel: (01382) 386364

The University of Dundee is a registered Scottish Charity, No: SC015096


More information about the ome-devel mailing list