Skip to content

Commit

Permalink
Merge branch 'andreped-fix/readme-update' into development
Browse files Browse the repository at this point in the history
  • Loading branch information
carloalbertobarbano committed Jan 8, 2025
2 parents f9df314 + e156b99 commit 5ccc187
Showing 1 changed file with 21 additions and 8 deletions.
29 changes: 21 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@
[![Pip Downloads](https://img.shields.io/pypi/dm/torchstain?label=pip%20downloads&logo=python)](https://pypi.org/project/torchstain/)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.7692014.svg)](https://doi.org/10.5281/zenodo.7692014)

GPU-accelerated stain normalization tools for histopathological images. Compatible with PyTorch, TensorFlow, and Numpy.
GPU-accelerated stain tools for histopathological images. Compatible with PyTorch, TensorFlow, and Numpy.

Normalization algorithms currently implemented:
- Macenko [\[1\]](#reference) (ported from [numpy implementation](https://github.com/schaugf/HEnorm_python))
- Reinhard [\[2\]](#reference)
- Modified Reinhard [\[3\]](#reference)
- Multi-target Macenko [\[4\]](#reference)

| Algorithm | numpy | torch | tensorflow |
|-|-|-|-|
| Macenko [\[1\]](#reference) | ✓ | ✓ | ✓ |
| Reinhard [\[2\]](#reference) | ✓ | ✓ | ✓ |
| Modified Reinhard [\[3\]](#reference) | ✓ | ✓ | ✓ |
Augmentation algorithms currently implemented:
- Macenko-Aug [\[1\]](#reference) (inspired by [StainTools](https://github.com/Peter554/StainTools))

## Installation

Expand Down Expand Up @@ -47,9 +49,19 @@ norm, H, E = normalizer.normalize(I=t_to_transform, stains=True)

![alt text](data/result.png)

## Implemented algorithms

| Algorithm | numpy | torch | tensorflow |
|-|-|-|-|
| Macenko | ✓ | ✓ | ✓ |
| Reinhard | ✓ | ✓ | ✓ |
| Modified Reinhard | ✓ | ✓ | ✓ |
| Multi-target Macenko | ✗ | ✓ | ✗ |
| Macenko-Aug | ✓ | ✓ | ✓ |

## Backend comparison

Macenko runtime results using different backends with 10 runs per image size on a Intel(R) Core(TM) i5-8365U CPU @ 1.60GHz.
Runtimes using the Macenko algorithm using different backends. Metrics were calculated from 10 repeated runs for each quadratic image size on an Intel(R) Core(TM) i5-8365U CPU @ 1.60GHz.

| size | numpy avg. time | torch avg. time | tf avg. time |
|--------|-------------------|-------------------|------------------|
Expand All @@ -66,7 +78,8 @@ Macenko runtime results using different backends with 10 runs per image size on

- [1] Macenko, Marc et al. "A method for normalizing histology slides for quantitative analysis." 2009 IEEE International Symposium on Biomedical Imaging: From Nano to Macro. IEEE, 2009.
- [2] Reinhard, Erik et al. "Color transfer between images." IEEE Computer Graphics and Applications. IEEE, 2001.
- [3] Roy, Santanu et al. "Modified Reinhard Algorithm for Color Normalization of Colorectal Cancer Histopathology Images". 2021 29th European Signal Processing Conference (EUSIPCO). IEEE, 2021.
- [3] Roy, Santanu et al. "Modified Reinhard Algorithm for Color Normalization of Colorectal Cancer Histopathology Images". 2021 29th European Signal Processing Conference (EUSIPCO), IEEE, 2021.
- [4] Ivanov, Desislav et al. "Multi-target stain normalization for histology slides". arXiv (preprint). 2024.

## Citing

Expand Down

0 comments on commit 5ccc187

Please sign in to comment.