[ome-devel] OME-Tiff writing using LOCI calls from MATLAB, and ModuloAlongT annotation

Yellen, Gary gary_yellen at hms.harvard.edu
Fri Oct 24 20:37:36 BST 2014


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.

I have two issues.

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?

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:

%% for the moduloAlongT annotation:
coreMetadata = loci.formats.CoreMetadata();
coreMetadata.moduloT.start = 0;
coreMetadata.moduloT.step = 0.05;
coreMetadata.moduloT.end = 12.75;
coreMetadata.moduloT.type = loci.formats.FormatTools.LIFETIME;
coreMetadata.moduloT.unit = 'ns';

... write the main part of the metadata to 'metadata', in the middle of which is ...
OMEXMLService.addModuloAlong(metadata, coreMetadata, series);

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:

java.lang.RuntimeException: org.xml.sax.SAXParseException: Element type "OME" must be followed by either attribute specifications, ">" or "/>".
Thanks for any advice anyone can provide on either of these subjects.

Gary

=================================

WELL-FORMED ANNOTATION during debug, retrieved using OMEXMLService.getOMEXML(metadata);

<StructuredAnnotations>
               <XMLAnnotation ID="Annotation:0" Namespace="openmicroscopy.org/omero/dimension/modulo">
               <Value>
               <Modulo namespace="http://www.openmicroscopy.org/Schemas/Additions/2011-09">
                              <ModuloAlongT End="12.75" Start="0.0" Step="0.05" Type="lifetime" TypeDescription="" Unit="ns"/>
               </Modulo>
               </Value>
               </XMLAnnotation>
</StructuredAnnotations>


STRANGE (recursive?) ANNOTATION retrieved from .ome.tif file:

<StructuredAnnotations>
<XMLAnnotation ID="Annotation:0" Namespace="openmicroscopy.org/omero/dimension/modulo">
<Value>
<OME xsi:schemaLocation="http://www.openmicroscopy.org/Schemas/OME/2013-06
http://www.openmicroscopy.org/Schemas/OME/2013-06/ome.xsd">

+ <Experiment Type="FluorescenceLifetime" ID="dFLIM_v2.1">  [[[[ this is collapsed for easy reading ]]]
+ <Image ID="Image:0">                                                                           [[[[ this is collapsed for easy reading ]]]
- <StructuredAnnotations>
<XMLAnnotation ID="Annotation:0" Namespace="openmicroscopy.org/omero/dimension/modulo">
<Value>
<Modulo namespace="http://www.openmicroscopy.org/Schemas/Additions/2011-09">
<ModuloAlongT Type="lifetime" Unit="ns" TypeDescription="" Step="0.05" Start="0.0" End="12.75"/>
</Modulo>
</Value>
</XMLAnnotation>
</StructuredAnnotations>
</OME>
</Value>
</XMLAnnotation>
</StructuredAnnotations>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openmicroscopy.org.uk/pipermail/ome-devel/attachments/20141024/1e34d241/attachment.html>


More information about the ome-devel mailing list