WSI Normalizer: a color stain normalization tool/package for whole slide images
Inspired by & reconstructed from this repository link
How to start? blog
Description
Repository for normalizing whole slide images (WSI) patches.
Updates
[04/2025] We have upload the PyPI package for this repository. You can directly install it by using pip and use it without clone the repository.
Support for:
- Reinhard Reinhard, Erik, et al. "Color transfer between images." IEEE Computer graphics and applications 21.5 (2001): 34-41.
- Macenko 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.
- Vahadane Vahadane, Abhishek, et al. "Structure-preserving color normalization and sparse stain separation for histological images." IEEE transactions on medical imaging 35.8 (2016): 1962-1971.
Package Usage
Install the package via PyPI:
pip install wsi-normalizer
Then you can use it in your code:
import cv2
from wsi_normalizer import imread, MacenkoNormalizer # or ReinhardNormalizer, VahadaneNormalizer, TorchVahadaneNormalizer
macenko_normalizer = MacenkoNormalizer()
macenko_normalizer.fit(imread('TARGET_IMAGE.jpg'))
norm_img = macenko_normalizer.transform(imread('INPUT_IMAGE.jpg'))
cv2.imwrite('OUTPUT_IMAGE.jpg', cv2.cvtColor(norm_img, cv2.COLOR_RGB2BGR))
Metadata
Release files for wsi-normalizer 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| wsi_normalizer-1.0.1.tar.gz | 21.6 kB | Without provenance | Details for wsi_normalizer-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| wsi_normalizer-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for wsi_normalizer-1.0.1-py3-none-any.whl |
Total release size: 48.1 kB
Release files / wsi_normalizer-1.0.1.tar.gz
| Download URL | wsi_normalizer-1.0.1.tar.gz |
|---|---|
| Size | 21.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8afd5492005862bb721341f6038ab4f6850eff7e1371892a7b4e18b567ee9154
|
|
BLAKE2b-256 checksum How to use checksums |
7d152de60807e6cb868df9ce50c3dcf4f42dc1b7ffe1aa593b81924902a048bd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.10
|
Release files / wsi_normalizer-1.0.1-py3-none-any.whl
| Download URL | wsi_normalizer-1.0.1-py3-none-any.whl |
|---|---|
| Size | 26.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
04aaf4f19011874736902b65041ffd4e10bcb83fe964be4980160b6ef2a94862
|
|
BLAKE2b-256 checksum How to use checksums |
70529579778f7cc65657a692bb49ce60ca21359cc811968eee593c7ec42b45b3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.10
|
Security for wsi-normalizer 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.