wsipre

wsipre (Whole-Slide Image PREprocessing) is a small Python package to handle whole-slide images (WSI; also known as virtual slides) with region-level annotations.

wsipre is a wrapper of the OpenSlide Python package, an interface to the excellent OpenSlide C library which allows reading WSIs. wsipre conserves OpenSlide Python’s API and extends it to handle WSI annotations and to perform processing tasks. The underlying objective is the preparation of WSIs for Machine Learning (particularly Deep Learning).

Other Python projects providing overlapping functionality (non-exhaustive list):

Installation

Main dependencies

wsipre was developed in Python version 3.7.1. It has not been tested with earlier versions, but it should generally work with Python version 3.*. The main requirements are the following packages (the versions used for development are listed):

Note

Some linux package managers currently distribute an outdated version of the OpenSlide C library: version 3.4.0. This version lacks support for some recent WSI formats, displaying wrong tiled downsampled views of the slides and crashing upon reading some regions. To avoid these problems please make sure you have OpenSlide version 3.4.1.

You can check the installed version by running the following code in a Python interpreter:

>>> import openslide
>>> openslide.__library_version__
'3.4.1'

User installation

wsipre can be installed from PyPI:

pip install wsipre

The source code is hosted on GitHub.

License

This project is licensed under the terms of the MIT license. See LICENSE file for details.

Package reference

Indices and tables