SVS File Whole Slide Image Tiling

jcupitt at gmail.com jcupitt at gmail.com
Wed Dec 11 03:48:34 EST 2019


Hello Sied,

On Wed, 11 Dec 2019 at 06:56, Angelos Pappas <angelos at smartcode.gr> wrote:
> You can use vips to create Deep Zoom images using the following command:
>
> vips dzsave yourslide.svs yourdzdirectory

dzsave will make a deepzoom pyramid by default, so a series of levels,
with overlapping tiles at each one.

It has quite a few options -- try:

    vips dzsave yourslide.svs yourdzdirectory --overlap 0 --tile-size
512 --depth one

And it'll only write the top layer (highest res) of the pyramid, tiles
will be 512 x 512, and there will be no overlap. Use --suffix .png if
you want PNG tiles.

You can run it from Python with:

    import pyvips
    image = pyvips.Image.new_from_file("yourslide.svs")
    image.dzsave("yourdzdirectory", overlap=0, tile_size=512, depth="one")

There's a chapter in the libvips manual introducing dzsave:

https://libvips.github.io/libvips/API/current/Making-image-pyramids.md.html

You can also simply crop out tiles in Python:

    import pyvips
    image = pyvips.Image.new_from_file("yourslide.svs")
    tile = image.crop(124878, 232445, 512, 512)

John


More information about the openslide-users mailing list