Metadata-Version: 2.1
Name: histoprep
Version: 0.0.1.dev13
Summary: Preprocessing module for large histological images.
Home-page: https://github.com/jopo666/HistoPrep
Author: jopo666
Author-email: jopo@birdlover.com
License: UNKNOWN
Keywords: image-analysis preprocessing histology openslide
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: opencv-python (>=4.2.0)
Requires-Dist: openslide-python (>=1.1.2)
Requires-Dist: pandas (>=1.1.0)
Requires-Dist: Pillow (>=7.0.0)
Requires-Dist: seaborn (>=0.11.0)
Requires-Dist: numpy (>=1.19.0)
Requires-Dist: scikit-learn (>0.23)
Requires-Dist: tqdm (>=4.0)

<div align="center">

# HistoPrep
Preprocessing large histological slides for machine learning made easy!
</div>

## Description

This module allows you to cut and preprocess large histological slides. Some of the features include:

- Cut large whole slide image (WSI) into tiles of desired size.
- Dearray individual tissue microarray (TMA) spots from a large slide image.
- **Easily** detect and discard blurry images or images with artifacts after cutting.
- Save a lot of tears while preprocessing images.

## Installation

```bash
# install as a module   
pip install histoprep

# install as an executable
git clone https://github.com/jopo666/HistoPrep
cd HistoPrep
pip install -r requirements.txt
```

You should also have `openslide-tools` installed on your machine.

```bash
sudo apt-get install openslide-tools
```

## Usage

HistoPrep can be used either as a module...

```python
import histoprep as hp
cutter = hp.Cutter('/path/to/slide', width=512, overlap=0.25)
metadata = cutter.save('/path/to/output_folder')
```

or as an excecutable!

```bash
python3 HistoPrep cut ./input_dir ./output_dir --width 512 --overlap 0.25 --img_type jpeg
```

## Documentation

Documentation can be found [here](https://histoprep.readthedocs.io/en/latest/)!


## Examples

Detailed examples with best practices:

- [Cutting and preprocessing a whole slide image.](https://github.com/jopo666/HistoPrep/blob/master/examples/cut.ipynb)
- [Cutting individual TMA spots from a slide.](https://github.com/jopo666/HistoPrep/blob/master/examples/dearray.ipynb) [coming in the future!]


