<div dir="auto"><div>I meant, fetching images in different levels will generate several output images, right? For example, if I want to have 1/2 and 1/8 Aperio, then I will need to downsample 2 times to generate those 2 images (and add the existing 1/4 image later). My question was, how do I 'merge' those images into one file that I can use openslide with? Or am I missing something?</div><div dir="auto"><br></div><div dir="auto">Sorry for my ambiguous question. Once again thanks!</div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto">Kathleen</div><div dir="auto"><br><div class="gmail_quote" dir="auto"><div dir="ltr">On Mon, Apr 30, 2018, 12:20 AM Derek Magee <<a href="mailto:D.R.Magee@leeds.ac.uk">D.R.Magee@leeds.ac.uk</a>> wrote:<br></div><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_3461819958327489410WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">I’m not sure what you mean “generate a WSI”? The file IS a WSI to start with? You mean display it on the screen? Typically these files are huge, and so you
need a Google maps style viewer to explore them as they won’t fit onto any screen at full resolution. There are various options existing for that (both open source, free and commercial), or you can write your own using openslide (that’s what we did). I think
there is a simple web based thing as part of openslide that involves deep zoom and converting from aperio to deepzoom format using a python script based on openslide. I’m afraid I’m not familiar with exactly how it works. I’m sure it’s documented somewhere.
Openslide is a programming library, not a program to view slides itself.<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">HTH<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"><a name="m_3461819958327489410__MailEndCompose" rel="noreferrer"><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""> Kathleen Sucipto [mailto:<a href="mailto:sucipto.kathleen@gmail.com" target="_blank" rel="noreferrer">sucipto.kathleen@gmail.com</a>]
<br>
<b>Sent:</b> 29 April 2018 15:31<br>
<b>To:</b> Derek Magee<br>
<b>Cc:</b> <a href="mailto:openslide-users@lists.andrew.cmu.edu" target="_blank" rel="noreferrer">openslide-users@lists.andrew.cmu.edu</a><br>
<b>Subject:</b> Re: Converting image downsamples<u></u><u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">Hi Derek,<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">Thanks so much for your explanation!<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">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?<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>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">On Sun, Apr 29, 2018 at 10:10 PM, Derek Magee <<a href="mailto:D.R.Magee@leeds.ac.uk" target="_blank" rel="noreferrer">D.R.Magee@leeds.ac.uk</a>> wrote:<u></u><u></u></p>
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Hi Kathleen,</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></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).
</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></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.</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></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.
</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Does that answer your question?
</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Derek</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></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, …). </span><u></u><u></u></p>
<p class="MsoNormal"><a name="m_3461819958327489410_m_-4275946995963784871__MailEndCompose" rel="noreferrer"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span></a><u></u><u></u></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" rel="noreferrer">openslide-users-bounces+d.r.magee</a>=<a href="mailto:leeds.ac.uk@lists.andrew.cmu.edu" target="_blank" rel="noreferrer">leeds.ac.uk@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" rel="noreferrer">
openslide-users@lists.andrew.cmu.edu</a><br>
<b>Subject:</b> Converting image downsamples</span><u></u><u></u></p>
<div>
<div>
<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>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
</div>
</blockquote></div></div></div>