ome / bioformats

Bio-Formats is a Java library for reading and writing data in life sciences image file formats. It is developed by the Open Microscopy Environment. Bio-Formats is released under the GNU General Public License (GPL); commercial licenses are available from Glencoe Software.
https://www.openmicroscopy.org/bio-formats
GNU General Public License v2.0
376 stars 242 forks source link

incorrect UUID of tiled image #3451

Open atarkowska opened 4 years ago

atarkowska commented 4 years ago

Tiling images using bfconvert:

bfconvert /tmp/source.tif /tmp/test/prefix_X%xY%y_Z%z_T%t_C%c.ome.tiff -tilex 1024 -tiley 1024 -option ometiff.companion prefix.companion.ome

generate incorrect UUID


$ showinf /tmp/test/prefix_X5Y5_Z0_T0_C0.ome.tiff
...
Failure during the reader initialization

loci.formats.FormatException: Unmatched UUID: urn:uuid:b5274599-c5cd-4c08-b22a-b9f019643708
    at loci.formats.in.OMETiffReader.initFile(OMETiffReader.java:757) ~[bioformats_package.jar:6.2.1]
    at loci.formats.FormatReader.setId(FormatReader.java:1389) ~[bioformats_package.jar:6.2.1]
    at loci.formats.ImageReader.setId(ImageReader.java:843) ~[bioformats_package.jar:6.2.1]
    at loci.formats.ReaderWrapper.setId(ReaderWrapper.java:650) ~[bioformats_package.jar:6.2.1]
    at loci.formats.tools.ImageInfo.testRead(ImageInfo.java:1035) [bioformats_package.jar:6.2.1]
    at loci.formats.tools.ImageInfo.main(ImageInfo.java:1121) [bioformats_package.jar:6.2.1]
sbesson commented 4 years ago

Hi @olatarkowska, I failed to reproduce the exception using the following command:

bfconvert /tmp/source.tif /tmp/test/prefix_X%xY%y_Z%z_T%t_C%c.ome.tiff -tilex 128 -tiley 128 -option ometiff.companion prefix.companion.ome

and /tmp/source.tif being either a single 512x152 plane containing two 512x512 planes. What are the dimensions of the source file?

Also, the usage of %x and %y patterns in the bfconvert command can be used to create basic TIFF files, one per tile. However, the current OME-TIFF specification does not support the distribution of tiles as separate TIFF files. Tiled images can be created according the TIFF specification and the TiffData element in the OME metadata can refer to the tiled plane using the TIFF IFD.