Metadata-Version: 2.1
Name: DigiPathAI
Version: 0.1.5
Summary: Deep Learning toolbox for WSI (digital histopatology) analysis
Home-page: https://github.com/haranrk/DigiPathAI
Author: Avinash Kori, Haran Rajkumar
Author-email: koriavinash1@gmail.com, haranrajkumar97@gmail.com
License: UNKNOWN
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3.5
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Description-Content-Type: text/markdown
Requires-Dist: flask
Requires-Dist: openslide-python
Provides-Extra: gpu
Requires-Dist: torch ; extra == 'gpu'
Requires-Dist: torchvision ; extra == 'gpu'
Requires-Dist: opencv-python ; extra == 'gpu'
Requires-Dist: imgaug ; extra == 'gpu'
Requires-Dist: tqdm ; extra == 'gpu'
Requires-Dist: matplotlib ; extra == 'gpu'
Requires-Dist: scikit-learn ; extra == 'gpu'
Requires-Dist: scikit-image ; extra == 'gpu'
Requires-Dist: tensorflow-gpu (<2,>=1.14) ; extra == 'gpu'
Requires-Dist: pydensecrf ; extra == 'gpu'
Requires-Dist: tifffile ; extra == 'gpu'
Requires-Dist: pandas ; extra == 'gpu'
Requires-Dist: wget ; extra == 'gpu'

[![Codacy Badge](https://api.codacy.com/project/badge/Grade/cbc70e33c4a14effb4bc9dd5d5b25bb4)](https://app.codacy.com/manual/haranrk/DigiPathAI?utm_source=github.com&utm_medium=referral&utm_content=haranrk/DigiPathAI&utm_campaign=Badge_Grade_Dashboard)
[![PyPI version](https://badge.fury.io/py/DigiPathAI.svg)](https://badge.fury.io/py/DigiPathAI)
# DigiPathAI
A software application built on top of [openslide](https://openslide.org/) for viewing [whole slide images (WSI)](https://www.ncbi.nlm.nih.gov/pubmed/30307746) and performing pathological analysis 

### Citation
If you find this reference implementation useful in your research, please consider citing:
```
@article{khened2020generalized,
  title={A Generalized Deep Learning Framework for Whole-Slide Image Segmentation and Analysis},
  author={Khened, Mahendra and Kori, Avinash and Rajkumar, Haran and Srinivasan, Balaji and Krishnamurthi, Ganapathy},
  journal={arXiv preprint arXiv:2001.00258},
  year={2020}
}
```
# Features
- Responsive WSI image viewer 
- State of the art cancer AI pipeline to segment and display the cancerous tissue regions

# Application Overview
<p align="center">
  <img src="imgs/demo.gif">
</p>

# Results
<p align="center">
  <img width="460" height="300" src="imgs/results_1.png">
</p>

# Online Demo
https://digipathai.tech/

# Installation
Running of the AI pipeline requires a GPU and several deep learning modules. However, you can run just the UI as well.

## Just the UI
### Requirements
- `openslide`
- `flask`

The following command will install only the dependencies listed above.
```
pip install DigiPathAI
```

## Entire AI pipeline
### Requirements
- `pytorch`
- `torchvision`
- `opencv-python`
- `imgaug`
- `matplotlib`
- `scikit-learn`
- `scikit-image`
- `tensorflow-gpu >=1.14,<2`
- `pydensecrf`
- `pandas`
- `wget`

The following command will install the dependencies mentioned
```
pip install "DigiPathAI[gpu]"
```

Both installation methods install the same package, just different dependencies. Even if you had installed using the earlier command, you can install the rest of the dependencies manually. 

# Usage 
## Local server
Traverse to the directory containing the openslide images and run the following command.
```
digipathai <host: localhost (default)> <port: 8080 (default)>
```

## Python API usage
The application also has an API which can be used within python to perform the segmentation. 
```
from DigiPathAI.Segmentation import getSegmentation

prediction = getSegmentation(img_path, 
			patch_size  = 256, 
			stride_size = 128,
			batch_size  = 32,
			quick       = True,
			tta_list    = None,
			crf         = False,
			save_path   = None,
			status      = None)
```

# Contact
- Avinash Kori (koriavinash1@gmail.com)
- Haran Rajkumar (haranrajkumar97@gmail.com)



