<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal>I’m exporting microscope (2p FLIM) data from MATLAB to OME-Tiff format, using LOCI Java calls from MATLAB (in emulation of the Bio-Formats exporters).  The data are not collected from any of the commercial TCSPC devices, so there is no ‘native’ file format other than MATLAB.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I have two issues.  <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>The first is speed:  export of 128x128 pixel uint16 planes is taking about 60 seconds per 512 planes (using LZW compression).  The native MATLAB saving speed for these same data (in matrix, not TIFF format) is 0.2 seconds.  I’d really like to export during acquisition, but this doesn’t seem practical with the available tools.  Is there an intermediate format that is readily converted to OME-TIFF, which I could write more quickly from MATLAB?  Or is there a way of making this more efficient, by writing the planes in a more consolidated way than calling writer.saveBytes for each image plane?<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>The second problem is generating a legal ModuloAlongT annotation (in hopes of trying the FLIMfit package).  I adapted some code that Melissa posted on a forum:<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";color:forestgreen'>%% for the moduloAlongT annotation:</span><span style='font-size:12.0pt;font-family:"Courier New"'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";color:black'>coreMetadata = loci.formats.CoreMetadata();</span><span style='font-size:12.0pt;font-family:"Courier New"'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";color:black'>coreMetadata.moduloT.start = 0;</span><span style='font-size:12.0pt;font-family:"Courier New"'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";color:black'>coreMetadata.moduloT.step = 0.05;</span><span style='font-size:12.0pt;font-family:"Courier New"'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";color:black'>coreMetadata.moduloT.end = 12.75;</span><span style='font-size:12.0pt;font-family:"Courier New"'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";color:black'>coreMetadata.moduloT.type = loci.formats.FormatTools.LIFETIME;</span><span style='font-size:12.0pt;font-family:"Courier New"'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";color:black'>coreMetadata.moduloT.unit = </span><span style='font-size:10.0pt;font-family:"Courier New";color:#A020F0'>'ns'</span><span style='font-size:10.0pt;font-family:"Courier New";color:black'>;</span><span style='font-size:12.0pt;font-family:"Courier New"'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:12.0pt;font-family:"Courier New"'><o:p> </o:p></span></p><p class=MsoNormal>… write the main part of the metadata to ‘metadata’, in the middle of which is …<o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";color:black'>OMEXMLService.addModuloAlong(metadata, coreMetadata, series);</span><span style='font-size:12.0pt;font-family:"Courier New"'><o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>If I stop and debug the code here, I get an apparently well-formed annotation (see below), but if I proceed to write data to the file and save it, the saved file’s metadata for the annotation looks strange (see further below).  Inside the annotation Value, it contains the full original metadata definition of the Experiment Type and Image (but no planes), plus an additional Structured Annotation object inside.  ImageJ2 can read the data by drag and drop, but if I use the verbose Bio-Formats Importer, it gives an error about the metadata:  <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span style='font-size:9.0pt'>java.lang.RuntimeException: org.xml.sax.SAXParseException: Element type "OME" must be followed by either attribute specifications, ">" or "/>".<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt'><o:p></o:p></span></p><p class=MsoNormal>Thanks for any advice anyone can provide on either of these subjects.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Gary<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>=================================<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>WELL-FORMED ANNOTATION during debug, retrieved using OMEXMLService.getOMEXML(metadata);<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><StructuredAnnotations><o:p></o:p></p><p class=MsoNormal>               <XMLAnnotation ID="Annotation:0" Namespace="openmicroscopy.org/omero/dimension/modulo"><o:p></o:p></p><p class=MsoNormal>               <Value><o:p></o:p></p><p class=MsoNormal>               <Modulo namespace="http://www.openmicroscopy.org/Schemas/Additions/2011-09"><o:p></o:p></p><p class=MsoNormal>                              <ModuloAlongT End="12.75" Start="0.0" Step="0.05" Type="lifetime" TypeDescription="" Unit="ns"/><o:p></o:p></p><p class=MsoNormal>               </Modulo><o:p></o:p></p><p class=MsoNormal>               </Value><o:p></o:p></p><p class=MsoNormal>               </XMLAnnotation><o:p></o:p></p><p class=MsoNormal></StructuredAnnotations><o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>STRANGE (recursive?) ANNOTATION retrieved from .ome.tif file:<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><StructuredAnnotations><o:p></o:p></p><p class=MsoNormal style='text-indent:.5in'><XMLAnnotation ID="Annotation:0" Namespace="openmicroscopy.org/omero/dimension/modulo"><o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'><Value><o:p></o:p></p><p class=MsoNormal style='margin-left:.5in;text-indent:.5in'><OME xsi:schemaLocation="http://www.openmicroscopy.org/Schemas/OME/2013-06<o:p></o:p></p><p class=MsoNormal style='margin-left:1.5in;text-indent:.5in'>http://www.openmicroscopy.org/Schemas/OME/2013-06/ome.xsd"><o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal style='margin-left:.5in;text-indent:.5in'>+ <Experiment Type="FluorescenceLifetime" ID="dFLIM_v2.1">  [[[[ this is collapsed for easy reading ]]]<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in;text-indent:.5in'>+ <Image ID="Image:0">                                                                           [[[[ this is collapsed for easy reading ]]]<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in;text-indent:.5in'>- <StructuredAnnotations><o:p></o:p></p><p class=MsoNormal style='margin-left:1.0in;text-indent:.5in'><XMLAnnotation ID="Annotation:0" Namespace="openmicroscopy.org/omero/dimension/modulo"><o:p></o:p></p><p class=MsoNormal style='margin-left:1.0in;text-indent:.5in'><Value><o:p></o:p></p><p class=MsoNormal style='margin-left:1.5in'><Modulo namespace="http://www.openmicroscopy.org/Schemas/Additions/2011-09"><o:p></o:p></p><p class=MsoNormal style='margin-left:1.5in;text-indent:.5in'><ModuloAlongT Type="lifetime" Unit="ns" TypeDescription="" Step="0.05" Start="0.0" End="12.75"/><o:p></o:p></p><p class=MsoNormal style='margin-left:1.0in;text-indent:.5in'></Modulo><o:p></o:p></p><p class=MsoNormal style='margin-left:1.0in;text-indent:.5in'></Value><o:p></o:p></p><p class=MsoNormal style='margin-left:1.0in;text-indent:.5in'></XMLAnnotation><o:p></o:p></p><p class=MsoNormal style='margin-left:.5in;text-indent:.5in'></StructuredAnnotations><o:p></o:p></p><p class=MsoNormal style='margin-left:.5in;text-indent:.5in'></OME><o:p></o:p></p><p class=MsoNormal style='text-indent:.5in'></Value><o:p></o:p></p><p class=MsoNormal style='text-indent:.5in'></XMLAnnotation><o:p></o:p></p><p class=MsoNormal></StructuredAnnotations><o:p></o:p></p></div></body></html>