<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;">
<div>Thanks for the quick diagnosis, guys! Explicitly listing all 5 axes in the metadata fixed the issue. I suppose I should have tried that before bothering you. :-)</div>
<div><br>
</div>
<div>Cheers,</div>
<div>Stuart</div>
<div><br>
</div>
<div><br>
</div>
<span id="OLK_SRC_BODY_SECTION">
<div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<span style="font-weight:bold">From: </span>ome-devel <<a href="mailto:ome-devel-bounces@lists.openmicroscopy.org.uk">ome-devel-bounces@lists.openmicroscopy.org.uk</a>> on behalf of "Sebastien Besson (Staff)" <<a href="mailto:s.besson@dundee.ac.uk">s.besson@dundee.ac.uk</a>><br>
<span style="font-weight:bold">Reply-To: </span>OME External Developer List <<a href="mailto:ome-devel@lists.openmicroscopy.org.uk">ome-devel@lists.openmicroscopy.org.uk</a>><br>
<span style="font-weight:bold">Date: </span>Thursday, July 28, 2016 at 5:43 PM<br>
<span style="font-weight:bold">To: </span>devel OME <<a href="mailto:ome-devel@lists.openmicroscopy.org.uk">ome-devel@lists.openmicroscopy.org.uk</a>><br>
<span style="font-weight:bold">Cc: </span>"Maier, Lorenz" <<a href="mailto:l.maier@dkfz-heidelberg.de">l.maier@dkfz-heidelberg.de</a>><br>
<span style="font-weight:bold">Subject: </span>Re: [ome-devel] Help with writing OME-TIFF<br>
</div>
<div><br>
</div>
<blockquote id="MAC_OUTLOOK_ATTRIBUTION_BLOCKQUOTE" style="BORDER-LEFT: #b5c4df 5 solid; PADDING:0 0 0 5; MARGIN:0 0 0 5;">
<div>
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
Hi Stuart,
<div class=""><br class="">
</div>
<div class="">As Curtis nicely described, some of the elements in your OME-XML header</div>
<div class="">are invalid. Thus Bio-Formats will read your file as a regular multi-page TIFF</div>
<div class="">(using T as the dimension to concatenate all planes) instead of an OME-TIFF.</div>
<div class=""><br class="">
</div>
<div class="">In general, the Bio-Formats command line tools [1] might provide utilities to</div>
<div class="">help you debugging and validating the content of your OME-XML. For instance,</div>
<div class="">you should be able to run the following on your generated OME-TIFF:</div>
<div class=""><br class="">
</div>
<span class="">$ tiffcomment xyz-converted.ome.tiff | xmlvalid<br class="">
</span><span class=""><br class="">
to extract the OME-XML header and list all the validation errors.</span>
<div class=""><span class=""><br class="">
</span>
<div class="">Let us know if anything is unclear,</div>
<div class="">Sebastien</div>
<div class=""><br class="">
</div>
<div class="">[1] <a href="http://www.openmicroscopy.org/site/support/bio-formats5.1/users/comlinetools/index.html" class="">http://www.openmicroscopy.org/site/support/bio-formats5.1/users/comlinetools/index.html</a></div>
<div class=""><br class="">
<div>
<blockquote type="cite" class="">
<div class="">On 28 Jul 2016, at 22:32, Curtis Rueden <<a href="mailto:ctrueden@wisc.edu" class="">ctrueden@wisc.edu</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div dir="ltr" class="">Hi Stuart,
<div class=""><br class="">
</div>
<div class="">
<div class="">> I'm attempting to add support for OME-TIFF export to my software</div>
<div class="">> (ilastik).</div>
</div>
<div class=""><br class="">
</div>
<div class="">Wonderful! :-)</div>
<div class=""><br class="">
</div>
<div class="">
<div class="">> - The original file has dimensions XYCZT, but 'C' and 'T' have size 1.</div>
<div class="">> In my version, I just omit those axes. Is that permitted under the</div>
<div class="">> standard?</div>
</div>
<div class=""><br class="">
</div>
<div class="">Nope. According to the OME-XML schema, the DimensionOrder attribute is an enumeration which must have a valid five-digit value; see:</div>
<div class=""><br class="">
</div>
<div class=""><a href="https://www.openmicroscopy.org/Schemas/Documentation/Generated/OME-2016-06/ome_xsd.html#Pixels_DimensionOrder" class="">https://www.openmicroscopy.org/Schemas/Documentation/Generated/OME-2016-06/ome_xsd.html#Pixels_DimensionOrder</a><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">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 class=""><br class="">
</div>
<div class="">
<div class="">> - The original file has 'ROI' entries in the metadata. I'm omitting</div>
<div class="">> that information. Is that standards-compliant?</div>
</div>
<div class=""><br class="">
</div>
<div class="">It is not required to include ROI information. See the "minimum specification" for a compliant file:</div>
<div class=""><br class="">
</div>
<div class=""><a href="http://www.openmicroscopy.org/site/support/ome-model/specifications/minimum.html" class="">http://www.openmicroscopy.org/site/support/ome-model/specifications/minimum.html</a><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">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 class=""><br class="">
</div>
<div class="">
<pre style="white-space: pre-wrap; font-size: 14px;" class=""><?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" class="">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" class="">http://www.openmicroscopy.org/Schemas/OME/2015-01</a>" xmlns:xsi="<a href="http://www.w3.org/2001/XMLSchema-instance" target="_blank" class="">http://www.w3.org/2001/XMLSchema-instance</a>" xsi:schemaLocation="<a href="http://www.openmicroscopy.org/Schemas/OME/2015-01" target="_blank" class="">http://www.openmicroscopy.org/Schemas/OME/2015-01</a> <a href="http://www.openmicroscopy.org/Schemas/OME/2015-01/ome.xsd" target="_blank" class="">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 class="">
</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" class="">http://www.openmicroscopy.org/site/support/ome-model/ome-tiff/specification.html</a><br class="">
</div>
<div class="gmail_extra"><br class="">
</div>
<div class="gmail_extra">Regards,</div>
<div class="gmail_extra">Curtis</div>
<div class="gmail_extra"><br clear="all" class="">
<div class="">
<div class="gmail_signature">
<div dir="ltr" class="">
<div class="">
<div dir="ltr" class="">
<div class="">
<div dir="ltr" class="">
<div class=""><span style="font-size:12.8px" class="">--</span></div>
<div class=""><span style="font-size:12.8px" class="">Curtis Rueden</span><br class="">
</div>
<div class=""><span style="font-size:12.8px" class="">LOCI software architect - <a href="http://loci.wisc.edu/software" target="_blank" class="">
http://loci.wisc.edu/software</a></span></div>
<div class="">ImageJ2 lead, Fiji maintainer - <span style="font-size:12.8px" class=""><a href="http://imagej.net/User:Rueden" target="_blank" class="">http://imagej.net/User:Rueden</a></span></div>
<div class="">Did you know ImageJ has a forum? <a href="http://forum.imagej.net/" target="_blank" class="">
http://forum.imagej.net/</a></div>
<div class=""><br class="">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br class="">
<div class="gmail_quote">On Thu, Jul 28, 2016 at 4:02 PM, Berg, Stuart <span dir="ltr" class="">
<<a href="mailto:bergs@janelia.hhmi.org" target="_blank" class="">bergs@janelia.hhmi.org</a>></span> wrote:<br class="">
<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;" class="">
<div class="">Greetings,</div>
<div class=""><br class="">
</div>
<div class="">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 class=""><br class="">
</div>
<div class="">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 class=""><br class="">
</div>
<div class="">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 class=""><br class="">
</div>
<div class="">Questions:</div>
<div class="">- 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 class="">- The original file has 'ROI' entries in the metadata. I'm omitting that information. Is that standards-compliant?</div>
<div class=""><br class="">
</div>
<div class="">Best regards,</div>
<div class="">Stuart</div>
<div class=""><br class="">
</div>
<div class="">PS — The </div>
<div class=""><br class="">
</div>
<div class="">Here's the header I'm writing. If you spot any obvious errors, let me know.</div>
<div class="">
<pre class=""><span class=""><?</span><span class="">xml version</span><span class="">=</span><span class="">"1.0"</span><span class=""> encoding</span><span class="">=</span><span class="">"UTF-8"</span><span class="">?></span><span class=""></span><span class=""><!-- 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" class="">http://www.openmicroscopy.org/site/support/ome-model/ome-tiff/</a>. --></span><span class=""></span><span class=""><OME</span><span class=""> </span><span class="">xmlns</span><span class="">=</span><span class="">"<a href="http://www.openmicroscopy.org/Schemas/OME/2015-01" target="_blank" class="">http://www.openmicroscopy.org/Schemas/OME/2015-01</a>"</span><span class=""> </span><span class="">xmlns:xsi</span><span class="">=</span><span class="">"<a href="http://www.w3.org/2001/XMLSchema-instance" target="_blank" class="">http://www.w3.org/2001/XMLSchema-instance</a>"</span><span class=""> </span><span class="">UUID</span><span class="">=</span><span class="">"urn:uuid:5cb6938c-5503-11e6-ade4-a45e60e933fb"</span><span class=""> </span><span class="">xsi:schemaLocation</span><span class="">=</span><span class="">"<a href="http://www.openmicroscopy.org/Schemas/OME/2015-01" target="_blank" class="">http://www.openmicroscopy.org/Schemas/OME/2015-01</a> <a href="http://www.openmicroscopy.org/Schemas/OME/2015-01/ome.xsd" target="_blank" class="">http://www.openmicroscopy.org/Schemas/OME/2015-01/ome.xsd</a>"</span><span class="">></span><span class="">
</span><span class=""><Image</span><span class=""> </span><span class="">ID</span><span class="">=</span><span class="">"Image:0"</span><span class=""> </span><span class="">Name</span><span class="">=</span><span class="">"exported-data"</span><span class="">></span><span class="">
</span><span class=""><Pixels</span><span class=""> </span><span class="">BigEndian</span><span class="">=</span><span class="">"true"</span><span class=""> </span><span class="">DimensionOrder</span><span class="">=</span><span class="">"XYZ"</span><span class=""> </span><span class="">ID</span><span class="">=</span><span class="">"Pixels:0"</span><span class=""> </span><span class="">SizeX</span><span class="">=</span><span class="">"400"</span><span class=""> </span><span class="">SizeY</span><span class="">=</span><span class="">"300"</span><span class=""> </span><span class="">SizeZ</span><span class="">=</span><span class="">"4"</span><span class=""> </span><span class="">Type</span><span class="">=</span><span class="">"uint8"</span><span class="">></span><span class="">
</span><span class=""><Channel</span><span class=""> </span><span class="">ID</span><span class="">=</span><span class="">"Channel0:0"</span><span class=""> </span><span class="">SamplesPerPixel</span><span class="">=</span><span class="">"1"</span><span class="">></span><span class="">
</span><span class=""><LightPath</span><span class=""> </span><span class="">/></span><span class="">
</span><span class=""></Channel></span><span class="">
</span><span class=""><TiffData</span><span class=""> </span><span class="">FirstZ</span><span class="">=</span><span class="">"0"</span><span class=""> </span><span class="">IFD</span><span class="">=</span><span class="">"0"</span><span class=""> </span><span class="">PlaneCount</span><span class="">=</span><span class="">"1"</span><span class="">></span><span class="">
</span><span class=""><UUID</span><span class=""> </span><span class="">FileName</span><span class="">=</span><span class="">"xyz-converted.ome.tiff"</span><span class="">></span><span class="">urn:uuid:5cb6938c-5503-11e6-ade4-a45e60e933fb</span><span class=""></UUID></span><span class="">
</span><span class=""></TiffData></span><span class="">
</span><span class=""><TiffData</span><span class=""> </span><span class="">FirstZ</span><span class="">=</span><span class="">"1"</span><span class=""> </span><span class="">IFD</span><span class="">=</span><span class="">"1"</span><span class=""> </span><span class="">PlaneCount</span><span class="">=</span><span class="">"1"</span><span class="">></span><span class="">
</span><span class=""><UUID</span><span class=""> </span><span class="">FileName</span><span class="">=</span><span class="">"xyz-converted.ome.tiff"</span><span class="">></span><span class="">urn:uuid:5cb6938c-5503-11e6-ade4-a45e60e933fb</span><span class=""></UUID></span><span class="">
</span><span class=""></TiffData></span><span class="">
</span><span class=""><TiffData</span><span class=""> </span><span class="">FirstZ</span><span class="">=</span><span class="">"2"</span><span class=""> </span><span class="">IFD</span><span class="">=</span><span class="">"2"</span><span class=""> </span><span class="">PlaneCount</span><span class="">=</span><span class="">"1"</span><span class="">></span><span class="">
</span><span class=""><UUID</span><span class=""> </span><span class="">FileName</span><span class="">=</span><span class="">"xyz-converted.ome.tiff"</span><span class="">></span><span class="">urn:uuid:5cb6938c-5503-11e6-ade4-a45e60e933fb</span><span class=""></UUID></span><span class="">
</span><span class=""></TiffData></span><span class="">
</span><span class=""><TiffData</span><span class=""> </span><span class="">FirstZ</span><span class="">=</span><span class="">"3"</span><span class=""> </span><span class="">IFD</span><span class="">=</span><span class="">"3"</span><span class=""> </span><span class="">PlaneCount</span><span class="">=</span><span class="">"1"</span><span class="">></span><span class="">
</span><span class=""><UUID</span><span class=""> </span><span class="">FileName</span><span class="">=</span><span class="">"xyz-converted.ome.tiff"</span><span class="">></span><span class="">urn:uuid:5cb6938c-5503-11e6-ade4-a45e60e933fb</span><span class=""></UUID></span><span class="">
</span><span class=""></TiffData></span><span class="">
</span><span class=""></Pixels></span><span class="">
</span><span class=""></Image></span><span class=""></span><span class=""></OME></span></pre>
</div>
</div>
<br class="">
_______________________________________________<br class="">
ome-devel mailing list<br class="">
<a href="mailto:ome-devel@lists.openmicroscopy.org.uk" class="">ome-devel@lists.openmicroscopy.org.uk</a><br class="">
<a href="http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel" rel="noreferrer" target="_blank" class="">http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel</a><br class="">
<br class="">
</blockquote>
</div>
<br class="">
</div>
</div>
_______________________________________________<br class="">
ome-devel mailing list<br class="">
<a href="mailto:ome-devel@lists.openmicroscopy.org.uk" class="">ome-devel@lists.openmicroscopy.org.uk</a><br class="">
<a href="http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel">http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel</a><br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
</div>
<br>
<span style="font-size:10pt;">The University of Dundee is a registered Scottish Charity, No: SC015096</span></div>
</div>
</blockquote>
</span>
</body>
</html>