<div dir="ltr">Hi Derek,<div><br></div><div><br></div><div>Thanks so much for your explanation!</div><div><br></div><div>Once I'm done fetching the images in the desired levels (e.g. 1/power-of-2 in Aperio), is it possible to generate a WSI with those images?</div><div><br></div><div><br></div><div>Kathleen</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Apr 29, 2018 at 10:10 PM, Derek Magee <span dir="ltr"><<a href="mailto:D.R.Magee@leeds.ac.uk" target="_blank">D.R.Magee@leeds.ac.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-GB" link="blue" vlink="purple">
<div class="m_-4275946995963784871WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Hi Kathleen,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">I hope I’m understanding you correctly. In general WSIs contain a set of down-sampled images as well as the full resolution data. The downsamples present will
 vary from vendor to vendor. E.g. Aperio-Leica use 1 (native), 1/4 and 1/16 resolutions*. These are generated at scan time by a method specific to the vendor (probably digital downsampling of some kind, but we can’t be sure). Openslide reports which levels
 are present and the downsample factor  (which may not be integer power of 2 necessarily, but is usually pretty close).
<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">So, if you want a  level (downsample factor) that is present you simply fetch data from that level.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">If you want data from a level that is NOT present in the file, I typically fetch the next level up (e.g. for 1/2 resolution in Aperio – which is not present)-
 I fetch the full resolution data) and downsample it (e.g. by a  factor of 2 in this case). This can obviously be done in different ways from nearest neighbour, to linear, to higher order (e.g. polynomial) interpolation. I tend to implement nearest neighbour
 interpolation myself (for applications where speed is a premium). For other interpolation methods I tend to use OpenCV (in c++, or python). There are other options.
<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Does that answer your question?
<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Derek<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">(*Strictly Openslide reports Aperio-Leica files as having levels APPROXIMATELY at these downsamples. This has been discussed on this list before and it is not
 clear if Aperio actually downsample by a non-integer power of 2 to ensure each level is exactly the same width/height in physical units even with rounding to nearest integer number of pixels, or they just report it slightly wrong to suggest this but downsample
 by an integer power of 2. The difference is pretty academic. Other vendors usually stick to integer power of 2 downsamples. i.e 2,4,8,16, …).  <u></u><u></u></span></p>
<p class="MsoNormal"><a name="m_-4275946995963784871__MailEndCompose"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></a></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> openslide-users [mailto:<a href="mailto:openslide-users-bounces%2Bd.r.magee" target="_blank">openslide-users-<wbr>bounces+d.r.magee</a>=<a href="mailto:leeds.ac.uk@lists.andrew.cmu.edu" target="_blank">leeds.ac.uk@<wbr>lists.andrew.cmu.edu</a>]
<b>On Behalf Of </b>Kathleen Sucipto<br>
<b>Sent:</b> 29 April 2018 13:55<br>
<b>To:</b> <a href="mailto:openslide-users@lists.andrew.cmu.edu" target="_blank">openslide-users@lists.andrew.<wbr>cmu.edu</a><br>
<b>Subject:</b> Converting image downsamples<u></u><u></u></span></p><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">Hi,<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I'm still getting familiar with WSI concept. Is it correct to say that in order to convert the downsamples (let's say from 1, 2, 4, ... to 1,4,16, ...) we just need to resize the image in all levels? Or is there a faster method?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Thanks!<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Kathleen<u></u><u></u></p>
</div>
</div>
</div></div></div>
</div>

</blockquote></div><br></div>