Skip to content

Commit 704ea5b

Browse files
authored
Merge pull request #48 from Leengit/tensorflow_dependency
ENH: Notebook now runs on Google Colab.
2 parents 1d73b2f + fe67170 commit 704ea5b

File tree

4 files changed

+17
-12
lines changed

4 files changed

+17
-12
lines changed

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,16 @@ The goal of this project is to create a whole-slide image file reader for machin
77
## Installation for Python
88

99
[![PyPI Version](https://img.shields.io/pypi/v/histomics_stream.svg)](https://pypi.python.org/pypi/histomics_stream)
10-
[![Open In CoLab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/DigitalSlideArchive/histomics_stream/blob/master/example/tensorflow_stream.ipynb?authuser=1)
10+
[![GitHub repository](https://img.shields.io/badge/Powered%20by-histomics__stream-blue.svg)](https://github.com/DigitalSlideArchive/histomics_stream)
11+
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/DigitalSlideArchive/histomics_stream/blob/master/example/tensorflow_stream.ipynb?authuser=1)
1112

1213
histomics_stream can be easily installed with Python wheels. If you do not want the installation to be to your current Python environment, you should first create and activate a [Python virtual environment (venv)](https://docs.python.org/3/tutorial/venv.html) to work in. Then, run the following from the command line:
1314

1415
```shell-script
15-
pip uninstall -y large_image tensorflow histomics_stream
16-
pip install 'large_image[all]' --find-links https://girder.github.io/large_image_wheels
17-
pip install histomics_stream
16+
apt update
17+
apt install -y python3-openslide openslide-tools
18+
pip uninstall -y histomics_stream large_image tensorflow
19+
pip install histomics_stream 'large_image[all]' --find-links https://girder.github.io/large_image_wheels
1820
```
1921

2022
Launch `python3`, import the histomics_stream package, and use it

example/tensorflow_stream.ipynb

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,13 @@
2929
"metadata": {},
3030
"outputs": [],
3131
"source": [
32-
"!pip uninstall -y large_image tensorflow histomics_stream\n",
33-
"!pip install 'large_image[all]' --find-links https://girder.github.io/large_image_wheels\n",
34-
"!pip install histomics_stream"
32+
"!apt update\n",
33+
"!apt install -y python3-openslide openslide-tools\n",
34+
"!pip uninstall -y histomics_stream large_image tensorflow\n",
35+
"!pip install histomics_stream 'large_image[all]' --find-links https://girder.github.io/large_image_wheels\n",
36+
"print(\n",
37+
" \"NOTE!: On Google Colab you may need to choose 'Runtime->Restart runtime' for these updates to take effect.\"\n",
38+
")"
3539
]
3640
},
3741
{
@@ -69,6 +73,7 @@
6973
"mask_filename = os.path.splitext(local_filename)[0] + \"-mask.png\"\n",
7074
"if not os.path.exists(mask_filename):\n",
7175
" import large_image\n",
76+
"\n",
7277
" print(f\"Creating {mask_filename} ...\")\n",
7378
" ts = large_image.open(local_filename)\n",
7479
" import numpy as np\n",

histomics_stream/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Whole-slide image streamer for TensorFlow."""
22

3-
__version__ = "2.1.2"
3+
__version__ = "2.1.3"
44

55
"""
66

setup.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setuptools.setup(
77
name="histomics_stream",
8-
version="2.1.2",
8+
version="2.1.3",
99
author="Lee Newberg",
1010
author_email="lee.newberg@kitware.com",
1111
description="A TensorFlow 2 package for reading whole slide images",
@@ -17,9 +17,7 @@
1717
"histomics_stream": "histomics_stream",
1818
},
1919
install_requires=[
20-
# tensorflow is not listed as a requirement because the user
21-
# will likely want to specify the version for compatibility
22-
# with the CUDA libraries, etc.
20+
"tensorflow>=2.6.0,<2.7",
2321
"itk",
2422
"pillow",
2523
"imagecodecs",

0 commit comments

Comments
 (0)