[ome-users] Bioformats opening ND2 error

Christian Carsten Sachs c.sachs at fz-juelich.de
Fri Dec 5 14:41:28 GMT 2014


Hello,

as I'm no bioformats developer, I cannot push a fix for it, but I've
debugged it and I might provide a hint towards a solution to the problem:

The metadata parser of the ND2 reader plugin chokes at some string value
in the
SLxPictureMetadata.sPicturePlanes.sSampleSetting.a0.pCameraSetting dict
of the ImageMetadataSeqLV|0 block.
(And, not finding the true end of a string, starts to read the wrong
data, tries to interpret it, and tries to jump to some location at
around 140 TB (from the beginning of the file ;)), where it gets stuck
infinitely.)

I do not see why such a complex implementation for reading a string was
choosen (RandomAccessInputStream.findString). A quick replacement of the

case (8): // String
...
break;

block (within with NativeND2Reader.iterateIn method) e.g.

char c = 0;
StringBuilder sb = new StringBuilder();
while((c = in.readChar()) != 0)
   sb.append(c);
value = sb.toString();

Makes the file readily openable (with apparent metadata O.K.).
It should be remarked that strings within nd2 files are just wide
strings, and do not need complex parsing.

Long technical text short:

The file/modus operandi is ok, it looks like a bug in bioformats.

Best Regards,
Christian Sachs

On 12/05/2014 01:57 PM, Peter Saxon wrote:
> Hi all,
>
> A recent experiment has yielded a set of ND2 files which bioformats seem
> to be struggling with. They open fine in Nikons own software ('NIS
> viewer') which leads me to believe the files are valid and intact.
> Samples provided below
>
> http://qa.openmicroscopy.org.uk/qa/feedback/10380/?token=21549ddad4b975eb1917b005f9299de4
> or
> https://www.dropbox.com/s/6bok66l3y5xpn7w/271120.nd2?dl=0
>
> The image should be a single frame, 4 x 12bit colour channels, 1392x1040
> pixels. I've tried opening it with both the matlab tools (Bioformats
> 5.0.6) and icy (also with 5.0.6), using Windows, Java 1.7.0_21. It
> causes both to hang, last message displayed is
> Parsing block 'ImageCalibra' 0%
>
> Am I doing something stupid, and/or does anyone know what is causing
> these errors?
>
> Best wishes,
>
> Peter Saxon


------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr.-Ing. Wolfgang Marquardt (Vorsitzender),
Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------




More information about the ome-users mailing list