<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; font-family: Calibri, sans-serif; font-size: 14px; color: rgb(0, 0, 0);">
<div>Greetings,</div>
<div><br>
</div>
<div>I'm attempting to add support for OME-TIFF export to my software (ilastik).  Since writing the OME-TIFF header seems simple enough (for simple cases, anyway), I want to avoid using an external library like python-bioformats.</div>
<div><br>
</div>
<div>But apparently I'm doing something wrong, because the files I'm producing can't be read correctly by the Fiji BioFormats plugin.  I'd appreciate it if someone can tell me what I'm doing wrong.  I've attached two files.  One is a valid OME-TIFF file, and
 the other is my "converted" version of it (same data, but the XML header was written by my software).  The OME header from my version is pasted below.</div>
<div><br>
</div>
<div>When I use the BioFormats Importer to read my 'converted' file, the header seems to be ignored, and instead BioFormats guesses that the file is a T-stack, not a Z-stack as I intended.</div>
<div><br>
</div>
<div>Questions:</div>
<div>- The original file has dimensions XYCZT, but 'C' and 'T' have size 1.  In my version, I just omit those axes.  Is that permitted under the standard?</div>
<div>- The original file has 'ROI' entries in the metadata.  I'm omitting that information.  Is that standards-compliant?</div>
<div><br>
</div>
<div>Best regards,</div>
<div>Stuart</div>
<div><br>
</div>
<div>PS — The </div>
<div><br>
</div>
<div>Here's the header I'm writing.  If you spot any obvious errors, let me know.</div>
<div>
<pre id="xmlOutput" class="xml prettyprint"><span class="pun"><?</span><span class="pln">xml version</span><span class="pun">=</span><span class="str">"1.0"</span><span class="pln"> encoding</span><span class="pun">=</span><span class="str">"UTF-8"</span><span class="pun">?></span><span class="pln">
</span><span class="com"><!-- 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/. --></span><span class="pln">
</span><span class="tag"><OME</span><span class="pln"> </span><span class="atn">xmlns</span><span class="pun">=</span><span class="atv">"http://www.openmicroscopy.org/Schemas/OME/2015-01"</span><span class="pln"> </span><span class="atn">xmlns:xsi</span><span class="pun">=</span><span class="atv">"http://www.w3.org/2001/XMLSchema-instance"</span><span class="pln"> </span><span class="atn">UUID</span><span class="pun">=</span><span class="atv">"urn:uuid:5cb6938c-5503-11e6-ade4-a45e60e933fb"</span><span class="pln"> </span><span class="atn">xsi:schemaLocation</span><span class="pun">=</span><span class="atv">"http://www.openmicroscopy.org/Schemas/OME/2015-01 http://www.openmicroscopy.org/Schemas/OME/2015-01/ome.xsd"</span><span class="tag">></span><span class="pln">
  </span><span class="tag"><Image</span><span class="pln"> </span><span class="atn">ID</span><span class="pun">=</span><span class="atv">"Image:0"</span><span class="pln"> </span><span class="atn">Name</span><span class="pun">=</span><span class="atv">"exported-data"</span><span class="tag">></span><span class="pln">
    </span><span class="tag"><Pixels</span><span class="pln"> </span><span class="atn">BigEndian</span><span class="pun">=</span><span class="atv">"true"</span><span class="pln"> </span><span class="atn">DimensionOrder</span><span class="pun">=</span><span class="atv">"XYZ"</span><span class="pln"> </span><span class="atn">ID</span><span class="pun">=</span><span class="atv">"Pixels:0"</span><span class="pln"> </span><span class="atn">SizeX</span><span class="pun">=</span><span class="atv">"400"</span><span class="pln"> </span><span class="atn">SizeY</span><span class="pun">=</span><span class="atv">"300"</span><span class="pln"> </span><span class="atn">SizeZ</span><span class="pun">=</span><span class="atv">"4"</span><span class="pln"> </span><span class="atn">Type</span><span class="pun">=</span><span class="atv">"uint8"</span><span class="tag">></span><span class="pln">
      </span><span class="tag"><Channel</span><span class="pln"> </span><span class="atn">ID</span><span class="pun">=</span><span class="atv">"Channel0:0"</span><span class="pln"> </span><span class="atn">SamplesPerPixel</span><span class="pun">=</span><span class="atv">"1"</span><span class="tag">></span><span class="pln">
        </span><span class="tag"><LightPath</span><span class="pln"> </span><span class="tag">/></span><span class="pln">
      </span><span class="tag"></Channel></span><span class="pln">
      </span><span class="tag"><TiffData</span><span class="pln"> </span><span class="atn">FirstZ</span><span class="pun">=</span><span class="atv">"0"</span><span class="pln"> </span><span class="atn">IFD</span><span class="pun">=</span><span class="atv">"0"</span><span class="pln"> </span><span class="atn">PlaneCount</span><span class="pun">=</span><span class="atv">"1"</span><span class="tag">></span><span class="pln">
        </span><span class="tag"><UUID</span><span class="pln"> </span><span class="atn">FileName</span><span class="pun">=</span><span class="atv">"xyz-converted.ome.tiff"</span><span class="tag">></span><span class="pln">urn:uuid:5cb6938c-5503-11e6-ade4-a45e60e933fb</span><span class="tag"></UUID></span><span class="pln">
      </span><span class="tag"></TiffData></span><span class="pln">
      </span><span class="tag"><TiffData</span><span class="pln"> </span><span class="atn">FirstZ</span><span class="pun">=</span><span class="atv">"1"</span><span class="pln"> </span><span class="atn">IFD</span><span class="pun">=</span><span class="atv">"1"</span><span class="pln"> </span><span class="atn">PlaneCount</span><span class="pun">=</span><span class="atv">"1"</span><span class="tag">></span><span class="pln">
        </span><span class="tag"><UUID</span><span class="pln"> </span><span class="atn">FileName</span><span class="pun">=</span><span class="atv">"xyz-converted.ome.tiff"</span><span class="tag">></span><span class="pln">urn:uuid:5cb6938c-5503-11e6-ade4-a45e60e933fb</span><span class="tag"></UUID></span><span class="pln">
      </span><span class="tag"></TiffData></span><span class="pln">
      </span><span class="tag"><TiffData</span><span class="pln"> </span><span class="atn">FirstZ</span><span class="pun">=</span><span class="atv">"2"</span><span class="pln"> </span><span class="atn">IFD</span><span class="pun">=</span><span class="atv">"2"</span><span class="pln"> </span><span class="atn">PlaneCount</span><span class="pun">=</span><span class="atv">"1"</span><span class="tag">></span><span class="pln">
        </span><span class="tag"><UUID</span><span class="pln"> </span><span class="atn">FileName</span><span class="pun">=</span><span class="atv">"xyz-converted.ome.tiff"</span><span class="tag">></span><span class="pln">urn:uuid:5cb6938c-5503-11e6-ade4-a45e60e933fb</span><span class="tag"></UUID></span><span class="pln">
      </span><span class="tag"></TiffData></span><span class="pln">
      </span><span class="tag"><TiffData</span><span class="pln"> </span><span class="atn">FirstZ</span><span class="pun">=</span><span class="atv">"3"</span><span class="pln"> </span><span class="atn">IFD</span><span class="pun">=</span><span class="atv">"3"</span><span class="pln"> </span><span class="atn">PlaneCount</span><span class="pun">=</span><span class="atv">"1"</span><span class="tag">></span><span class="pln">
        </span><span class="tag"><UUID</span><span class="pln"> </span><span class="atn">FileName</span><span class="pun">=</span><span class="atv">"xyz-converted.ome.tiff"</span><span class="tag">></span><span class="pln">urn:uuid:5cb6938c-5503-11e6-ade4-a45e60e933fb</span><span class="tag"></UUID></span><span class="pln">
      </span><span class="tag"></TiffData></span><span class="pln">
    </span><span class="tag"></Pixels></span><span class="pln">
  </span><span class="tag"></Image></span><span class="pln">
</span><span class="tag"></OME></span></pre>
</div>
</body>
</html>