Skip to content

Storage of pyramid data in OME-TIFF #74

@melissalinkert

Description

@melissalinkert

Current status

With http://github.com/openmicroscopy/bioformats/pull/2747, pyramid data can be stored in a hybrid format that combines the Faas lab pyramid TIFF format (cf. "the fish") with OME-TIFF. The storage of pixel data is consistent with Faas pyramid TIFFs: there is one IFD per plane per pyramid resolution, with planes ordered like so:

IFD 0 = plane 0, largest resolution
...
IFD n = plane n, largest resolution
...
IFD (r * plane_count + n) = plane n, resolution r

An OME-XML comment is included in the first IFD, consistent with OME-TIFF. This provides any additional metadata, including the SizeZ, SizeC, SizeT, and DimensionOrder necessary for determining how IFDs should be mapped to a specific Image and ZCT index. TiffData elements in the OME-XML are ignored; IFD orderings other than the natural order implied by DimensionOrder are not supported. Multiple pyramids and extra Images outside the pyramid are also not supported.

Detection of hybrid pyramid TIFF files is done via the Software IFD tag. If PyramidTiffReader is missing from the list of valid readers, then the files would be detected as OME-TIFF.

This was chosen as a temporary solution for storing pyramid data as it required minimal changes to the existing PyramidTiffReader and did not incur the extensive testing burden of modifying OMETiffReader. A complete solution for storing pyramid data would require changes to the OME data model, OME-TIFF specification, OMETiffReader, and OMETiffWriter. Proposed model and specification changes follow.

Proposed changes to support pyramids in OME-TIFF

  1. All IFDs containing a pyramid sub-resolution must set the NewSubfileType tag (254) with a value of 1 (if the image count is 1) or 2 (if the image count is greater than 1). See page 36 of data_repo/curated/specs/tiff.pdf).

  2. The number of sub-resolutions for each full resolution image must be specified in the OME-XML. The specific use case for which http://github.com/openmicroscopy/bioformats/pull/2747 was intended only requires a single pyramid per file, but in general it is possible to have multiple pyramids stored together (cf. CZI, VSI) which can each potentially contain a different number of sub-resolutions. The sub-resolution count could be specified as either a new attribute or an annotation on Image.

  3. The specification should explicitly define that the number of Images must match the number of pyramids, and not the sum of all resolution counts. This is consistent with the OME-XML generated by Bio-Formats when resolution flattening is disabled.

  4. Ordering and mapping of sub-resolution IFDs must be defined. In the long term, a FirstResolution attribute could be added to TiffData, which would allow for explicit mapping such that the IFDs can be stored in any order. In the medium term, annotations similar to TiffData could be added to Image (similar to Modulo). In the short term, all resolutions could be assumed to be stored in order from largest to smallest, with the plane ordering within a resolution being defined by existing TiffData elements and assumed to be constant across all resolutions.

Possible changes to hybrid pyramid format

If we decide to reject http://github.com/openmicroscopy/bioformats/pull/2747 outright, this section is not relevant. Otherwise, these changes could be implemented easily to address some of the concerns there before any OME-TIFF model/specification changes are complete.

  1. If the type detection of hybrid pyramid TIFF vs. OME-TIFF is too problematic, an option is to move the OME-XML from the comment (ImageDescription tag) to some other tag that would not be checked by OMETiffReader. This should prevent OMETiffReader from picking up pyramid TIFFs in all cases, and would allow changes to readers.txt to be reverted.

  2. A new extension could be used for pyramid TIFFs which makes it clear that this is a new custom format.

/cc @sbesson, @chris-allan, @rleigh-codelibre, @emilroz, @dgault

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions