Skip to content

Commit

Permalink
resolve conflict in README
Browse files Browse the repository at this point in the history
  • Loading branch information
PingjunChen committed May 12, 2019
2 parents c192b07 + bf2b538 commit 86f6baf
Show file tree
Hide file tree
Showing 10 changed files with 54 additions and 34 deletions.
20 changes: 20 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: 2
jobs:
build:
docker:
- image: circleci/python:3.6
steps:
- checkout
- run: sudo apt-get install openslide-tools
- run:
command: |
python3 -m venv venv
. venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
pip install -U pytest
- run:
command: |
. venv/bin/activate
cd test
pytest .
8 changes: 4 additions & 4 deletions AUTHORS.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#### Main author:
#### Main author

- [Pingjun Chen](https://github.com/PingjunChen)
- [Pingjun Chen](https://github.com/PingjunChen)

#### Contributors (alphabetical last name):
#### Contributors (alphabetical last name)

- Lin Yang
- Lin Yang
35 changes: 19 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
tissueloc: Whole slide digital pathology image tissue localization
========
=============
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/2f1d165f709e43c4bc6d1d3a6563418e)](https://app.codacy.com/app/PingjunChen/tissueloc?utm_source=github.com&utm_medium=referral&utm_content=PingjunChen/tissueloc&utm_campaign=Badge_Grade_Dashboard)
[![Build Status](https://travis-ci.org/PingjunChen/tissueloc.svg?branch=master)](https://travis-ci.org/PingjunChen/tissueloc)
[![Documentation Status](https://readthedocs.org/projects/tissueloc/badge/?version=latest)](https://tissueloc.readthedocs.io/en/latest/?badge=latest)
[![PyPI version](https://badge.fury.io/py/tissueloc.svg)](https://badge.fury.io/py/tissueloc)
[![DOI](http://joss.theoj.org/papers/10.21105/joss.01148/status.svg)](https://doi.org/10.21105/joss.01148)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.2529982.svg)](https://doi.org/10.5281/zenodo.2529982)
[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.me/PingjunChen)
![](https://img.shields.io/github/stars/PingjunChen/tissueloc.svg)
<img src="./docs/media/tissuelocDemo.png" width="800" height="320" alt="Banner">


<img src="tissuelocDemo.png" width="800" height="320" alt="Banner">

## Installation
Installation
-------------
1. Install [OpenSlide](https://openslide.org/download/).
```
$ sudo apt-get install openslide-tools
Expand All @@ -26,7 +26,8 @@ $ pip install openslide-python
$ pip install tissueloc==2.0.0
```

## Usage example
Usage example
-------------
#### Interface
```
def locate_tissue_cnts(slide_path,
Expand Down Expand Up @@ -69,25 +70,27 @@ cnts, d_factor = locate_tissue_cnts(slide_path,
min_tissue_size=10000)
```



## Documentation
Documentation
-------------
Hosted in [https://tissueloc.readthedocs.io](https://tissueloc.readthedocs.io), powered by [readthedocs](https://readthedocs.org) and [Sphinx](http://www.sphinx-doc.org).


## Contributing
Contributing
-------------
``tissueloc`` is an open source project and anyone is welcome to contribute. An easy way to get started is by suggesting a new enhancement on the [Issues](https://github.com/PingjunChen/tissueloc/issues). If you have found a bug, then either report this through [Issues](https://github.com/PingjunChen/tissueloc/issues), or even better, make a fork of the repository, fix the bug and then create a [Pull Requests](https://github.com/PingjunChen/tissueloc/pulls) to get the fix into the master branch.

We would like to test this package on more diversified digital slides. Slides (low level images would be better) and their corresponding results are also very welcome as [Pull Requests](https://github.com/PingjunChen/tissueloc/pulls).

## License
License
-------------
[tissueloc](https://github.com/PingjunChen/tissueloc) is free software made available under the MIT License. For details see the [LICENSE](LICENSE) file.

## Contributors
Contributors
-------------
See the [AUTHORS.md](AUTHORS.md) file for a complete list of contributors to the project.

## Citing
``tissueloc`` is published in the Journal of Open Source Software - if it's ever useful for your research please consider citing it:
Citing
-------------
``tissueloc`` is published in the Journal of Open Source Software - please cite if it's useful for your research:
```
@article{chen2019tissueloc,
author = {Pingjun Chen and Lin Yang},
Expand Down
File renamed without changes
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-

import os, sys
from setuptools import setup, find_packages
import tissueloc

Expand Down
7 changes: 4 additions & 3 deletions test/test_load_slide.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# -*- coding: utf-8 -*-

import os, sys
import numpy as np
import pytest
# import numpy as np
# import pytest

TEST_PATH = os.path.abspath(os.path.dirname(__file__))
PRJ_PATH = os.path.dirname(TEST_PATH)
sys.path.insert(0, PRJ_PATH)
from tissueloc.load_slide import select_slide_level, load_slide_img
# from tissueloc.load_slide import select_slide_level
# from tissueloc.load_slide import load_slide_img


# def test_select_slide_level():
Expand Down
9 changes: 4 additions & 5 deletions test/test_locate_tissue.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,16 @@
import numpy as np
import scipy.misc as misc
import cv2
import pytest

TEST_PATH = os.path.abspath(os.path.dirname(__file__))
PRJ_PATH = os.path.dirname(TEST_PATH)
sys.path.insert(0, PRJ_PATH)


from tissueloc.load_slide import select_slide_level, load_slide_img
# from tissueloc.load_slide import select_slide_level
from tissueloc.load_slide import load_slide_img
from tissueloc.locate_tissue import rgb2gray, thresh_slide, fill_tissue_holes
from tissueloc.locate_tissue import remove_small_tissue, find_tissue_cnts
from tissueloc.locate_tissue import locate_tissue_cnts
# from tissueloc.locate_tissue import locate_tissue_cnts



Expand All @@ -34,7 +33,7 @@ def test_gen_intermediate_files():
misc.imsave(os.path.join(output_dir, "gray.png"), gray_img)
# Step 4: Smooth and Binarize
thresh_val = 0.8
bw_img = thresh_slide(gray_img, thresh_val=0.8, sigma=5)
bw_img = thresh_slide(gray_img, thresh_val=thresh_val, sigma=5)
misc.imsave(os.path.join(output_dir, "bw.png"), (bw_img*255.0).astype(np.uint8))
# Step 5: Fill tissue holes
bw_fill = fill_tissue_holes(bw_img)
Expand Down
5 changes: 2 additions & 3 deletions tissueloc/load_slide.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-

import os, sys
import openslide
from PIL import Image
import numpy as np
Expand Down Expand Up @@ -35,7 +34,7 @@ def select_slide_level(slide_path, max_size=2048):
level_dims = slide_head.level_dimensions

d_factors = slide_head.level_downsamples
assert len(level_dims) > 1, "This slide doesnot have mutliple levels"
# assert len(level_dims) > 1, "This slide doesnot have mutliple levels"
select_level = len(level_dims) - 1
for ind in np.arange(len(level_dims)):
cur_w, cur_h = level_dims[ind]
Expand Down Expand Up @@ -77,7 +76,7 @@ def load_slide_img(slide_path, level=0):
img_size = slide_head.level_dimensions[level]
slide_img = slide_head.read_region((0, 0), level, img_size)
if isinstance(slide_img, Image.Image):
slide_img = im = np.asarray(slide_img)
slide_img = np.asarray(slide_img)
if slide_img.shape[2] == 4:
slide_img = slide_img[:, :, :-1]
return slide_img
1 change: 0 additions & 1 deletion tissueloc/locate_tissue.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-

import os, sys
import numpy as np
from scipy.ndimage import binary_fill_holes
from skimage import filters, img_as_ubyte
Expand Down
2 changes: 1 addition & 1 deletion tissueloc/setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-

import os, sys
import os

BASE_PATH = os.path.abspath(os.path.dirname(__file__))
PKG_NAME = os.path.basename(BASE_PATH)
Expand Down

0 comments on commit 86f6baf

Please sign in to comment.