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

Munro, Ian i.munro at imperial.ac.uk
Thu Oct 30 15:24:46 GMT 2014


Hi again

I realise the discussion has moved on now but just for everyone’s information.
I’ve been writing synthetic test FLIM data .into ome-tiffs i.e. with the ModuloAlongT annotation set.

I have been doing this from Matlab using the bfsave routine in the bfmatlab package & then repeating with
a version of the same code modified to use the ifd as discussed in this thread.(clearing the ifd in the loop)

The good news is that both files now  return the same data when read with bfopen.
They also pass both showinf & xmlvalid , import into an OMERO server (via insight ) and can then be read by FLIMfit
from the server.


On the performance side:
Adding the ifd code reduces the file size very  slightly from 7401611 to 7344379.
Speed is harder to quantify as the exact time seems to vary but the ifd code does seem to be noticeably faster.

All of this is on OSX with Matlab 2013b.
It would be good if this could be repeated on Windows.

Best

Ian




On 30 Oct 2014, at 03:25, Yellen, Gary <gary_yellen at hms.harvard.edu<mailto:gary_yellen at hms.harvard.edu>> wrote:

Hi All –
I took care of my <Plane> metadata problem and now my Bio-Formats/MATLAB hybrid is read fine by OMERO.
And the writing speed is way faster – about 18x - than the all Bio-Formats version (which still fails OMERO import on some sort of StatsInfo handling error).
-        gary

From: ome-devel [mailto:ome-devel-bounces at lists.openmicroscopy.org.uk] On Behalf Of Yellen, Gary
Sent: Wednesday, October 29, 2014 6:12 PM
To: Besson, Sebastien (forwarding)
Cc: OME-devel OME
Subject: Re: [ome-devel] OME-Tiff writing using LOCI calls from MATLAB, and ModuloAlongT annotation

Hi Sebastien,
I tried this – the file is readable in ImageJ but not in OMERO.
It gives a different error (below), and the writing time is now 30 seconds.
Best,
Gary

ame: import-request-failure
Parameters: {message=omero.ValidationException
    serverStackTrace = "ome.conditions.ValidationException: could not insert: [ome.model.stats.StatsInfo]; SQL [insert into statsinfo (creation_id, external_id, group_id, owner_id, permissions, update_id, globalMax, globalMin, version, id) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]; nested exception is org.hibernate.exception.DataException: could not insert: [ome.model.stats.StatsInfo]
                              at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:642) …

From: Sebastien Besson [mailto:s.besson at dundee.ac.uk]
Sent: Wednesday, October 29, 2014 5:28 PM
To: Yellen, Gary
Cc: Munro Ian; OME-devel OME
Subject: Re: [ome-devel] OME-Tiff writing using LOCI calls from MATLAB, and ModuloAlongT annotation

Hi Gary,

after a bit of debugging, the error should be solved by reinitializing the IFD state before
each call to TiffWriter.saveBytes(). This should be solved by either creating a new
IFD in each iteration of the loop or resetting its state with for instance:

     ifd.clear();
     ifd.putIFDValue(ifd.ROWS_PER_STRIP, szY);

Adding this two lines  was enough to remove the Error thrown by running showinf on the
generated OME-TIFF files while preserving the size. I would expect this will also solve the
import into OMERO.

Could you try and let us know?
Sebastien


On 29 Oct 2014, at 20:57, Yellen, Gary <gary_yellen at hms.harvard.edu<mailto:gary_yellen at hms.harvard.edu>> wrote:

I finally got to try uploading my files to an OMERO server, and I see the same problem as Ian. The metadata import ok, but the images are no good and the Import Log is full of “Error untangling IFDs; the OME-TIFF file may be malformed” messages.

OMERO can read the slow (70 sec to write) and oversized (5 MB instead of 1.6) file written with Bio-Formats just fine.

Fiji can read the hybrid file (Bio-Formats for metadata, MATLAB for Tiff writing) just fine, but OMERO has a number of problems with it – the nominally compliant use of a simplified <TiffData IFD=”0” PlaneCount=”90”> is not handled by OMERO, which seems to insist on have TheC etc. specified for every single plane.

Gary


From: ome-devel [mailto:ome-devel-bounces at lists.openmicroscopy.org.uk] On Behalf Of Munro, Ian
Sent: Wednesday, October 29, 2014 10:26 AM
To: OME OME-devel
Subject: Re: [ome-devel] OME-Tiff writing using LOCI calls from MATLAB, and ModuloAlongT annotation

Hi All

I’m just in the process of checking this to ensure that the data that is read  back is the same both with and without this modification.
If I run the command line 'showinf tool 'on the smaller files produced with the suggested ifd mod then I get the following in the output:

Reading pixel data (0-2)
Reading IFDs
Populating metadata
Error untangling IFDs; the OME-TIFF file may be malformed.
Error untangling IFDs; the OME-TIFF file may be malformed.
Read 3/3 planes (100%)
[done]


Is anyone else seeing this. I may have implemented the ifd mod incorrectly?

Regards

Ian

_______________________________________________
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/20141030/e86a65c4/attachment-0001.html>


More information about the ome-devel mailing list