Skip to main content

Accessible and interoperable whole slide image analysis

Project description

LazySlide

Accessible and interoperable whole slide image analysis

bioRxiv badge ⬅️ read the preprint on BioRxiv

Documentation Status pypi version conda version PyPI - License scverse ecosystem

Installation | Tutorials | Preprint

LazySlide is a Python framework for whole slide image (WSI) analysis, designed to integrate seamlessly with the scverse ecosystem.

By adopting standardized data structures and APIs familiar to the single-cell and genomics community, LazySlide enables intuitive, interoperable, and reproducible workflows for histological analysis. It supports a range of tasks from basic preprocessing to advanced deep learning applications, facilitating the integration of histopathology into modern computational biology.

Contributions Welcome

💬 We warmly welcome contributions for documentation, tests, or even suggestions on what to add! Start by submitting an issue or pull request!

Key features

  • Interoperability: Built on top of SpatialData, ensuring compatibility with scverse tools like scanpy, anndata, and squidpy.
  • Accessibility: User-friendly APIs that cater to both beginners and experts in digital pathology.
  • Scalability: Efficient handling of large WSIs, enabling high-throughput analyses.
  • Multimodal integration: Combine histological data with transcriptomics, genomics, and textual annotations.
  • Foundation model support: Native integration with state-of-the-art models (e.g., UNI, CONCH, Gigapath, Virchow) for tasks like zero-shot classification and captioning.
  • Deep learning ready: Provides PyTorch dataloaders for seamless integration into machine learning pipelines.​

figure

Documentation

Comprehensive documentation is available at https://lazyslide.readthedocs.io. It includes tutorials, API references, and guides to help you get started.​

System requirements

LazySlide has been tested from Python 3.11 to 3.13 (with GitHub Action) on Windows, Linux, and MacOS. Version for dependencies is usually flexible, for the specific version used in development, please see pyproject.toml and uv.lock.

Installation

Lazyslide is available at the PyPI. This means that you can get it with your favourite package manager:

  • pip install lazyslide or
  • uv add lazyslide

A typical installation time on a MacBook Pro with uv takes ~4s.

For full instructions, please refer to the Installation page in the documentation.

Quick start

With a few lines of code, you can quickly run process a whole slide image (tissue segmentation, tesselation, feature extraction) (~7s on a MacBook Pro):

import lazyslide as zs

wsi = zs.datasets.sample()

# Pipeline
zs.pp.find_tissues(wsi)
zs.pp.tile_tissues(wsi, tile_px=256, mpp=0.5)
zs.tl.feature_extraction(wsi, model='resnet50')

# Access the features
features = wsi['resnet50_tiles']

# Visualize the 1st and 99th features
zs.pl.tiles(wsi, feature_key="resnet50", color=["1", "99"])

To use your slide file

from wsidata import open_wsi

wsi = open_wsi("path_to_slide")

Contributing

We welcome contributions from the community. Please refer to our contributing guide for guidelines on how to contribute.

Licence

LazySlide is released under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lazyslide-0.9.3rc1.tar.gz (113.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lazyslide-0.9.3rc1-py3-none-any.whl (164.1 kB view details)

Uploaded Python 3

File details

Details for the file lazyslide-0.9.3rc1.tar.gz.

File metadata

  • Download URL: lazyslide-0.9.3rc1.tar.gz
  • Upload date:
  • Size: 113.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.9 {"installer":{"name":"uv","version":"0.9.9"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for lazyslide-0.9.3rc1.tar.gz
Algorithm Hash digest
SHA256 ff78acb9b9b30673bc333c55e8e9be7f84605c1c5c4fba823fab6ca47e0f0d35
MD5 7cc14db4dd60e06689423802bbcb5b52
BLAKE2b-256 4d7d1c36f5474f1f1d32ae502820db3397728afd24577f145d34a5940cd548c6

See more details on using hashes here.

File details

Details for the file lazyslide-0.9.3rc1-py3-none-any.whl.

File metadata

  • Download URL: lazyslide-0.9.3rc1-py3-none-any.whl
  • Upload date:
  • Size: 164.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.9 {"installer":{"name":"uv","version":"0.9.9"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for lazyslide-0.9.3rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 95c759b1a0ff860cfa843a47eac129a6e193f6a72bffd6b5c8cb41c23c0b4891
MD5 5f86d839d681e391160f4f297ef1dde0
BLAKE2b-256 d4d5c6a40706bf87ce4618398fedf41c78039b53705015be9ec4f36e72f4c233

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page