How to represent tiles in OME-tiff

I have a development question for the OME team.

I am developing a C# application, and I want to make sure that I am following your recommendations to ensure compatibility. How do you recommend I write OME-tiff files that are tiles of a much larger image?

I found this in your documentation:

The images that I write are normally a grid of about 7 x 20 tiles with 3+ channels.
Here is a snippet of the metadata that I write:

  <Image ID="Image:00" Name="Images">
    <Description>OME-Tiff image</Description>
    <StageLabel Name="X,Y:0,0" X="0" Y="0" />
    <Pixels DimensionOrder="XYCZT" Type="uint8" SizeX="2464" SizeY="2056" SizeZ="1" SizeC="3" SizeT="1" PhysicalSizeX="2.3" PhysicalSizeZUnit="pixel">
      <Channel ID="Channel:0:2" Fluor="Brightfield">
        <LightSourceSettings Attenuation="3" Wavelength="0" />
        <DetectorSettings Gain="1" Binning="Other" />
          <ExcitationFilterRef />
      <Channel ID="Channel:1:2" Fluor="Green">
        <LightSourceSettings Attenuation="451" Wavelength="555" />
        <DetectorSettings Gain="4.25" Binning="Other" />
          <ExcitationFilterRef />
      <Channel ID="Channel:2:2" Fluor="Red">
        <LightSourceSettings Attenuation="897" Wavelength="635" />
        <DetectorSettings Gain="4.25" Binning="Other" />
          <ExcitationFilterRef />
        <UUID FileName="image_102338_Y0000_X0000_C0000.ome.tiff">e7f59c83-296a-4d65-a48d-a8753612516e</UUID>
      <TiffData FirstC="1">
        <UUID FileName="image_102338_Y0000_X0000_C0001.ome.tiff">c8ae6859-c024-43b5-8fda-70acd9ab74da</UUID>
      <TiffData FirstC="2">
        <UUID FileName="image_102338_Y0000_X0000_C0002.ome.tiff">6b62a61d-ddec-417f-81ec-804739ec51ab</UUID>
      <Plane TheZ="0" TheT="0" TheC="0" ExposureTime="0.4" ExposureTimeUnit="ms" PositionX="1059583" PositionY="46159" PositionZ="743212" />
      <Plane TheZ="0" TheT="0" TheC="1" ExposureTime="24.5" ExposureTimeUnit="ms" PositionX="1059583" PositionY="46159" PositionZ="743212" />
      <Plane TheZ="0" TheT="0" TheC="2" ExposureTime="24.5" ExposureTimeUnit="ms" PositionX="1059583" PositionY="46159" PositionZ="743212" />
    <AnnotationRef ID="OverlapRatioX" />
    <AnnotationRef ID="OverlapRatioY" />
    <AnnotationRef ID="AutofocusChannelIndex" />

I am able to pull all of the information I need to layout the image in my application from those 3 <Plane> tags, but ideally you could load these images into your viewer of choice. The tags don’t seem to register when using the ImageJ Bio-Formats importer, instead the tiles are opened as time-points and z-slices. Am I doing it correctly, and it is just up to the reader/viewer to implement the tile layout?

If you could point me towards some documentation I am missing or example datasets that would be awesome! Thanks in advance for your help.

This might be related to this topic and this GitHub issue

Hi @boonepeter, for standard tiling of any TIFF based format (including OME-TIFF) I would suggest using the TIFF tags TILE_LENGTH and TILE_WIDTH. See for standard writing of tiled data and some examples if using the Bio-Formats API.

Out of curiosity are you using any API for the writing of the data or is all custom code in C#?

The method you are using can also be used but will use a TileStitcher to read the data, In the ImageJ Bio-Formats importer you can do this by selecting the Importer Option 'Stitch Tiles'.

Thanks @dgault, I will take a look at that.

I am using LibTiff.NET for the baseline writing of tiff files, and I auto-generated a C# class based on your XSD which I use to write the OME-tiff xml metadata.