lazyslide


Namelazyslide JSON
Version 0.7.2 PyPI version JSON
download
home_pageNone
SummaryModularized and scalable whole slide image analysis
upload_time2025-07-09 09:20:08
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseNone
keywords deep learning histopathology image analysis segmentation whole slide image
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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>

[![bioRxiv badge](https://zenodo.org/badge/doi/10.1101/2025.05.28.656548.svg)](https://doi.org/10.1101/2025.05.28.656548) ⬅️ read the preprint on BioRxiv

[![Documentation Status](https://readthedocs.org/projects/lazyslide/badge/?version=stable&style=flat-square)](https://lazyslide.readthedocs.io/en/stable)
![pypi version](https://img.shields.io/pypi/v/lazyslide?color=0098FF&logo=python&logoColor=white&style=flat-square)
![PyPI - License](https://img.shields.io/pypi/l/lazyslide?color=FFD43B&style=flat-square)
![scverse ecosystem](https://img.shields.io/badge/scverse_ecosystem-gray.svg?style=flat-square&logo=data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+PCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj4KPHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB2aWV3Qm94PSIwIDAgOTEgOTEiIHZlcnNpb249IjEuMSIKICAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIi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EuMiw4LjUgLTUuNCwxNiAtMTAuMSwxMS44Yy0yLjEsLTEuOCAtMywtNi45IDMuMSwtMTRaIiBzdHlsZT0iZmlsbDojZmZmO2ZpbGwtcnVsZTpub256ZXJvO3N0cm9rZTojMDAwO3N0cm9rZS13aWR0aDoxcHg7Ii8+CiAgICAgICAgICAgIDxwYXRoIGQ9Ik02NCw1NC4yYy0zLjMsLTQuOCAtOC4xLC03LjQgLTEyLjMsLTEwLjhjLTIuMiwtMS43IC0xNi40LC0xMS4yIC0xOS4yLC0xNS4xYy02LjQsLTYuNCAtOS41LC0xNi45IC0zLjQsLTIzLjFjLTQuNCwtMC44IC04LjIsMC4yIC0xMC42LDEuNWMtMS4xLDAuNiAtMi4xLDEuMiAtMi44LDJjLTYuNyw2LjIgLTUuOCwxNyAtMS42LDI0LjNjNC41LDcuOCAxMy4yLDE1LjQgMjQuMywyMi44YzUuMSwzLjQgMTUuNiw4LjQgMTkuMywxNmMxMS43LC04LjEgNy42LC0xNC45IDYuMywtMTcuNloiIHN0eWxlPSJmaWxsOiNiNGI0YjQ7ZmlsbC1ydWxlOm5vbnplcm87c3Ryb2tlOiMwMDA7c3Ryb2tlLXdpZHRoOjFweDsiLz4KICAgICAgICAgICAgPHBhdGggZD0iTTM4LjcsOS44YzcuOSw2LjMgMTIuNCw5LjggMjAsOC41YzUuNywtMSA0LjksLTcuOSAtNCwtMTMuNmMtNC40LC0yLjggLTkuNCwtNC4yIC0xNS43LC00LjJjLTcuNSwtMCAtMTYuMywzLjkgLTIwLjYsNi40YzQsLTIuMyAxMS45LC0zLjggMjAuMywyLjlaIiBzdHlsZT0iZmlsbDojZmZmO2ZpbGwtcnVsZTpub256ZXJvO3N0cm9rZTojMDAwO3N0cm9rZS13aWR0aDoxcHg7Ii8+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4=)

[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.​

![figure](assets/Figure.png)

## 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[![bioRxiv badge](https://zenodo.org/badge/doi/10.1101/2025.05.28.656548.svg)](https://doi.org/10.1101/2025.05.28.656548) \u2b05\ufe0f read the preprint on BioRxiv\n\n[![Documentation Status](https://readthedocs.org/projects/lazyslide/badge/?version=stable&style=flat-square)](https://lazyslide.readthedocs.io/en/stable)\n![pypi version](https://img.shields.io/pypi/v/lazyslide?color=0098FF&logo=python&logoColor=white&style=flat-square)\n![PyPI - License](https://img.shields.io/pypi/l/lazyslide?color=FFD43B&style=flat-square)\n![scverse ecosystem](https://img.shields.io/badge/scverse_ecosystem-gray.svg?style=flat-square&logo=data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+PCFET0N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uOSAtNCwtMTMuNmMtNC40LC0yLjggLTkuNCwtNC4yIC0xNS43LC00LjJjLTcuNSwtMCAtMTYuMywzLjkgLTIwLjYsNi40YzQsLTIuMyAxMS45LC0zLjggMjAuMywyLjlaIiBzdHlsZT0iZmlsbDojZmZmO2ZpbGwtcnVsZTpub256ZXJvO3N0cm9rZTojMDAwO3N0cm9rZS13aWR0aDoxcHg7Ii8+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4=)\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![figure](assets/Figure.png)\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"
}
        
Elapsed time: 1.52939s