Converting image downsamples

Kathleen Sucipto sucipto.kathleen at gmail.com
Sun Apr 29 18:14:09 EDT 2018


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?

Sorry for my ambiguous question. Once again thanks!


Kathleen

On Mon, Apr 30, 2018, 12:20 AM Derek Magee <D.R.Magee at leeds.ac.uk> wrote:

> 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.
>
>
>
> HTH
>
>
>
> Derek
>
>
>
> *From:* Kathleen Sucipto [mailto:sucipto.kathleen at gmail.com]
> *Sent:* 29 April 2018 15:31
> *To:* Derek Magee
> *Cc:* openslide-users at lists.andrew.cmu.edu
> *Subject:* Re: Converting image downsamples
>
>
>
> Hi Derek,
>
>
>
>
>
> Thanks so much for your explanation!
>
>
>
> 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?
>
>
>
>
>
> Kathleen
>
>
>
> On Sun, Apr 29, 2018 at 10:10 PM, Derek Magee <D.R.Magee at leeds.ac.uk>
> wrote:
>
> Hi Kathleen,
>
>
>
> 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).
>
>
>
> So, if you want a  level (downsample factor) that is present you simply
> fetch data from that level.
>
>
>
> 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.
>
>
>
> Does that answer your question?
>
>
>
> Derek
>
>
>
> (*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, …).
>
>
>
> *From:* openslide-users [mailto:openslide-users-bounces+d.r.magee=
> leeds.ac.uk at lists.andrew.cmu.edu] *On Behalf Of *Kathleen Sucipto
> *Sent:* 29 April 2018 13:55
> *To:* openslide-users at lists.andrew.cmu.edu
> *Subject:* Converting image downsamples
>
>
>
> Hi,
>
>
>
>
>
> 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?
>
>
>
> Thanks!
>
>
>
>
>
> Kathleen
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.andrew.cmu.edu/pipermail/openslide-users/attachments/20180429/4727627a/attachment-0001.html>


More information about the openslide-users mailing list