# LazySlide
<p align="center">
<picture align="center">
<img src="https://raw.githubusercontent.com/rendeirolab/lazyslide/main/assets/logo@3x.png" width="150px">
</picture>
</p>
<p align="center">
<i>Accessible and interoperable whole slide image analysis</i>
</p>
[](https://doi.org/10.1101/2025.05.28.656548) ⬅️ read the preprint on BioRxiv
[](https://lazyslide.readthedocs.io/en/stable)



[Installation](https://lazyslide.readthedocs.io/en/stable/installation.html) |
[Tutorials](https://lazyslide.readthedocs.io/en/stable/tutorials/index.html) |
[Preprint](https://doi.org/10.1101/2025.05.28.656548)
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.
## 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.

## Documentation
Comprehensive documentation is available at [https://lazyslide.readthedocs.io](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](https://pypi.org/project/lazyslide). 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](https://lazyslide.readthedocs.io/en/stable/installation.html).
## 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):
```python
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
```python
from wsidata import open_wsi
wsi = open_wsi("path_to_slide")
```
## Contributing
We welcome contributions from the community. Please refer to our [contributing guide](CONTRIBUTING.md) for guidelines on
how to contribute.
## Licence
LazySlide is released under the [MIT License](LICENCE).
Raw data
{
"_id": null,
"home_page": null,
"name": "lazyslide",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "deep learning, histopathology, image analysis, segmentation, whole slide image",
"author": null,
"author_email": "Yimin Zheng <yzheng@cemm.at>, Ernesto Abila <eabila@cemm.at>, \"Andr\u00e9 F. Rendeiro\" <arendeiro@cemm.at>",
"download_url": "https://files.pythonhosted.org/packages/4c/d2/975d8e6477c86db5da715ffc2c7a8f6ad6024054a595c0e25430e0d0f2e4/lazyslide-0.7.2.tar.gz",
"platform": null,
"description": "# LazySlide\n\n<p align=\"center\">\n <picture align=\"center\">\n <img src=\"https://raw.githubusercontent.com/rendeirolab/lazyslide/main/assets/logo@3x.png\" width=\"150px\">\n </picture>\n</p>\n<p align=\"center\">\n <i>Accessible and interoperable whole slide image analysis</i>\n</p>\n\n[](https://doi.org/10.1101/2025.05.28.656548) \u2b05\ufe0f read the preprint on BioRxiv\n\n[](https://lazyslide.readthedocs.io/en/stable)\n\n\n\n\n[Installation](https://lazyslide.readthedocs.io/en/stable/installation.html) | \n[Tutorials](https://lazyslide.readthedocs.io/en/stable/tutorials/index.html) |\n[Preprint](https://doi.org/10.1101/2025.05.28.656548)\n\nLazySlide is a Python framework for whole slide image (WSI) analysis, designed to integrate seamlessly with the scverse\necosystem.\n\nBy adopting standardized data structures and APIs familiar to the single-cell and genomics community, LazySlide enables\nintuitive, interoperable, and reproducible workflows for histological analysis. It supports a range of tasks from basic\npreprocessing to advanced deep learning applications, facilitating the integration of histopathology into modern\ncomputational biology.\n\n## Key features\n\n- **Interoperability**: Built on top of SpatialData, ensuring compatibility with scverse tools like scanpy, anndata, and\n squidpy.\n- **Accessibility**: User-friendly APIs that cater to both beginners and experts in digital pathology.\n- **Scalability**: Efficient handling of large WSIs, enabling high-throughput analyses.\n- **Multimodal integration**: Combine histological data with transcriptomics, genomics, and textual annotations.\n- **Foundation model support**: Native integration with state-of-the-art models (e.g., UNI, CONCH, Gigapath, Virchow)\n for tasks like zero-shot classification and captioning.\n- **Deep learning ready**: Provides PyTorch dataloaders for seamless integration into machine learning pipelines.\u200b\n\n\n\n## Documentation\n\nComprehensive documentation is available at [https://lazyslide.readthedocs.io](https://lazyslide.readthedocs.io). It\nincludes tutorials, API references, and guides to help you get started.\u200b\n\n## System requirements\n\nLazySlide has been tested from Python 3.11 to 3.13 (with GitHub Action) on Windows, Linux, and MacOS.\nVersion for dependencies is usually flexible, for the specific version used in development, \nplease see `pyproject.toml` and `uv.lock`.\n\n## Installation\n\nLazyslide is available at the [PyPI](https://pypi.org/project/lazyslide). This means that you can get it with your\nfavourite package manager:\n\n- `pip install lazyslide` or\n- `uv add lazyslide`\n\nA typical installation time on a MacBook Pro with `uv` takes ~4s.\n\nFor full instructions, please refer to\nthe [Installation page in the documentation](https://lazyslide.readthedocs.io/en/stable/installation.html).\n\n## Quick start\n\nWith a few lines of code, you can quickly run process a whole slide image (tissue segmentation, tesselation, feature\nextraction) (~7s on a MacBook Pro):\n\n```python\nimport lazyslide as zs\n\nwsi = zs.datasets.sample()\n\n# Pipeline\nzs.pp.find_tissues(wsi)\nzs.pp.tile_tissues(wsi, tile_px=256, mpp=0.5)\nzs.tl.feature_extraction(wsi, model='resnet50')\n\n# Access the features\nfeatures = wsi['resnet50_tiles']\n\n# Visualize the 1st and 99th features\nzs.pl.tiles(wsi, feature_key=\"resnet50\", color=[\"1\", \"99\"])\n```\n\nTo use your slide file\n\n```python\nfrom wsidata import open_wsi\n\nwsi = open_wsi(\"path_to_slide\")\n```\n\n## Contributing\n\nWe welcome contributions from the community. Please refer to our [contributing guide](CONTRIBUTING.md) for guidelines on\nhow to contribute.\n\n## Licence\n\nLazySlide is released under the [MIT License](LICENCE).\n",
"bugtrack_url": null,
"license": null,
"summary": "Modularized and scalable whole slide image analysis",
"version": "0.7.2",
"project_urls": null,
"split_keywords": [
"deep learning",
" histopathology",
" image analysis",
" segmentation",
" whole slide image"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "e44f2ead2f9b443167d16b292ddf3f41164c6bd27730109a771f1f7dd25585bd",
"md5": "8c2c99eb108ae9de30491cb090ba23c9",
"sha256": "a0bc584a3ea8d69cbbde804b82e83ede60beea2f3c298dd1f3c6b9e3fc2139ec"
},
"downloads": -1,
"filename": "lazyslide-0.7.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "8c2c99eb108ae9de30491cb090ba23c9",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 143754,
"upload_time": "2025-07-09T09:20:07",
"upload_time_iso_8601": "2025-07-09T09:20:07.511141Z",
"url": "https://files.pythonhosted.org/packages/e4/4f/2ead2f9b443167d16b292ddf3f41164c6bd27730109a771f1f7dd25585bd/lazyslide-0.7.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "4cd2975d8e6477c86db5da715ffc2c7a8f6ad6024054a595c0e25430e0d0f2e4",
"md5": "f2096b502b470715d78f18f8aec4e8fb",
"sha256": "f80436d295cd1387623000e9d6ef78228afb96b59af294f011e528db3045f905"
},
"downloads": -1,
"filename": "lazyslide-0.7.2.tar.gz",
"has_sig": false,
"md5_digest": "f2096b502b470715d78f18f8aec4e8fb",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 101959,
"upload_time": "2025-07-09T09:20:08",
"upload_time_iso_8601": "2025-07-09T09:20:08.508043Z",
"url": "https://files.pythonhosted.org/packages/4c/d2/975d8e6477c86db5da715ffc2c7a8f6ad6024054a595c0e25430e0d0f2e4/lazyslide-0.7.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-09 09:20:08",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "lazyslide"
}