<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Hi Ian and Romain,</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">having briefly discussed the state of the things internally, here is a summary:</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">- there is nothing in  FormatWriter that handles file existing i.e. the writer will write to the</p>
<p style="margin-top:0;margin-bottom:0">  specified output stream</p>
<p style="margin-top:0;margin-bottom:0">- handling file deletion prior to writing is the responsiblity of the caller of the low-level</p>
<p style="margin-top:0;margin-bottom:0">  writer API</p>
<p style="margin-top:0;margin-bottom:0">- the `bfconvert` command-line utility contains some logic to detect the output file</p>
<p style="margin-top:0;margin-bottom:0">  existence and overwrite it either via an interactive opt-in or via the `-overwrite` option<br>
</p>
<p style="margin-top:0;margin-bottom:0">- the `bfsave.m` MATLAB utility does not contain any such logic at the moment. Until</p>
<p style="margin-top:0;margin-bottom:0">  Bio-Formats 5.9.0 it is the responsibility of the bfsave caller to handle file existence.</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Implementing some overwriting logic at the MATLAB level probably controlled by a</p>
<p style="margin-top:0;margin-bottom:0">key/value option would probably be a reasonable choice if this helped addressing the</p>
<p style="margin-top:0;margin-bottom:0">issues you and Romain faced. In this case, feel free to suggest your changes as a</p>
<p style="margin-top:0;margin-bottom:0">Pull Request against the Bio-Formats source code repository.<br>
</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Best,</p>
<p style="margin-top:0;margin-bottom:0">Sebastien<br>
</p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> ome-devel <ome-devel-bounces@lists.openmicroscopy.org.uk> on behalf of Munro, Ian <i.munro@imperial.ac.uk><br>
<b>Sent:</b> Monday, July 30, 2018 8:48:04 PM<br>
<b>To:</b> OME External Developer List<br>
<b>Subject:</b> Re: [ome-devel] OME.tiff with FLIM time gates that are not equally spaced in time</font>
<div> </div>
</div>
<meta content="text/html; charset=utf-8">
<div class="" style="word-wrap:break-word">
<div class="">Hi All</div>
<div class=""><br class="">
</div>
<div class="">Since sending the mail below Romain has been in touch to say </div>
<div class="">“ <span class="" style="font-family:Calibri,sans-serif; font-size:11pt">There’s just a small problem is that I think it doesn’t overwrite files properly when there’s already a file with the same name.</span></div>
<div class="" style="margin:0cm 0cm 0.0001pt; font-size:11pt; font-family:Calibri,sans-serif">
</div>
<div class="" style="margin:0cm 0cm 0.0001pt; font-size:11pt; font-family:Calibri,sans-serif">
I got some weird results doing that so I made sure they’re created each time."</div>
<div class=""><br class="">
</div>
<div class="">This suggests  that a the problem of overwriting existing files, addressed by the 2nd of the 2 code snippets below, remains an issue.</div>
<div class="">My feeling is that this should be addressed in either the bio-formats Matlab plugin or at an even lower level?</div>
<div class=""><br class="">
</div>
<div class="">What does the OME team think?</div>
<div class=""><br class="">
</div>
<div class="">Best Wishes</div>
<div class=""><br class="">
</div>
<div class="">Ian</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<br class="">
<div>
<blockquote type="cite" class="">
<div class="">On 17 Jul 2018, at 13:20, Munro, Ian <<a href="mailto:i.munro@imperial.ac.uk" class="">i.munro@imperial.ac.uk</a>> wrote:</div>
<br class="x_Apple-interchange-newline">
<div class="">
<div class="">
<div class="" style="word-wrap:break-word">
<div class="">Hi Romain</div>
<div class=""><br class="">
</div>
<div class="">Attached is a little Matlab script to create a FLIM OME-TIFF.</div>
<div class="">The first section just creates some dummy data.</div>
<div class="">The second part (after the tic at line 28) uses the bio-formats Matlab plugin to write this to a file.</div>
<div class="">Note that the variable “delays’ can contain any strings not just the regularly spaced ones used here.</div>
<div class=""><br class="">
</div>
<div class="">This is quite old code now so maybe someone from the core OME team could have a quick look and see if it’s still ok?</div>
<div class="">In particular this line:</div>
<div class=""><br class="">
</div>
<div class="">
<div class="" style="margin:0px; font-size:11px; line-height:normal; font-family:Menlo; color:rgb(39,42,216)">
<span class="" style="font-size:13px; line-height:normal">java.lang.System.setProperty(</span><span class="" style="">'javax.xml.transform.TransformerFactory'</span><span class="" style="font-size:13px; line-height:normal">,
</span><span class="" style="">'com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl’</span><span class="" style="font-size:13px; line-height:normal">);</span></div>
<div class="" style="margin:0px; font-size:11px; line-height:normal; font-family:Menlo; color:rgb(39,42,216)">
<span class="" style="font-size:13px; line-height:normal"><br class="">
</span></div>
<div class="" style="margin:0px; line-height:normal">may no longer be required.</div>
<div class="" style="margin:0px; line-height:normal">Also we used to have problems when overwriting existing files. If this has since been addressed,</div>
<div class="" style="margin:0px; line-height:normal">then this section:</div>
<div class="" style="margin:0px; line-height:normal; font-family:Menlo"><br class="">
</div>
<div class="" style="margin:0px; line-height:normal">
<div class="" style="font-family:Menlo; margin:0px; line-height:normal"><span class="" style="font-size:11px; line-height:normal; color:rgb(187,44,162)">if</span><span class="" style=""> exist(outputPath,
</span><span class="" style="font-size:11px; line-height:normal; color:rgb(39,42,216)">'file'</span><span class="" style="">) ==
</span><span class="" style="font-size:11px; line-height:normal; color:rgb(39,42,216)">2</span></div>
<div class="" style="font-family:Menlo; margin:0px; line-height:normal"><span class="" style="">    delete(outputPath);</span></div>
<div class="" style="font-family:Menlo; margin:0px; line-height:normal"><span class="" style="">end</span></div>
<div class="" style="font-family:Menlo; margin:0px; line-height:normal"><span class="" style=""><br class="">
</span></div>
<div class="" style="margin:0px; line-height:normal"><span class="" style="">May no longer be required.</span></div>
<div class="" style="margin:0px; line-height:normal"><span class="" style="">Hope that helps.</span></div>
<div class="" style="margin:0px; line-height:normal"><span class="" style=""><br class="">
</span></div>
<div class="" style="margin:0px; line-height:normal"><span class="" style="">Best wishes.</span></div>
<div class="" style="margin:0px; line-height:normal"><span class="" style=""><br class="">
</span></div>
<div class="" style="margin:0px; line-height:normal"><span class="" style="">Ian</span></div>
<div class="" style="margin:0px; line-height:normal"><span class="" style=""><br class="">
</span></div>
<div class="" style="margin:0px; line-height:normal"><span class="" style=""></span></div>
</div>
</div>
</div>
<div class="" style="word-wrap:break-word">
<div class="">
<div class="" style="margin:0px; line-height:normal">
<div class="" style="margin:0px; line-height:normal"><span class="" style=""></span></div>
</div>
<div class="" style="margin:0px; line-height:normal; font-family:Menlo"><br class="">
</div>
</div>
<div class=""><br class="">
</div>
<div class="">
<blockquote type="cite" class="">
<div class="">
<div class="" style="word-wrap:break-word">
<div class="">
<div class="">
<div class="">
<blockquote type="cite" class="">
<div class="">
<div class="x_x_WordSection1" style="font-family:Helvetica; font-size:13px; font-style:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px">
</div>
</div>
</blockquote>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</div>
<span id="x_cid:94E12C7E6EFFAB47952C2640FD7C0FCC@eurprd06.prod.outlook.com"><save_as_OMEtiff_Synthetic_Gated.m></span></div>
</blockquote>
</div>
<br class="">
</div>
<br>
<span style="font-size:10pt;">The University of Dundee is a registered Scottish Charity, No: SC015096</span>
</body>
</html>