Different custom metadata parsing bioformat using Fiji/KNIME/command line

Hello there,
I am populating custom metadatas for images that I am converting to ome-tiff files and I was using Fiji to check the output.

I managed to setup the Instrument metadata, but for other fields such as ImageID and channelID I have some doubts.
The xmlvalid utility reports no issue, and tiffcomment also reports what I set in my code.
However in Fiji and KNIME the metadata is not exactly the same for these fields.
Here the section Image for the 3 different software.

  • tiffcomment (what is actually expected)
   <Image ID="Image:A001" Name="-A001--PO01--LO001--CO5--SL001--PX16250--PW0100--IN0100--TM285--X015530--Y010642--Z206827--T0021787723--WE00001.tif">
      <Description/>
      <ObjectiveSettings ID="Objective:4X"/>
      <Pixels BigEndian="true" DimensionOrder="XYCZT" ID="Pixels:0" Interleaved="false" PhysicalSizeX="1.625" PhysicalSizeXUnit="?m" PhysicalSizeY="1.625" PhysicalSizeYUnit="?m" SignificantBits="16" SizeC="1" SizeT="1" SizeX="512" SizeY="512" SizeZ="1" Type="uint16">
         <Channel AcquisitionMode="WideField" ContrastMethod="Fluorescence" ID="Channel:Fluo3" SamplesPerPixel="1">
            <LightPath/>
         </Channel>
         <Channel AcquisitionMode="WideField" ContrastMethod="Fluorescence" ID="Channel:Fluo5" SamplesPerPixel="1">
            <LightPath/>
         </Channel>
         <TiffData FirstC="0" FirstT="0" FirstZ="0" IFD="0" PlaneCount="1">
            <UUID FileName="-A001--PO01--LO001--CO5--SL001--PX16250--PW0100--IN0100--TM285--X015530--Y010642--Z206827--T0021787723--WE00001.ome.tiff">
               urn:uuid:5b9eabdf-a2a6-4216-80a4-d537893e7da5
            </UUID>
         </TiffData>
         <Plane ExposureTime="100.0" ExposureTimeUnit="ms" PositionZ="20.6827" PositionZUnit="mm" TheC="0" TheT="0" TheZ="0"/>
         <Plane ExposureTime="100.0" ExposureTimeUnit="ms" PositionZ="20.6827" PositionZUnit="mm" TheC="1" TheT="0" TheZ="0"/>
      </Pixels>
   </Image>
</OME>
  • Fiji
    Sorry the formatting is different but here the ImageId and channelId are different.
    The second channel is actually missing :sweat_smile:
<Image ID="Image:0" Name="-A001--PO01--LO001--CO5--SL001--PX16250--PW0100--IN0100--TM285--X015530--Y010642--Z206827--T0021787723--WE00001.tif">
			<Description/>
			<ObjectiveSettings ID="Objective:4X"/>
			<Pixels BigEndian="true" DimensionOrder="XYCZT" ID="Pixels:0" Interleaved="false" PhysicalSizeX="1.625" PhysicalSizeXUnit="µm" PhysicalSizeY="1.625" PhysicalSizeYUnit="µm" SignificantBits="16" SizeC="1" SizeT="1" SizeX="512" SizeY="512" SizeZ="1" Type="uint16">
				<Channel AcquisitionMode="WideField" ContrastMethod="Fluorescence" ID="Channel:0:0" SamplesPerPixel="1">
					<LightPath/>
					<TiffData FirstC="0" FirstT="0" FirstZ="0" IFD="0" PlaneCount="1">
						<UUID FileName="-A001--PO01--LO001--CO5--SL001--PX16250--PW0100--IN0100--TM285--X015530--Y010642--Z206827--T0021787723--WE00001.ome.tiff">urn:uuid:5b9eabdf-a2a6-4216-80a4-d537893e7da5</UUID>
						<Plane ExposureTime="100.0" ExposureTimeUnit="ms" PositionZ="20.6827" PositionZUnit="mm" TheC="0" TheT="0" TheZ="0"/>
						<Plane ExposureTime="100.0" ExposureTimeUnit="ms" PositionZ="20.6827" PositionZUnit="mm" TheC="1" TheT="0" TheZ="0"/>
  • KNIME
    There I have my 2 channels but the first one does not have the expected ID.
    Also the ImageID here is also 0 and not A001 and the Name contains the file path which was not the case before.
    <Image ID="Image:0" Name="C:\Users\Laurent Thomas\Documents\Acquifer\DataSet\ValerioOME\-A001--PO01--LO001--CO5--SL001--PX16250--PW0100--IN0100--TM285--X015530--Y010642--Z206827--T0021787723--WE00001.ome.tiff">
        <Description>
        </Description>
        <ObjectiveSettings ID="Objective:4X">
        </ObjectiveSettings>
        <Pixels BigEndian="true" DimensionOrder="XYCZT" ID="Pixels:0" Interleaved="false" PhysicalSizeX="1.625" PhysicalSizeXUnit="µm" PhysicalSizeY="1.625" PhysicalSizeYUnit="µm" PhysicalSizeZ="1.0" PhysicalSizeZUnit="µm" SignificantBits="16" SizeC="1" SizeT="1" SizeX="512" SizeY="512" SizeZ="1" TimeIncrement="1.0" TimeIncrementUnit="s" Type="uint16">
            <Channel AcquisitionMode="WideField" ContrastMethod="Fluorescence" ID="Channel:0:0" SamplesPerPixel="1">
                <LightPath>
                </LightPath>
            </Channel>
            <Channel AcquisitionMode="WideField" ContrastMethod="Fluorescence" ID="Channel:Fluo5" SamplesPerPixel="1">
                <LightPath>
                </LightPath>
            </Channel>
            <BinData BigEndian="true">
            </BinData>
            <TiffData FirstC="0" FirstT="0" FirstZ="0" IFD="0" PlaneCount="1">
                <UUID FileName="-A001--PO01--LO001--CO5--SL001--PX16250--PW0100--IN0100--TM285--X015530--Y010642--Z206827--T0021787723--WE00001.ome.tiff">urn:uuid:5b9eabdf-a2a6-4216-80a4-d537893e7da5</UUID>
            </TiffData>
            <Plane ExposureTime="100.0" ExposureTimeUnit="ms" PositionZ="20.6827" PositionZUnit="mm" TheC="0" TheT="0" TheZ="0">
            </Plane>
            <Plane ExposureTime="100.0" ExposureTimeUnit="ms" PositionZ="20.6827" PositionZUnit="mm" TheC="1" TheT="0" TheZ="0">
            </Plane>
        </Pixels>
    </Image>

Is it due to different versions of the bioformat metadata parser in those software ?
Maybe @dgault could shed some light there again :smiley:
Here is the file in question
-A001–PO01–LO001–CO5–SL001–PX16250–PW0100–IN0100–TM285–X015530–Y010642–Z206827–T0021787723–WE00001.ome.tiff (2.0 MB)

Hi @LThomas, the difference will be in how the readers are parsing the metadata. The Bio-Formats OMETiffReader which Fiji appears to be replacing the set ID’s with new values which I would consider a bug in the reader. I have opened a Bio-Formats GitHub Issue for this: OME-TIFF Reader overwriting IDS · Issue #3685 · ome/bioformats · GitHub

3 Likes

As a separate issue though, the reason why the channels for the FIJI XML may differ is due to having 2 channels listed but the sizeC on the Pixels object is 1. So you may want to update Pixels SizeC to 2.

2 Likes

Thanks a lot !
I knew something was wrong there but I could not spot it, thanks that should fix it !