Skip to content

Booritas/slideio-python

Repository files navigation

SlideIO Python Wrapper

This repository provides a Python interface to the SlideIO library, a high-performance C++ image-reading framework designed for medical and biological slides. With SlideIO, you can read whole-slide images, extract specific regions, and scale large slides efficiently. The Python wrapper integrates these capabilities into a convenient API, returning image data as NumPy arrays.

License: BSD-3-Clause.


References


Overview

SlideIO is available as:

  • A C++ library for efficient reading of whole-slide images, with support for multi-dimensional data (2D, 3D, and time series).
  • A Python module that leverages the same C++ codebase, providing a Pythonic interface for reading images into NumPy arrays.

Key features include:

  • Whole-slide reading: Load entire slides or specific regions of interest.
  • Efficient scaling: Rapidly generate scaled images from large slides using internal zoom pyramids.
  • Format flexibility: Handle diverse medical and biological imaging formats through an extensible driver system.

Supported Image Formats

The following table lists the currently implemented drivers and their corresponding file formats:

Driver File Format Extensions Developer Scanners
SVS Aperio SVS *.svs Leica Microsystems Aperio GT 450 and Aperio GT 450 DX
AFI Aperio AFI (Fluorescent) *.afi Leica Microsystems
SCN Leica SCN *.scn Leica Microsystems Leica SCN400
CZI Zeiss CZI *.czi Zeiss Microscopy ZEISS Axioscan 7
ZVI Zeiss ZVI *.zvi Zeiss Microscopy
DCM DICOM *.dcm / no extension - -
NDPI Hamamatsu NDPI *.ndpi Hamamatsu
VSI Olympus VSI *.vsi - -
QPTIFF PerkinElmer Vectra QPTIFF *.qptiff Akoya Biosciences PerkinElmer Vectra
GDAL Common image formats (JPEG, PNG, TIFF, etc.) *.jpeg, *.jpg, *.tif, *.tiff, *.png - -

To learn more about the library and additional features, visit the SlideIO Website.


Building on Linux with the Manylinux Docker Container

Below are instructions for building the Python wheels within a manylinux environment.

  1. Clone Repositories

    git clone https://github.com/Booritas/slideio-python.git
    git clone https://github.com/Booritas/conan-center-index.git
  2. Run the Docker Container
    Map the parent directory containing these repositories into the container:

    docker run --name slideio -it \
      -v /path-to-slideio-python-parent-directory:/slideio \
      booritas/slideio-manylinux_2_28_x86_64:2.7.0 bash
  3. Set Environment Variables
    Within the container, point to the cloned repositories:

    export SLIDEIO_HOME=/slideio/slideio-python
    export CONAN_INDEX_HOME=/slideio/conan-center-index
  4. Build Custom Conan Packages

    cd /slideio/slideio-python
    ./conan.sh
  5. Install Conan Dependencies

    cd /slideio/slideio-python
    python3 ./install.py -a conan -c release
  6. Build Python Wheels

    cd /slideio/slideio-python
    ./build-wheels-manylinux.sh
  7. Locate the Wheel Packages
    You can find the resulting wheel files in the wheelhouse subdirectory of the slideio-python repository.


Contributing

Please submit pull requests or open issues if you have any suggestions or find any bugs. We welcome contributions from the community to improve the library and its Python bindings.


Enjoy using SlideIO for your medical and digital pathology workflows!