Metadata-Version: 2.4
Name: histolytics
Version: 0.1.1
Summary: Panoptic Segmentation and WSI Spatial Analysis
Project-URL: Homepage, https://hautaniemilab.github.io/histolytics/
Project-URL: Documentation, https://hautaniemilab.github.io/histolytics/
Project-URL: Repository, https://github.com/HautaniemiLab/histolytics
Project-URL: Changelog, https://github.com/HautaniemiLab/histolytics/blob/main/CHANGELOG.md
Author-email: Oskari Lehtonen <oskari.lehtonen@helsinki.fi>
License: BSD 3-Clause License
        
        Copyright (c) 2024-2025, HautaniemiLab
        All rights reserved.
        
        Redistribution and use in source and binary forms, with or without
        modification, are permitted provided that the following conditions are met:
        
        * Redistributions of source code must retain the above copyright notice, this
          list of conditions and the following disclaimer.
        
        * Redistributions in binary form must reproduce the above copyright notice,
          this list of conditions and the following disclaimer in the documentation
          and/or other materials provided with the distribution.
        
        * Neither the name of the copyright holder nor the names of its
          contributors may be used to endorse or promote products derived from
          this software without specific prior written permission.
        
        THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
        AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
        IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
        DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
        FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
        DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
        SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
        CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
        OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
        OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
License-File: LICENSE
Keywords: computer vision,geospatial,panoptic segmentation,spatial analysis,whole slide image
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.10
Requires-Dist: albumentations>=2.0.6
Requires-Dist: cellseg-models-pytorch>=0.1.26
Requires-Dist: datasets>=3.6.0
Requires-Dist: esda>=2.7.0
Requires-Dist: geopandas>=1.0.1
Requires-Dist: h3>=4.2.2
Requires-Dist: libpysal>=4.13.0
Requires-Dist: mapclassify>=2.8.1
Requires-Dist: matplotlib>=3.10.3
Requires-Dist: networkx>=3.4.2
Requires-Dist: pandarallel>=1.6.5
Requires-Dist: quadbin>=0.2.2
Requires-Dist: xarray>=2025.6.1
Description-Content-Type: text/markdown

<div align="center">

![Logo](imgs/histolytics_logo.png)

**A Python library for scalable panoptic spatial analysis of histological WSIs**

[![Github Test](https://img.shields.io/github/actions/workflow/status/HautaniemiLab/histolytics/tests.yml?label=tests)](https://github.com/HautaniemiLab/histolytics/blob/main/.github/workflows/tests.yml) [![License](https://img.shields.io/github/license/HautaniemiLab/histolytics)](https://github.com/HautaniemiLab/histolytics/blob/main/LICENSE) [![Python - Version](https://img.shields.io/pypi/pyversions/histolytics)](https://www.python.org/) [![Package - Version](https://img.shields.io/pypi/v/histolytics)](https://pypi.org/project/histolytics/)

</div>

## Introduction

**histolytics** is a spatial analysis library for histological whole slide images (WSI) library built upon [`torch`](https://pytorch.org/), [`geopandas`](https://geopandas.org/en/stable/index.html) and [`libpysal`](https://pysal.org/libpysal/). The library contains multi-task encoder-decoder architectures for **panoptic segmentation** of WSIs into [`__geo_interface__`](https://gist.github.com/sgillies/2217756)-format and a wide array of spatial analysis tools for the resulting segmentation masks.

## Features 🌟
- WSI-level panoptic segmentation
- Several panoptic segmentation models for histological WSIs
- Pre-trained models in model-hub. See: [histolytics-hub](https://huggingface.co/histolytics-hub)
- Versatile spatial analysis tools for segmented WSIs

## Installation 🛠️

```shell
pip install histolytics
```

## Getting started with Histolytics

- [Segmentation Quick Start](https://hautaniemilab.github.io/histolytics/user_guide/seg/getting_started_seg/)
- [API Reference](https://hautaniemilab.github.io/histolytics/api/)


## Models 🤖

- Panoptic [HoVer-Net](https://www.sciencedirect.com/science/article/abs/pii/S1361841519301045)
- Panoptic [Cellpose](https://www.nature.com/articles/s41592-020-01018-x)
- Panoptic [Stardist](https://arxiv.org/abs/1806.03535)
- Panoptic [CellVit-SAM](https://arxiv.org/abs/2306.15350)
- Panoptic [CPP-Net](https://arxiv.org/abs/2102.06867)

## Contributing

We welcome contributions! To get started:

1. Fork the repository and create your branch from `main`.
2. Make your changes with clear commit messages.
3. Ensure all tests pass and add new tests as needed.
4. Submit a pull request describing your changes.

See [contributing guide](https://github.com/HautaniemiLab/histolytics/blob/main/CONTRIBUTING.md) for detailed guidelines.

## Citation

```bibtex
@article{2025histolytics,
  title={Histolytics: A Panoptic Spatial Analysis Framework for Interpretable Histopathology},
  author={Oskari Lehtonen, Niko Nordlund, Shams Salloum, Ilkka Kalliala, Anni Virtanen, Sampsa Hautaniemi},
  journal={XX},
  volume={XX},
  number={XX},
  pages={XX},
  year={2025},
  publisher={XX}
}
```
