<div dir="ltr">Hi Roger,<div><br></div><div>thanks a lot for this detailed analysis, I highly appreciate this!</div><div><br></div><div>Regards,</div><div>Manuel</div><div><br></div><div><div class="gmail_extra"><div class="gmail_quote"><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 01/09/17 15:14, Roger Leigh wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 01/09/17 10:00, Manuel Stritt wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Dear all,<br>
<br>
I'm trying to use the in-memory reading method as documented here:<br>
<br>
<a href="https://docs.openmicroscopy.org/bio-formats/5.6.0/developers/in-memory.html" rel="noreferrer" target="_blank">https://docs.openmicroscopy.or<wbr>g/bio-formats/5.6.0/developers<wbr>/in-memory.html</a><br>
<br>
<br>
in combination with a NDPI reader + BufferedImageReader:<br>
</blockquote>
<br>
Making this into a compilable example, the stack trace is this:<br>
</blockquote>
[...]<br>
<br>
Dear Manuel,<br>
<br>
I've written another two small examples as modifications to test exactly<br>
where the failure lies.<br>
<br>
testfile replaces the in-memory I/O with regular file I/O. This works<br>
correctly, with BufferedImageReader.<br>
<br>
testplain retains the in-memory I/O but replaces BufferedImageReader<br>
with regular openBytes. This fails:<br>
<br>
Reading file into memory from disk...<br>
3544235 bytes read.<br>
size reader: 3968 x4864<br>
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space<br>
at java.nio.HeapByteBuffer.<init><wbr>(HeapByteBuffer.java:57)<br>
at java.nio.ByteBuffer.allocate(B<wbr>yteBuffer.java:335)<br>
at <a href="http://loci.common.ByteArrayHandle.se">loci.common.ByteArrayHandle.se</a><wbr>tLength(ByteArrayHandle.java:<wbr>111)<br>
at <a href="http://loci.common.ByteArrayHandle.se">loci.common.ByteArrayHandle.se</a><wbr>ek(ByteArrayHandle.java:180)<br>
at<br>
loci.common.RandomAccessInputS<wbr>tream.seek(RandomAccessInputSt<wbr>ream.java:174)<br>
at<br>
loci.formats.services.JPEGTurb<wbr>oServiceImpl.getTile(JPEGTurbo<wbr>ServiceImpl.java:303)<br>
at<br>
loci.formats.services.JPEGTurb<wbr>oServiceImpl.getTile(JPEGTurbo<wbr>ServiceImpl.java:235)<br>
at loci.formats.in.NDPIReader.ope<wbr>nBytes(NDPIReader.java:191)<br>
at loci.formats.FormatReader.open<wbr>Bytes(FormatReader.java:886)<br>
at testplain.main(testplain.java:<wbr>43)<br>
<br>
It's clear that the NDPI reader is behaving differently with the in<br>
memory stream vs a regular file stream.<br>
<br>
This has been recorded here:<br>
<a href="https://trello.com/c/C4v0GnWv/185-ndpi-in-memory-reading" rel="noreferrer" target="_blank">https://trello.com/c/C4v0GnWv/<wbr>185-ndpi-in-memory-reading</a><br>
<br>
<br>
Regards,<br>
Roger<br>
<br>
--<br>
Dr Roger Leigh -- Open Microscopy Environment<br>
Wellcome Trust Centre for Gene Regulation and Expression,<br>
College of Life Sciences, University of Dundee, Dow Street,<br>
Dundee DD1 5EH Scotland UK Tel: (01382) 386364<br>
<br>
The University of Dundee is a registered Scottish Charity, No: SC015096<br>
<br>______________________________<wbr>_________________<br>
ome-devel mailing list<br>
<a href="mailto:ome-devel@lists.openmicroscopy.org.uk">ome-devel@lists.<wbr>openmicroscopy.org.uk</a><br>
<a href="http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel" rel="noreferrer" target="_blank">http://lists.openmicroscopy.<wbr>org.uk/mailman/listinfo/ome-<wbr>devel</a><br>
<br></blockquote></div><br><br>
</div></div></div>
<br>
<div><br></div><div><div><font size="2">The information of this email and in any file transmitted with it is strictly confidential and may be legally privileged.</font></div><div><font size="2">It is intended solely for the addressee. If you are not the intended recipient, any copying, distribution or any other use of this email is prohibited and may be unlawful. In such case, you should please notify the sender immediately and destroy this email.</font></div><div><font size="2">The content of this email is not legally binding unless confirmed by letter.</font></div><div><font size="2">Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorized to state them to be the views of the sender's company.</font></div></div>