Metadata-Version: 2.1
Name: stainaug
Version: 0.0.3
Summary: A tool for H&E image augmentation
Home-page: https://github.com/estorrs/stainaug
Author: Erik Storrs
Author-email: estorrs@gmail.com
License: UNKNOWN
Keywords: H&E stain augmentation
Platform: UNKNOWN
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE

![example augmentation](https://github.com/estorrs/stainaug/blob/master/images/example.png)

A lightweight wrapper for image normalization implemented by [DIAGNijmegen](https://github.com/DIAGNijmegen/pathology-he-auto-augment), which used deconvolution based methods from [Faryna et al.](https://2021.midl.io/proceedings/faryna21.pdf) and [Tellez et al.](https://www.spiedigitallibrary.org/conference-proceedings-of-spie/10581/2293048/HE-stain-augmentation-improves-generalization-of-convolutional-networks-for-histopathological/10.1117/12.2293048.full?SSO=1).

#### Installation

```bash
pip install stainaug
```

#### Basic Usage

```python
import PIL.Image as Image
import numpy as np

from stainaug import Augmentor

# read in image
image_filepath = </path/to/image.jpeg>
img = np.asarray(Image.open(image_filepath))

# initialize augmentor
augmentor = Augmentor()

# transform image
augmented_img = augmentor.augment_HE(img)
```

#### Examples

For more examples see notebook [here](https://github.com/estorrs/stainaug/blob/master/examples/example.ipynb)



