Module SlideIO¶
If you have any question about the library or want to report a bug, visit our new forum .
What is new in version 2.9.0¶
Support of Philips TIFF whole slide images through the new PHTIFF driver.
Reading from an explicitly selected zoom level with the new Scene method
read_block_from_level(). The rectangle is given in the coordinate system of the level, so a tiled viewer does not have to convert its coordinates and no implicit level selection happens inside the library.New level tile helpers: properties tile_count and method get_tile_rect of the level info object return the tile grid of a zoom level in level coordinates.
CZI: fixed a defect where a single pyramid level was split into two zoom levels, which could make read_block return a partially blank image.
Bug fixing and small improvements.
Earlier releases added the structured metadata tree (metadata property of Slide and Scene objects), multithreaded conversion, and support for OME-TIFF files.
Overview¶
Slideio is a python module for the reading of medical images. It allows reading whole slides as well as any region of a slide. Large slides can be effectively scaled to a smaller size. The module uses internal zoom pyramids of images to make the scaling process as fast as possible. Slideio supports 2D slides as well as 3D data sets and time series.
The module delivers a raster as a numpy array and compatible with the popular computer vision library OpenCV.
The module builds accesses images through a system of image drivers that implement specifics of different image formats. Currently following drivers are implemented:
CZI - driver for the reading of Zeiss CZI images.
SVS - driver for the reading of Aperio SVS images.
AFI - driver for the reading of Aperio fluorescent images.
SCN - driver for the reading of Leica SCN images.
GDAL - driver for the reading of generic formats like jpeg, png, tiff, etc. It uses a popular c++ image library GDAL.
ZVI - driver for reading of images produced by Carl Zeiss AxioVision microscope.
DCM - driver for reading of DICOM images, including whole slide images (WSI).
NDPI - driver for reading of Hamamatsu NDPI images.
VSI - driver for reading of Olympus VSI images.
QPTIFF - driver for reading of PerkinElmer Vectra QPTIFF images.
OMETIFF - driver for reading of OME-TIFF images.
PHTIFF - driver for reading of Philips TIFF whole slide images.
The module provides 2 python classes: Slide and Scene. Slide is a container object returned by the module function open_slide. In the simplest case, a Slide object contains a single Scene object. Some slides can contain multiple scenes. For example, a czi file can contain several scanned regions, each of them is represented as a Scene object. Scene class provides methods to access image pixel values and metadata.
Contents¶
Table of contents:
- Module functions
- Class Slide
- Class Scene
- Image Drivers
- Quick Tutorial
- Read the whole image
- Read a rectangular block of an image
- Read a rectangular block with rescaling
- Read 10 z-slices of a rectangular block with rescaling
- Iterate through scenes
- Read a single channel of an image
- Inspect the zoom levels of a scene
- Read a block from an explicitly selected zoom level
- Walk a zoom level tile by tile
- More examples
- License
- Used Software
- Used development environments
Installation¶
Installation of the modile available through pip.
pip install slideio
Quick Start¶
Here is an example of a reading of a czi file:
import slideio
slide = slideio.open_slide(file_path="/data/a.czi",driver_id="CZI")
scene = slide.get_scene(0)
block = scene.read_block()
Source code¶
Souce code is located in the gitlab repository and mirror github repository.