<p dir="ltr">Hi Christian,</p>
<p dir="ltr">Nice detective work. Would you care to file a pull request with the fix?</p>
<p dir="ltr">Regards,<br>
Curtis</p>
<div class="gmail_quote">On Dec 5, 2014 8:41 AM, "Christian Carsten Sachs" <<a href="mailto:c.sachs@fz-juelich.de">c.sachs@fz-juelich.de</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
as I'm no bioformats developer, I cannot push a fix for it, but I've<br>
debugged it and I might provide a hint towards a solution to the problem:<br>
<br>
The metadata parser of the ND2 reader plugin chokes at some string value<br>
in the<br>
SLxPictureMetadata.<u></u>sPicturePlanes.sSampleSetting.<u></u>a0.pCameraSetting dict<br>
of the ImageMetadataSeqLV|0 block.<br>
(And, not finding the true end of a string, starts to read the wrong<br>
data, tries to interpret it, and tries to jump to some location at<br>
around 140 TB (from the beginning of the file ;)), where it gets stuck<br>
infinitely.)<br>
<br>
I do not see why such a complex implementation for reading a string was<br>
choosen (RandomAccessInputStream.<u></u>findString). A quick replacement of the<br>
<br>
case (8): // String<br>
...<br>
break;<br>
<br>
block (within with NativeND2Reader.iterateIn method) e.g.<br>
<br>
char c = 0;<br>
StringBuilder sb = new StringBuilder();<br>
while((c = in.readChar()) != 0)<br>
sb.append(c);<br>
value = sb.toString();<br>
<br>
Makes the file readily openable (with apparent metadata O.K.).<br>
It should be remarked that strings within nd2 files are just wide<br>
strings, and do not need complex parsing.<br>
<br>
Long technical text short:<br>
<br>
The file/modus operandi is ok, it looks like a bug in bioformats.<br>
<br>
Best Regards,<br>
Christian Sachs<br>
<br>
On 12/05/2014 01:57 PM, Peter Saxon wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi all,<br>
<br>
A recent experiment has yielded a set of ND2 files which bioformats seem<br>
to be struggling with. They open fine in Nikons own software ('NIS<br>
viewer') which leads me to believe the files are valid and intact.<br>
Samples provided below<br>
<br>
<a href="http://qa.openmicroscopy.org.uk/qa/feedback/10380/?token=21549ddad4b975eb1917b005f9299de4" target="_blank">http://qa.openmicroscopy.org.<u></u>uk/qa/feedback/10380/?token=<u></u>21549ddad4b975eb1917b005f9299d<u></u>e4</a><br>
or<br>
<a href="https://www.dropbox.com/s/6bok66l3y5xpn7w/271120.nd2?dl=0" target="_blank">https://www.dropbox.com/s/<u></u>6bok66l3y5xpn7w/271120.nd2?dl=<u></u>0</a><br>
<br>
The image should be a single frame, 4 x 12bit colour channels, 1392x1040<br>
pixels. I've tried opening it with both the matlab tools (Bioformats<br>
5.0.6) and icy (also with 5.0.6), using Windows, Java 1.7.0_21. It<br>
causes both to hang, last message displayed is<br>
Parsing block 'ImageCalibra' 0%<br>
<br>
Am I doing something stupid, and/or does anyone know what is causing<br>
these errors?<br>
<br>
Best wishes,<br>
<br>
Peter Saxon<br>
</blockquote>
<br>
<br>
------------------------------<u></u>------------------------------<u></u>------------------------------<u></u>------<br>
------------------------------<u></u>------------------------------<u></u>------------------------------<u></u>------<br>
Forschungszentrum Juelich GmbH<br>
52425 Juelich<br>
Sitz der Gesellschaft: Juelich<br>
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498<br>
Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher<br>
Geschaeftsfuehrung: Prof. Dr.-Ing. Wolfgang Marquardt (Vorsitzender),<br>
Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,<br>
Prof. Dr. Sebastian M. Schmidt<br>
------------------------------<u></u>------------------------------<u></u>------------------------------<u></u>------<br>
------------------------------<u></u>------------------------------<u></u>------------------------------<u></u>------<br>
<br>
______________________________<u></u>_________________<br>
ome-users mailing list<br>
<a href="mailto:ome-users@lists.openmicroscopy.org.uk" target="_blank">ome-users@lists.<u></u>openmicroscopy.org.uk</a><br>
<a href="http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users" target="_blank">http://lists.openmicroscopy.<u></u>org.uk/mailman/listinfo/ome-<u></u>users</a><br>
</blockquote></div>