<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Qi,<div class=""><br class=""></div><div class="">to convert the thumbnail array returned from openThumBytes, you should be able to use</div><div class="">the same steps as in bfGetPlane to convert the int8 array into an array of the correct type.</div><div class="">For the final reshaping step, you can read the thumbnail dimensions from the reader with:</div><div class=""><br class=""></div><div class="">I = reshape(I, [reader.getThumbSizeX() reader.getThumbSizeY()])’;</div><div class=""><br class=""></div><div class="">Best,</div><div class="">Sebastien</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 8 Apr 2015, at 19:08, Qi Gong <<a href="mailto:qigong@gwmail.gwu.edu" class="">qigong@gwmail.gwu.edu</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html; charset=utf-8" class=""><div dir="ltr" class="">Hello Sebastien,<div class=""><br class=""></div><div class="">now I just use the command </div><div class="">"reader = bfGetReader('C:\000_whole_slides\tissue40x-8B.ndpi'); </div><div class="">plane = reader.openThumbBytes(1);" <br class=""></div><div class="">to get the thumbnail. But the output is a vector. 12288 x1. in the bfGetPlane function, you use the reshape function to transfer it to 2-D image. But in that function we know the size of image. And now I don't know the size (width and height). Do you know how to transfer it to image? Thank you.</div><div class=""><br class=""></div><div class="">Sincerely,</div><div class="">Qi</div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Wed, Apr 8, 2015 at 5:45 AM, Sebastien Besson (Staff) <span dir="ltr" class=""><<a href="mailto:s.besson@dundee.ac.uk" target="_blank" class="">s.besson@dundee.ac.uk</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<div style="word-wrap:break-word" class="">
Hi Qi,
<div class=""><br class="">
</div>
<div class="">all understood and this certainly makes sense.</div>
<div class="">The Bio-Formats API has a method to return bytes corresponding to a thumbnail instead of a full plane, see</div>
<div class=""><a href="http://downloads.openmicroscopy.org/bio-formats/5.1.0/api/loci/formats/FormatReader.html#openThumbBytes(int)" target="_blank" class="">http://downloads.openmicroscopy.org/bio-formats/5.1.0/api/loci/formats/FormatReader.html#openThumbBytes(int)</a></div>
<div class=""><br class="">
</div>
<div class="">This method can be used in the same way that bfGetPlane() makes use openBytes() to retrieve a single</div>
<div class="">plane. Here, the final array would have to be resized by the thumbnail size, typically 128 x 128, instead</div>
<div class="">of the full plane dimensions</div>
<div class=""><br class="">
</div>
<div class="">Note however that the way to get thumbnails for almost all of the readers is to read the pixels data</div>
<div class="">and scale it internally. For very large WSI, calling this method will likely be restricted to the same memory</div>
<div class="">limitations as reading full planes.</div>
<div class=""><br class="">
</div>
<div class="">Best regards,</div>
<div class="">Sebastien</div><div class=""><div class="h5">
<div class=""><br class="">
<div class="">
<blockquote type="cite" class="">
<div class="">On 7 Apr 2015, at 15:53, Qi Gong <<a href="mailto:qigong@gwmail.gwu.edu" target="_blank" class="">qigong@gwmail.gwu.edu</a>> wrote:</div>
<br class="">
<div class="">
<div dir="ltr" class="">
<div class="">
<div class="">
<div class="">Hello Sebastien,<br class="">
<br class="">
</div>
Thank you for your email. I am sorry, my description was not clear. It is not "1-by-1". Now I could extract some sub_area of image, but the extracted image is
<b class="">1-to-1 </b>pixel with WSI. What we want is a thumbnail. In other word, we want to display the whole WSI or a large part of WSI in a small size. Thank you.<br class="">
<br class="">
</div>
Sincerely,<br class="">
</div>
Qi<br class="">
</div>
<div class="gmail_extra"><br class="">
<div class="gmail_quote">On Mon, Apr 6, 2015 at 6:37 PM, Sebastien Besson (Staff)
<span dir="ltr" class=""><<a href="mailto:s.besson@dundee.ac.uk" target="_blank" class="">s.besson@dundee.ac.uk</a>></span> wrote:<br class="">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word" class="">Hi Qi,
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">Do you need a thumbnail</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">
<div class="">
<blockquote type="cite" class="">
<div class="">On 6 Apr 2015, at 22:11, Qi Gong <<a href="mailto:qigong@gwmail.gwu.edu" target="_blank" class="">qigong@gwmail.gwu.edu</a>> wrote:</div>
<br class="">
<div class="">
<div dir="ltr" class="">Hello Sebastien,</div>
</div>
</blockquote>
<div class=""><br class="">
</div>
Hi Qi,<span class=""><br class="">
<br class="">
<blockquote type="cite" class="">
<div dir="ltr" class="">
<div class="">Thank you your your reply. I think it is working.</div>
</div>
</blockquote>
<div class=""><br class="">
</div>
</span>Good to hear.</div>
<div class=""><span class=""><br class="">
<blockquote type="cite" class="">
<div class="">
<div dir="ltr" class="">
<div class="">Now, I want to use BIO to get a WSI ( whole slide image) image. But as the WSI is to large more than 2 GB. I can't use bfopen to open it. Melissa told me a could use bfGetPlane to get the image.
</div>
</div>
</div>
</blockquote>
<div class=""><br class="">
</div>
</span>
<div class="">Indeed, if the image is large enough, reading all the planes into memory like boffin does simply does not</div>
<div class="">scale and you have to read selectively.</div>
<span class="">
<div class=""><br class="">
</div>
<blockquote type="cite" class="">
<div class="">
<div dir="ltr" class="">
<div class="">But it extract image is 1-by-1  pixel. </div>
</div>
</div>
</blockquote>
<div class=""><br class="">
</div>
</span>
<div class="">If you have a WSI, it is surprising that the command pasted in a previous thread would return a single pixel</div>
<div class="">Can you give us the full dimensions of your image as given by</div>
<div class="">>> r =  bfGetReader(‘\path\to\file);</div>
<div class="">>> r.getSizeX()</div>
<div class="">>> r.getSizeY()</div>
<div class="">
<div class="">>> r.getSizeZ()</div>
<div class="">>> r.getSizeC()</div>
</div>
<div class="">>> r.getSizeT()</div>
<div class="">Also, can you paste the command you use to retrieve this 1-by-1 pixel array?</div>
<span class="">
<div class=""><br class="">
</div>
<div class="">
<blockquote type="cite" class="">
<div dir="ltr" class="">
<div class="">But some time, we need and thumb image of whole image. Do you know how to extract a 1-by-N image? That means, Extract the whole image (with size 10000x10000), but only display and save in 100x100 size. Thank you.</div>
</div>
</blockquote>
</div>
<div class=""><br class="">
</div>
</span>
<div class="">Just to be sure, do you want to read a thumbnail for the entire image? Or are you looking for a way to</div>
<div class="">retrieve a tile i.e. a XY subset of the full image?</div>
<div class=""><br class="">
</div>
<blockquote type="cite" class="">
<div class="">
<div dir="ltr" class="">
<div class="">Sincerely,</div>
<div class="">Qi </div>
</div>
</div>
</blockquote>
<div class=""><br class="">
</div>
Best regards,</div>
<div class="">Sebastien</div>
<div class="">
<div class="">
<div class=""><br class="">
<blockquote type="cite" class="">
<div class="">
<div class="gmail_extra"><br class="">
<div class="gmail_quote">On Mon, Apr 6, 2015 at 3:26 PM, Sebastien Besson <span dir="ltr" class="">
<<a href="mailto:seb.besson@gmail.com" target="_blank" class="">seb.besson@gmail.com</a>></span> wrote:<br class="">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word" class="">Hi Qi,
<div class=""><br class="">
</div>
<div class="">the content of your java.opts looks valid (although you might want to increase the</div>
<div class="">memory settings later). According to the MATLAB documentation, e.g.</div>
<div class=""><a href="http://uk.mathworks.com/help/matlab/matlab_env/java-opts-file.html?refresh=true" target="_blank" class="">http://uk.mathworks.com/help/matlab/matlab_env/java-opts-file.html?refresh=true</a></div>
<div class="">you need to put this file either in the MATLAB startup folder or under the `bin\arch` folder</div>
<div class="">under the MATLAB root path. Locally, I have a `java.opts` under `~/Documents/MATLAB` for</div>
<div class="">instance.</div>
<div class=""><br class="">
</div>
<div class="">Can you try either of these options and check the output of the following command</div>
<div class="">>> java.lang.Runtime.getRuntime().maxMemory</div>
<div class="">reflects what it in your java.opts</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">Sebastien</div>
<div class=""><br class="">
<div class="">
<blockquote type="cite" class="">
<div class="">
<div class="">
<div class="">On 6 Apr 2015, at 19:53, Qi Gong <<a href="mailto:qigong@gwmail.gwu.edu" target="_blank" class="">qigong@gwmail.gwu.edu</a>> wrote:</div>
<br class="">
</div>
</div>
<div class="">
<div class="">
<div class="">
<div dir="ltr" class="">
<div class="gmail_quote">
<div dir="ltr" class="">Hello everyone,
<div class=""><br class="">
</div>
<div class="">Sorry for bother. I try to use <span style="font-size:12.8000001907349px" class=""> </span><span style="font-size:12.8000001907349px" class="">Matlab version of Bio-Formats. But I face the memory problem, I know, we could add a time named java.opts
 to solve the problem.  </span></div>
<div class=""><br class="">
</div>
<div class="">I put the file the java.opts into matlab folder as attachment. But matlab still shows the warning. Could anyone help me check whether my java.opts is correct or not? Thank you.</div>
<div class=""><br class="">
</div>
<div class="">Sincerely,</div>
<div class="">Qi</div>
</div>
<div class="gmail_extra">
<div class=""><br class="">
<div class="gmail_quote"><br class="">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<span class=""><matlab folder.png></span><span class=""><memory warning.png></span><span class=""><java.opts></span>_______________________________________________<span class=""><br class="">
ome-users mailing list<br class="">
<a href="mailto:ome-users@lists.openmicroscopy.org.uk" target="_blank" class="">ome-users@lists.openmicroscopy.org.uk</a><br class="">
<a href="http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users" target="_blank" class="">http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users</a><br class="">
</span></div>
</blockquote>
</div>
<br class="">
</div>
</div>
<br class="">
_______________________________________________<br class="">
ome-users mailing list<br class="">
<a href="mailto:ome-users@lists.openmicroscopy.org.uk" target="_blank" class="">ome-users@lists.openmicroscopy.org.uk</a><br class="">
<a href="http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users" target="_blank" class="">http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users</a><br class="">
<br class="">
</blockquote>
</div>
<br class="">
<br clear="all" class="">
<div class=""><br class="">
</div>
-- <br class="">
<div class="">mobile phone: <a href="tel:2024060862" value="+12024060862" target="_blank" class="">
2024060862</a></div>
</div>
_______________________________________________<br class="">
ome-users mailing list<br class="">
<a href="mailto:ome-users@lists.openmicroscopy.org.uk" target="_blank" class="">ome-users@lists.openmicroscopy.org.uk</a><br class="">
<a href="http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users" target="_blank" class="">http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users</a><br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
</div>
</div>
<br class="">
<span style="font-size:10pt" class="">The University of Dundee is a registered Scottish Charity, No: SC015096</span>
</div>
<br class="">
_______________________________________________<br class="">
ome-users mailing list<br class="">
<a href="mailto:ome-users@lists.openmicroscopy.org.uk" target="_blank" class="">ome-users@lists.openmicroscopy.org.uk</a><br class="">
<a href="http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users" target="_blank" class="">http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users</a><br class="">
<br class="">
</blockquote>
</div>
<br class="">
<br clear="all" class="">
<br class="">
-- <br class="">
<div class="">mobile phone: <a href="tel:2024060862" value="+12024060862" target="_blank" class="">2024060862</a></div>
</div>
_______________________________________________<br class="">
ome-users mailing list<br class="">
<a href="mailto:ome-users@lists.openmicroscopy.org.uk" target="_blank" class="">ome-users@lists.openmicroscopy.org.uk</a><br class="">
<a href="http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users" target="_blank" class="">http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users</a><br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
<br class="">
<span style="font-size:10pt" class="">The University of Dundee is a registered Scottish Charity, No: SC015096</span>
</div></div></div>

<br class="">_______________________________________________<br class="">
ome-users mailing list<br class="">
<a href="mailto:ome-users@lists.openmicroscopy.org.uk" class="">ome-users@lists.openmicroscopy.org.uk</a><br class="">
<a href="http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users" target="_blank" class="">http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users</a><br class="">
<br class=""></blockquote></div><br class=""><br clear="all" class=""><div class=""><br class=""></div>-- <br class=""><div class="gmail_signature">mobile phone: 2024060862</div>
</div>
_______________________________________________<br class="">ome-users mailing list<br class=""><a href="mailto:ome-users@lists.openmicroscopy.org.uk" class="">ome-users@lists.openmicroscopy.org.uk</a><br class="">http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users<br class=""></div></blockquote></div><br class=""></div></body></html>