<div dir="ltr">Hi Stuart,<div><br></div><div><div>> I'm attempting to add support for OME-TIFF export to my software</div><div>> (ilastik).</div></div><div><br></div><div>Wonderful! :-)</div><div><br></div><div><div>> - The original file has dimensions XYCZT, but 'C' and 'T' have size 1.</div><div>> In my version, I just omit those axes.  Is that permitted under the</div><div>> standard?</div></div><div><br></div><div>Nope. According to the OME-XML schema, the DimensionOrder attribute is an enumeration which must have a valid five-digit value; see:</div><div><br></div><div><a href="https://www.openmicroscopy.org/Schemas/Documentation/Generated/OME-2016-06/ome_xsd.html#Pixels_DimensionOrder">https://www.openmicroscopy.org/Schemas/Documentation/Generated/OME-2016-06/ome_xsd.html#Pixels_DimensionOrder</a><br></div><div><br></div><div>Instead of writing "XYZ" try writing "XYZCT" (or "XYZTC"; doesn't really matter since you only have 1 C and 1 T position).</div><div><br></div><div><div>> - The original file has 'ROI' entries in the metadata.  I'm omitting</div><div>> that information.  Is that standards-compliant?</div></div><div><br></div><div>It is not required to include ROI information. See the "minimum specification" for a compliant file:</div><div><br></div><div><a href="http://www.openmicroscopy.org/site/support/ome-model/specifications/minimum.html">http://www.openmicroscopy.org/site/support/ome-model/specifications/minimum.html</a><br></div><div><br></div><div>Note that your XML is much more complex than necessary, because you are writing a single-file OME-TIFF. As long as your IFDs are in Z-ascending order, you can simply write:</div><div><br></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0);font-size:14px"><?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: <a href="http://www.openmicroscopy.org/site/support/ome-model/ome-tiff/" target="_blank">http://www.openmicroscopy.org/site/support/ome-model/ome-tiff/</a>. -->
<OME xmlns="<a href="http://www.openmicroscopy.org/Schemas/OME/2015-01" target="_blank">http://www.openmicroscopy.org/Schemas/OME/2015-01</a>" xmlns:xsi="<a href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a>" xsi:schemaLocation="<a href="http://www.openmicroscopy.org/Schemas/OME/2015-01" target="_blank">http://www.openmicroscopy.org/Schemas/OME/2015-01</a> <a href="http://www.openmicroscopy.org/Schemas/OME/2015-01/ome.xsd" target="_blank">http://www.openmicroscopy.org/Schemas/OME/2015-01/ome.xsd</a>">
  <Image ID="Image:0" Name="exported-data">
    <Pixels BigEndian="true" DimensionOrder="XYZCT" ID="Pixels:0" SizeX="400" SizeY="300" SizeZ="4" Type="uint8">
      <Channel ID="Channel0:0" SamplesPerPixel="1">
        <LightPath />
      </Channel>
      <TiffData />
    </Pixels>
  </Image>
</OME></pre></div><div class="gmail_extra">And the mapping from IFDs to ZCT coordinates will be inferred as desired.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Lastly, you saw the OME-TIFF specification page, right?</div><div class="gmail_extra"><a href="http://www.openmicroscopy.org/site/support/ome-model/ome-tiff/specification.html">http://www.openmicroscopy.org/site/support/ome-model/ome-tiff/specification.html</a><br></div><div class="gmail_extra"><br></div><div class="gmail_extra">Regards,</div><div class="gmail_extra">Curtis</div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><span style="font-size:12.8px">--</span></div><div><span style="font-size:12.8px">Curtis Rueden</span><br></div><div><span style="font-size:12.8px">LOCI software architect - <a href="http://loci.wisc.edu/software" target="_blank">http://loci.wisc.edu/software</a></span></div><div>ImageJ2 lead, Fiji maintainer - <span style="font-size:12.8px"><a href="http://imagej.net/User:Rueden" target="_blank">http://imagej.net/User:Rueden</a></span></div><div>Did you know ImageJ has a forum? <a href="http://forum.imagej.net/" target="_blank">http://forum.imagej.net/</a></div><div><br></div></div></div></div></div></div></div></div>
<br><div class="gmail_quote">On Thu, Jul 28, 2016 at 4:02 PM, Berg, Stuart <span dir="ltr"><<a href="mailto:bergs@janelia.hhmi.org" target="_blank">bergs@janelia.hhmi.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">



<div style="word-wrap:break-word;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><span><?</span><span>xml version</span><span>=</span><span>"1.0"</span><span> encoding</span><span>=</span><span>"UTF-8"</span><span>?></span><span>
</span><span><!-- 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: <a href="http://www.openmicroscopy.org/site/support/ome-model/ome-tiff/" target="_blank">http://www.openmicroscopy.org/site/support/ome-model/ome-tiff/</a>. --></span><span>
</span><span><OME</span><span> </span><span>xmlns</span><span>=</span><span>"<a href="http://www.openmicroscopy.org/Schemas/OME/2015-01" target="_blank">http://www.openmicroscopy.org/Schemas/OME/2015-01</a>"</span><span> </span><span>xmlns:xsi</span><span>=</span><span>"<a href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a>"</span><span> </span><span>UUID</span><span>=</span><span>"urn:uuid:5cb6938c-5503-11e6-ade4-a45e60e933fb"</span><span> </span><span>xsi:schemaLocation</span><span>=</span><span>"<a href="http://www.openmicroscopy.org/Schemas/OME/2015-01" target="_blank">http://www.openmicroscopy.org/Schemas/OME/2015-01</a> <a href="http://www.openmicroscopy.org/Schemas/OME/2015-01/ome.xsd" target="_blank">http://www.openmicroscopy.org/Schemas/OME/2015-01/ome.xsd</a>"</span><span>></span><span>
  </span><span><Image</span><span> </span><span>ID</span><span>=</span><span>"Image:0"</span><span> </span><span>Name</span><span>=</span><span>"exported-data"</span><span>></span><span>
    </span><span><Pixels</span><span> </span><span>BigEndian</span><span>=</span><span>"true"</span><span> </span><span>DimensionOrder</span><span>=</span><span>"XYZ"</span><span> </span><span>ID</span><span>=</span><span>"Pixels:0"</span><span> </span><span>SizeX</span><span>=</span><span>"400"</span><span> </span><span>SizeY</span><span>=</span><span>"300"</span><span> </span><span>SizeZ</span><span>=</span><span>"4"</span><span> </span><span>Type</span><span>=</span><span>"uint8"</span><span>></span><span>
      </span><span><Channel</span><span> </span><span>ID</span><span>=</span><span>"Channel0:0"</span><span> </span><span>SamplesPerPixel</span><span>=</span><span>"1"</span><span>></span><span>
        </span><span><LightPath</span><span> </span><span>/></span><span>
      </span><span></Channel></span><span>
      </span><span><TiffData</span><span> </span><span>FirstZ</span><span>=</span><span>"0"</span><span> </span><span>IFD</span><span>=</span><span>"0"</span><span> </span><span>PlaneCount</span><span>=</span><span>"1"</span><span>></span><span>
        </span><span><UUID</span><span> </span><span>FileName</span><span>=</span><span>"xyz-converted.ome.tiff"</span><span>></span><span>urn:uuid:5cb6938c-5503-11e6-ade4-a45e60e933fb</span><span></UUID></span><span>
      </span><span></TiffData></span><span>
      </span><span><TiffData</span><span> </span><span>FirstZ</span><span>=</span><span>"1"</span><span> </span><span>IFD</span><span>=</span><span>"1"</span><span> </span><span>PlaneCount</span><span>=</span><span>"1"</span><span>></span><span>
        </span><span><UUID</span><span> </span><span>FileName</span><span>=</span><span>"xyz-converted.ome.tiff"</span><span>></span><span>urn:uuid:5cb6938c-5503-11e6-ade4-a45e60e933fb</span><span></UUID></span><span>
      </span><span></TiffData></span><span>
      </span><span><TiffData</span><span> </span><span>FirstZ</span><span>=</span><span>"2"</span><span> </span><span>IFD</span><span>=</span><span>"2"</span><span> </span><span>PlaneCount</span><span>=</span><span>"1"</span><span>></span><span>
        </span><span><UUID</span><span> </span><span>FileName</span><span>=</span><span>"xyz-converted.ome.tiff"</span><span>></span><span>urn:uuid:5cb6938c-5503-11e6-ade4-a45e60e933fb</span><span></UUID></span><span>
      </span><span></TiffData></span><span>
      </span><span><TiffData</span><span> </span><span>FirstZ</span><span>=</span><span>"3"</span><span> </span><span>IFD</span><span>=</span><span>"3"</span><span> </span><span>PlaneCount</span><span>=</span><span>"1"</span><span>></span><span>
        </span><span><UUID</span><span> </span><span>FileName</span><span>=</span><span>"xyz-converted.ome.tiff"</span><span>></span><span>urn:uuid:5cb6938c-5503-11e6-ade4-a45e60e933fb</span><span></UUID></span><span>
      </span><span></TiffData></span><span>
    </span><span></Pixels></span><span>
  </span><span></Image></span><span>
</span><span></OME></span></pre>
</div>
</div>

<br>_______________________________________________<br>
ome-devel mailing list<br>
<a href="mailto:ome-devel@lists.openmicroscopy.org.uk">ome-devel@lists.openmicroscopy.org.uk</a><br>
<a href="http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel" rel="noreferrer" target="_blank">http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel</a><br>
<br></blockquote></div><br></div></div>