Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 15 additions & 32 deletions .github/workflows/pip-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ name: pip Install
on:
push:
paths: [ "requirements*.yml", "conda-env-create.yml", "requirements/requirement*.txt", "setup*py", "setup*cfg", "pytproject*toml", "MANIFEST*in"]
pull_request:
paths: [ "requirements*.yml", "conda-env-create.yml", "requirements/requirement*.txt", "setup*py", "setup*cfg", "pytproject*toml", "MANIFEST*in"]

jobs:
build:
Expand All @@ -19,16 +21,16 @@ jobs:
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: 🐧 Install OpenSlide & OpenJPEG
- name: 🐧 Install OpenJPEG
if: runner.os == 'Linux'
run: |
sudo apt update
sudo apt-get install -y libopenslide-dev openslide-tools libopenjp2-7 libopenjp2-tools
sudo apt-get install -y libopenjp2-7 libopenjp2-tools
python -m pip install --upgrade pip
- name: 🍎 Install OpenSlide & OpenJPEG
- name: 🍎 Install OpenJPEG
if: runner.os == 'macOS'
run: |
brew install openslide openjpeg
brew install openjpeg
python -m pip install --upgrade pip
- name: 🪟 Install OpenJPEG
if: runner.os == 'Windows'
Expand All @@ -43,47 +45,28 @@ jobs:
make -j4
make install
make clean
- name: 🪟 Install OpenSlide
if: runner.os == 'Windows'
run: |
choco install wget --no-progress
wget https://github.com/openslide/openslide-winbuild/releases/download/v20220811/openslide-win64-20220811.zip
7z x openslide-win64-20220811.zip
ls openslide-win64-20220811
# Add to PATH
echo "$(realpath ./openslide-win64-20220811/bin)" >> $GITHUB_PATH
echo "$(realpath ./openslide-win64-20220811/lib)" >> $GITHUB_PATH
# Install
mkdir "C:\Program Files\openslide"
Copy-Item -Path ".\openslide-win64-20220811\*" -Destination "C:\Program Files\openslide" -Recurse
ls "C:/Program Files/openslide"
- name: 🪟 Install SQLite Shell
if: runner.os == 'Windows'
run: choco install sqlite.shell --no-progress
- name: SQLite Version Information
run: |
sqlite3 --version
sqlite3 ":memory:" -list ".output stdout" "pragma compile_options" ".exit"
- name: OpenSlide Version Information
if: runner.os == 'Linux'
run: openslide-quickhash1sum --version
- name: OpenJPEG Version Information
continue-on-error: true # This -h option has exit code 1 for some reason
run: opj_dump -h
- name: pip Install From GitHub Repo on Linux and macOS
if: runner.os != 'Windows'
run: python -m pip install git+https://github.com/TissueImageAnalytics/tiatoolbox@${GITHUB_REF_NAME}
run: python -m pip install git+https://github.com/TissueImageAnalytics/tiatoolbox@${GITHUB_SHA}
- name: pip Install From GitHub on Windows
if: runner.os == 'Windows'
run: python -m pip install git+https://github.com/TissueImageAnalytics/tiatoolbox@$env:GITHUB_REF_NAME
- name: Test TIAToolbox Import
run: python -m pip install git+https://github.com/TissueImageAnalytics/tiatoolbox@$env:GITHUB_SHA
- name: Test Imports
shell: python
run: |
import os
if hasattr(os, "add_dll_directory"):
# Required for Python>=3.8 on Windows
with os.add_dll_directory(r"D:\a\tiatoolbox\tiatoolbox\openslide-win64-20220811\bin"):
import tiatoolbox
else:
os.environ["PATH"] = r"D:\a\tiatoolbox\tiatoolbox\openslide-win64-20220811\bin;"
import tiatoolbox
import tiatoolbox
print(tiatoolbox.__version__)
import openslide
print(openslide.__version__)
import torch
print(torch.__version__)
4 changes: 1 addition & 3 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Install dependencies
run: |
sudo apt update
sudo apt-get install -y libopenslide-dev openslide-tools libopenjp2-7 libopenjp2-tools
sudo apt-get install -y libopenjp2-7 libopenjp2-tools
python -m pip install --upgrade pip
python -m pip install ruff==0.11.8 pytest pytest-cov pytest-runner
pip install -r requirements/requirements.txt
Expand All @@ -42,8 +42,6 @@ jobs:
echo "---SQlite---"
sqlite3 --version
sqlite3 ":memory:" -list ".output stdout" "pragma compile_options" ".exit"
echo "---Openslide---"
openslide-quickhash1sum --version
echo "---OpenJPEG---"
opj_dump -h | head -n 5
echo "---Python---"
Expand Down
10 changes: 4 additions & 6 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,14 @@ On Linux, the prerequisite software can be installed using the following command

.. code-block:: console

$ apt-get -y install libopenjp2-7-dev libopenjp2-tools openslide-tools
$ apt-get -y install libopenjp2-7-dev libopenjp2-tools

The same command is used when working on the Colab or Kaggle platforms. When working on Google Colab, we remove the packages ``datascience`` and ``albumentations`` because they conflict and produce an error message.

Windows (10+)
-------------

1. Download OpenSlide binaries from `this page <https://openslide.org/download/>`_. Extract the folder and add the ``bin`` and ``lib`` subdirectories to the Windows `system path <https://docs.microsoft.com/en-us/previous-versions/office/developer/sharepoint-2010/ee537574(v=office.14)>`_. If you are using a conda environment, you can also copy the ``bin`` and ``lib`` subdirectories to ``[Anaconda Installation Path]/envs/[tiatoolbox-environment]/Library/``.

2. Install OpenJPEG. The easiest way to install OpenJPEG is through conda:
On Windows, ``OpenJPEG`` can be installed using the following ``conda`` command:

.. code-block:: console

Expand All @@ -45,14 +43,14 @@ Homebrew

.. code-block:: console

$ brew install openjpeg openslide
$ brew install openjpeg

MacPorts
^^^^^^^^

.. code-block:: console

$ port install openjpeg openslide
$ port install openjpeg

Installing Stable Release
=========================
Expand Down
3 changes: 2 additions & 1 deletion requirements/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ matplotlib>=3.6.2
numba>=0.57.0
numpy>=1.23.5, <2.0.0
opencv-python>=4.6.0
openslide-python>=1.2.0
openslide-bin>=4.0.0.2
openslide-python>=1.4.0
pandas>=2.0.0
pillow>=9.3.0
pydicom>=2.3.1 # Used by wsidicom
Expand Down