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

Munro, Ian i.munro at imperial.ac.uk
Mon Oct 27 13:01:40 GMT 2014


Hi Again Gary

Good to know that you’ve found a solution. However,  I find it puzzling that the files are different sizes.
We had a problem where bio-formats was writing multiple copies of the xml when called from Matlab.
The work-around was to add the following line:

java.lang.System.setProperty('javax.xml.transform.TransformerFactory', 'com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl’);

to the Matlab code as in the example that I sent.
Perhaps this might help.

Regards

Ian

On 27 Oct 2014, at 12:43, Yellen, Gary <gary_yellen at hms.harvard.edu<mailto:gary_yellen at hms.harvard.edu>> wrote:

I was able to solve both the OME-TIFF export speed problem and the ModuloAlongT problem by using a hybrid approach:  using the LOCI tools to create the OME-XML metadata, but then using the MATLAB Tiff() class for the actual OME-TIFF writing.  I tried this because of information on the forums that the MicroManager saving of OME-TIFFs was faster than the Bio-formats code.

I’ve enclosed the MATLAB code that I used for this hybrid approach, in case anyone is interested.  The first section is a little parochial (using our local data objects), but most of the code should be re-usable.   This code wrote a medium-sized set of data in 1.3 seconds, compared with 89 seconds for using only calls to LOCI for the writing; although both cases had BigTiff and LZW compression set, the file using the hybrid approach was also about ~3x smaller for some reason (1.7 GB vs 5.3 GB; the 1.7 GB is essentially the same size as the MATLAB .mat file version of the same data).  Both versions of the file are readable using the Bio-Formats importer in Fiji.

I have used simpler metadata notations for the TiffData entries; they just include the starting IFD number and the number of planes.

This also solved the problem with the ModuloAlongT SA metadata (which apparently became corrupted during or after the writer.saveBytes calls).

gary
<dF_saveAsOMETiff.m>_______________________________________________
ome-devel mailing list
ome-devel at lists.openmicroscopy.org.uk<mailto:ome-devel at lists.openmicroscopy.org.uk>
http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openmicroscopy.org.uk/pipermail/ome-devel/attachments/20141027/7d38841d/attachment-0001.html>


More information about the ome-devel mailing list