Metadata-Version: 2.4
Name: lazyslide
Version: 0.6.0
Summary: Modularized and scalable whole slide image analysis
Author-email: Yimin Zheng <yzheng@cemm.at>, Ernesto Abila <eabila@cemm.at>, "André F. Rendeiro" <arendeiro@cemm.at>
License-Expression: MIT
License-File: LICENSE
Keywords: deep learning,histopathology,image analysis,segmentation,whole slide image
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: File Formats
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Requires-Python: >=3.10
Requires-Dist: cyclopts>=3.0.0
Requires-Dist: legendkit>=0.3.4
Requires-Dist: matplotlib-scalebar>=0.9.0
Requires-Dist: matplotlib>=3.9.0
Requires-Dist: psutil>=5.9.0
Requires-Dist: rich>=13.0.0
Requires-Dist: scikit-learn>=1.0
Requires-Dist: seaborn>=0.12.2
Requires-Dist: timm>=1.0.3
Requires-Dist: torch>=2.0.0
Requires-Dist: wsidata>=0.6.0
Provides-Extra: all
Requires-Dist: scanpy>=1.10.4; extra == 'all'
Requires-Dist: scipy>=1.15.1; extra == 'all'
Requires-Dist: torchstain>=1.4.1; extra == 'all'
Requires-Dist: torchvision>=0.15; extra == 'all'
Requires-Dist: transformers>=4.49.0; extra == 'all'
Description-Content-Type: text/markdown

# 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>

[![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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Ryb2tlOiMwMDA7c3Ryb2tlLXdpZHRoOjFweDsiLz4KICAgICAgICAgICAgPHBhdGggZD0iTTM4LjcsOS44YzcuOSw2LjMgMTIuNCw5LjggMjAsOC41YzUuNywtMSA0LjksLTcuOSAtNCwtMTMuNmMtNC40LC0yLjggLTkuNCwtNC4yIC0xNS43LC00LjJjLTcuNSwtMCAtMTYuMywzLjkgLTIwLjYsNi40YzQsLTIuMyAxMS45LC0zLjggMjAuMywyLjlaIiBzdHlsZT0iZmlsbDojZmZmO2ZpbGwtcnVsZTpub256ZXJvO3N0cm9rZTojMDAwO3N0cm9rZS13aWR0aDoxcHg7Ii8+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4=)

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

## Installation

Lazyslide is available at the [PyPI index](https://pypi.org/project/lazyslide). This means that you can get it with your favourite package manager:
- `pip install lazyslide` or
- `uv add lazyslide` 

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):

```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']
```

## 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).
