Converting image downsamples
Derek Magee
D.R.Magee at leeds.ac.uk
Sun Apr 29 12:18:59 EDT 2018
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<mailto: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<mailto:openslide-users-bounces%2Bd.r.magee>=leeds.ac.uk at lists.andrew.cmu.edu<mailto: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<mailto: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/dffe91c5/attachment.html>
More information about the openslide-users
mailing list