-
Notifications
You must be signed in to change notification settings - Fork 15
Description
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
-
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 ofdata_repo/curated/specs/tiff.pdf
). -
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
. -
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. -
Ordering and mapping of sub-resolution IFDs must be defined. In the long term, a
FirstResolution
attribute could be added toTiffData
, which would allow for explicit mapping such that the IFDs can be stored in any order. In the medium term, annotations similar toTiffData
could be added to Image (similar toModulo
). 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 existingTiffData
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.
-
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 byOMETiffReader
. This should preventOMETiffReader
from picking up pyramid TIFFs in all cases, and would allow changes toreaders.txt
to be reverted. -
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