Converting image downsamples
Derek Magee
D.R.Magee at leeds.ac.uk
Sun Apr 29 18:53:17 EDT 2018
Openslide works with the files that come off scanners (e.g. aperio svs), so you don't need to generate a file that is usable by Openslide, as you already have one! I think you are cinfusing openslude with a slide viewing program. It's a library for reading files that you could use for building such a program, or doing other things with slides (e.g. analysis). The confusion i think lies in the fact Openslide comes with a python script to conVert these files into deepzoom format (levels in separate files e.g. jpeg plus a file describing the set of images). Deep zoom is a standard web format for zoomable images. One way of viewing these is to combine a javascript library called openseadragon with a web server. I think there is an example of how to do this on the Openslide web page, but I've never done it so I'm not the best person to advise on how to set this up.
Derek
On 29 Apr 2018 11:14 p.m., Kathleen Sucipto <sucipto.kathleen at gmail.com> wrote:
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<mailto: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<mailto:sucipto.kathleen at gmail.com>]
Sent: 29 April 2018 15:31
To: Derek Magee
Cc: openslide-users at lists.andrew.cmu.edu<mailto: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/7b2010f3/attachment.html>
More information about the openslide-users
mailing list