[ome-devel] Is OME-TIF file with 2 image series of different pixel types supported?

Michael Ellis michael.ellis at dsuk.biz
Thu Dec 1 10:48:53 GMT 2016


BioFormats does not seem to cope with a single OME.TIF file that contains 2 image series one with pixel type uint16 and one with pixel type uint8.

I can create the file with no problem but both the bftools showinfo command line tool and the ImageJ BioFormats importer crash when trying to load the file.

I realise mixing two images of different pixel types in a single OME.TIF file is somewhat bizarre. I have no actual need to do this but stumbled upon the situation whilst designing unit tests for my code.

My questions are:

- Is there anything else apparent from the output that points to anything wrong that I am doing?
- Is this a bug or a feature?
- If it is a feature, then where is it documented?

— Michael Ellis

————————————————————————————————————————————

The OME XML generated in my file is as follows:

<?xml version="1.0" encoding="UTF-8"?>
<!-- Warning: this comment is an OME-XML metadata block, which contains crucial dimensional parameters and other important metadata. Please edit cautiously (if at all), and back up the original data before doing so. For more information, see the OME-TIFF web site: http://www.openmicroscopy.org/site/support/ome-model/ome-tiff/. -->
<OME xmlns="http://www.openmicroscopy.org/Schemas/OME/2016-06" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Creator="OME Bio-Formats 5.2.3" UUID="urn:uuid:04df9ee3-9224-4618-a0e3-0033185b9f66" xsi:schemaLocation="http://www.openmicroscopy.org/Schemas/OME/2016-06 http://www.openmicroscopy.org/Schemas/OME/2016-06/ome.xsd">
   <Image ID="Image:0" Name="Image-0">
      <Pixels DimensionOrder="XYCTZ" ID="Pixels:0" PhysicalSizeX="0.00645" PhysicalSizeXUnit="µm" PhysicalSizeY="0.00645" PhysicalSizeYUnit="µm" SizeC="3" SizeT="1" SizeX="1300" SizeY="1000" SizeZ="1" Type="uint8">
         <Channel Color="65535" ContrastMethod="Fluorescence" ID="Channel:0:0" Name="Dapi" SamplesPerPixel="1">
            <LightPath/>
         </Channel>
         <Channel Color="16711935" ContrastMethod="Fluorescence" ID="Channel:0:1" Name="Fitc" SamplesPerPixel="1">
            <LightPath/>
         </Channel>
         <Channel Color="-16776961" ContrastMethod="Fluorescence" ID="Channel:0:2" Name="TxRed" SamplesPerPixel="1">
            <LightPath/>
         </Channel>
         <TiffData FirstC="0" FirstT="0" FirstZ="0" IFD="0" PlaneCount="1">
            <UUID FileName="BioFormat.ome.tif">
               urn:uuid:04df9ee3-9224-4618-a0e3-0033185b9f66
            </UUID>
         </TiffData>
         <TiffData FirstC="1" FirstT="0" FirstZ="0" IFD="1" PlaneCount="1">
            <UUID FileName="BioFormat.ome.tif">
               urn:uuid:04df9ee3-9224-4618-a0e3-0033185b9f66
            </UUID>
         </TiffData>
         <TiffData FirstC="2" FirstT="0" FirstZ="0" IFD="2" PlaneCount="1">
            <UUID FileName="BioFormat.ome.tif">
               urn:uuid:04df9ee3-9224-4618-a0e3-0033185b9f66
            </UUID>
         </TiffData>
      </Pixels>
   </Image>
   <Image ID="Image:1" Name="Image-1">
      <Pixels DimensionOrder="XYCTZ" ID="Pixels:1" PhysicalSizeX="0.00645" PhysicalSizeXUnit="µm" PhysicalSizeY="0.00645" PhysicalSizeYUnit="µm" SizeC="3" SizeT="1" SizeX="1300" SizeY="1000" SizeZ="1" Type="uint16">
         <Channel Color="65535" ContrastMethod="Fluorescence" ID="Channel:1:0" Name="Dapi" SamplesPerPixel="1">
            <LightPath/>
         </Channel>
         <Channel Color="16711935" ContrastMethod="Fluorescence" ID="Channel:1:1" Name="Fitc" SamplesPerPixel="1">
            <LightPath/>
         </Channel>
         <Channel Color="-16776961" ContrastMethod="Fluorescence" ID="Channel:1:2" Name="TxRed" SamplesPerPixel="1">
            <LightPath/>
         </Channel>
      </Pixels>
   </Image>
</OME>

————————————————————————————————————————————

The BioFormat showinfo command line tool gives the following:


Checking file format [OME-TIFF]
Initializing reader
OMETiffReader initializing /Users/michaelellis/Documents/Development/SmartCapture4/BioFormat.ome.tif
Reading IFDs
Populating metadata
Image ID 'Image:1': missing plane #0.  Using TiffReader to determine the number of planes.
Reading IFDs
Populating metadata
Checking comment style
Populating OME metadata
Reading IFDs
Populating metadata
Checking comment style
Populating OME metadata
Initialization took 0.082s

Reading core metadata
filename = /Users/michaelellis/Documents/Development/SmartCapture4/BioFormat.ome.tif
Series count = 2
Series #0 :
	Image count = 3
	RGB = false (1) 
	Interleaved = false
	Indexed = false (false color)
	Width = 1300
	Height = 1000
	SizeZ = 1
	SizeT = 1
	SizeC = 3
	Thumbnail size = 128 x 98
	Endianness = motorola (big)
	Dimension order = XYCTZ (certain)
	Pixel type = uint8
	Valid bits per pixel = 8
	Metadata complete = true
	Thumbnail series = false
	-----
	Plane #0 <=> Z 0, C 0, T 0
	Plane #1 <=> Z 0, C 1, T 0
	Plane #2 <=> Z 0, C 2, T 0

Series #1 :
	Image count = 3
	RGB = false (1) 
	Interleaved = false
	Indexed = false (false color)
	Width = 1300
	Height = 1000
	SizeZ = 1
	SizeT = 1
	SizeC = 3
	Thumbnail size = 128 x 98
	Endianness = motorola (big)
	Dimension order = XYCTZ (certain)
	Pixel type = uint16
	Valid bits per pixel = 16
	Metadata complete = true
	Thumbnail series = false
	-----
	Plane #0 <=> Z 0, C 0, T 0
	Plane #1 <=> Z 0, C 1, T 0
	Plane #2 <=> Z 0, C 2, T 0


Reading series #0 pixel data (0-2)
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException
	at java.lang.System.arraycopy(Native Method)
	at loci.formats.tiff.TiffParser.getSamples(TiffParser.java:1021)
	at loci.formats.tiff.TiffParser.getSamples(TiffParser.java:783)
	at loci.formats.in.OMETiffReader.openBytes(OMETiffReader.java:360)
	at loci.formats.FormatReader.openBytes(FormatReader.java:890)
	at loci.formats.ImageReader.openBytes(ImageReader.java:437)
	at loci.formats.ReaderWrapper.openBytes(ReaderWrapper.java:335)
	at loci.formats.gui.BufferedImageReader.openImage(BufferedImageReader.java:86)
	at loci.formats.tools.ImageInfo.readPixels(ImageInfo.java:811)
	at loci.formats.tools.ImageInfo.testRead(ImageInfo.java:1041)
	at loci.formats.tools.ImageInfo.main(ImageInfo.java:1107)

————————————————————————————————————————————
The ImageJ BioFormats Importer stack trace is:


ImageJ 1.51g; Java 1.8.0_91 [64-bit]; Mac OS X 10.11.6; 194MB of 3000MB (6%)
 
java.lang.ArrayIndexOutOfBoundsException
	at java.lang.System.arraycopy(Native Method)
	at loci.formats.tiff.TiffParser.getSamples(TiffParser.java:1021)
	at loci.formats.tiff.TiffParser.getSamples(TiffParser.java:783)
	at loci.formats.in.OMETiffReader.openBytes(OMETiffReader.java:360)
	at loci.formats.ChannelFiller.openBytes(ChannelFiller.java:156)
	at loci.formats.ChannelSeparator.openBytes(ChannelSeparator.java:225)
	at loci.formats.ChannelSeparator.openBytes(ChannelSeparator.java:157)
	at loci.formats.ReaderWrapper.openBytes(ReaderWrapper.java:335)
	at loci.formats.DimensionSwapper.openBytes(DimensionSwapper.java:233)
	at loci.formats.ReaderWrapper.openBytes(ReaderWrapper.java:335)
	at loci.formats.ReaderWrapper.openBytes(ReaderWrapper.java:335)
	at loci.plugins.util.ImageProcessorReader.openProcessors(ImageProcessorReader.java:186)
	at loci.plugins.in.ImagePlusReader.readProcessors(ImagePlusReader.java:416)
	at loci.plugins.in.ImagePlusReader.readPlanes(ImagePlusReader.java:380)
	at loci.plugins.in.ImagePlusReader.readImage(ImagePlusReader.java:277)
	at loci.plugins.in.ImagePlusReader.readImages(ImagePlusReader.java:238)
	at loci.plugins.in.ImagePlusReader.readImages(ImagePlusReader.java:216)
	at loci.plugins.in.ImagePlusReader.openImagePlus(ImagePlusReader.java:111)
	at loci.plugins.in.Importer.readPixels(Importer.java:149)
	at loci.plugins.in.Importer.run(Importer.java:86)
	at loci.plugins.LociImporter.run(LociImporter.java:78)
	at ij.IJ.runUserPlugIn(IJ.java:217)
	at ij.IJ.runPlugIn(IJ.java:181)
	at ij.Executer.runCommand(Executer.java:137)
	at ij.Executer.run(Executer.java:66)
	at java.lang.Thread.run(Thread.java:745)

————————————————————————————————————————————




More information about the ome-devel mailing list