Skip to content

Commit 2275bf0

Browse files
shaneahmedmeastyJiaqi-Lvadamshephardmostafajahanifar
authored
🔖 Release 2.0.0 (#1031)
## TIAToolbox v2.0.0 (2026-03-11) ### ✨ Major Updates and Feature Improvements #### ⚙️ Engine Redesign (PR #578) TIAToolbox 2.0.0 introduces a completely re-engineered inference engine designed for significant performance, scalability, and memory-efficiency improvements. #### Key Enhancements - A modern processing stack built on **Dask** (parallel/distributed execution) and **Zarr** (chunked, out-of-core storage) - **Standardised output formats** across all engines: - Python `dict` - **Zarr** - **AnnotationStore** (SQLite-backed) - **QuPath JSON** - Cleaner runtime behavior with reduced warning noise and a unified progress bar - More predictable memory usage through chunked streaming - Broader test coverage across engine components ### 🗺️ Improved QuPath Support Enhancements include: - Better handling of **GeoJSON** - Support for **multipoint geometries** (#841) - Improved semantic output helpers: - `dict_to_store_semantic_segmentor` (#926) - OME-TIFF probability overlays (#929) ### 🔬 New Nucleus Detection Engine A dedicated nucleus detection pipeline has been added, built on the redesigned engine for improved accuracy and efficient large-scale processing. #### 🧠 KongNet Model Family TIAToolbox 2.0.0 introduces **KongNet**, a high-performance architecture that achieved top results across multiple international challenges: - 🥇 **1st place: MONKEY Challenge (overall detection)** - 🥇 **1st place: MIDOG (mitosis detection)** - ⭐ Top-tier performance on **PUMA** Multiple pretrained variants are available (CoNIC, PanNuke, MONKEY, PUMA, MIDOG), each with standardised IO configurations. ### 🧬 Expanded Foundation Model Support Additional foundation models are now supported (#906), broadening the range of high-capacity architectures available for feature extraction and downstream tasks. ### 🖼️ SAM Segmentation in TIAViz TIAViz now integrates Meta’s Segment Anything Model (SAM), enabling: - Interactive segmentation - Rapid region extraction - Exploratory annotation workflows Simplified SAM usage (#968) streamlines its integration into analysis pipelines. ### 🧩 Enhanced WSIReader & Metadata Handling Major improvements include: - More robust cross-vendor **metadata extraction** (#1001) - **Multichannel image support** (PR #825) for immunofluorescence and non-RGB modalities - Simplified Windows installation using `openslide-bin` (no manual DLL steps) - macOS Tileserver fix (#976) - Improved DICOM reading (#934) ### ☁️ New Cloud-Native Reader: FsspecJSONWSIReader (PR #897) A new reader supporting **fsspec-compatible filesystems**, enabling seamless access to WSIs stored on: - S3 - GCS - Azure - HPC clusters - Any fsspec-supported backend This enables cloud-native and distributed data workflows. Contributed by @aacic ### 🤗 Pretrained Models Migrated to Hugging Face All pretrained models and sample assets have been migrated (#945, #983), improving: - Download reliability - Versioning and reproducibility - Caching and CI integration - Licensing clarity per model family ### 🛡️ Security, Compatibility & Tooling #### 🔐 Security & Dependency Updates - Dependency upgrades - Internal security improvements - Explicit workflow permissions added (#1021, #1023) #### 🐍 Python Version Support - **Dropped:** Python **3.9** - **Added:** Python **3.13** - **Supported:** Python 3.10–3.13 - Updated CUDA wheel source to **cu126** #### 🛠️ Developer Tooling & CI/CD - Expanded **mypy** type-checking coverage (#912, #931, #935, #951) - Updated pre-commit hooks and general formatting - CI uses **CPU-only PyTorch** for faster, more reliable builds (#974, #979) - Updated pip install workflow (#1013) - Added new **Python 3.13 Docker images** (#1014, #1019) ### 🧹 Bug Fixes & Stability Improvements - Fixed multi-GPU behaviour with `torch.compile` (#923) - Fixed DICOM reading issue (#934) - Fixed annotation contour handling with holes (#956) - Fixed consecutive annotation load bug (#927) - Fixed SCCNN model issues (#970) - Fixed MapDe `dist_filter` shape issue (#914) - Improved notebook reliability on Colab (#1026#1030) - macOS TileServer issues resolved (#976) ### 🧭 Migration Guide for Users #### 🔄 Updating from 1.x to 2.0.0 #### Update calls: replace `.predict()` with `.run()` ```python # Old results = segmentor.predict(imgs=[...], ioconfig=config) # New results = segmentor.run(images=[...], ioconfig=config) ``` #### Use `patch_mode`: replace `mode="patch"` with `patch_mode=True` and `mode="tile"` or "wsi" with `patch_mode=False` ```python # Old results = segmentor.predict(imgs=[...], mode="patch", ioconfig=config) # New results = segmentor.run(images=[...], patch_mode=True, ioconfig=config) ``` ```python # Old results = segmentor.predict(imgs=[...], mode="wsi", ioconfig=config) # New results = segmentor.run(images=[...], patch_mode=False, ioconfig=config) ``` #### Use the new I/O configs ```python from tiatoolbox.models.engine.io_config import IOSegmentorConfig config = IOSegmentorConfig( patch_input_shape=(256, 256), stride_shape=(240, 240), input_resolutions=[{"resolution": 0.25, "units": "mpp"}], save_resolution={"units": "baseline", "resolution": 1.0} ) ``` #### Specify the output format ```python results = segmentor.run( images=[...], ioconfig=ioconfig, output_type="zarr", # or "dict", "annotationstore", "qupath" save_dir="outputs/" ) ``` #### Update imports - `tiatoolbox.typing` → `tiatoolbox.type_hints` #### Install requirements - Python **3.10+** required - On Windows: install OpenSlide via `pip install openslide-bin` **Full Changelog:** v1.6.0...v2.0.0 --------- Signed-off-by: Shan E Ahmed Raza <13048456+shaneahmed@users.noreply.github.com> Co-authored-by: measty <20169086+measty@users.noreply.github.com> Co-authored-by: Jiaqi-Lv <60471431+Jiaqi-Lv@users.noreply.github.com> Co-authored-by: adamshephard <39619155+adamshephard@users.noreply.github.com> Co-authored-by: Mostafa Jahanifar <74412979+mostafajahanifar@users.noreply.github.com> Co-authored-by: John Pocock <John-P@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Yijie Zhu <120978607+YijieZhu15@users.noreply.github.com> Co-authored-by: Aleksandar Acic <32873451+aacic@users.noreply.github.com> Co-authored-by: Abdol A <u2271662@live.warwick.ac.uk> Co-authored-by: Abishek <abishekraj6797@gmail.com> Co-authored-by: behnazelhaminia <30952176+behnazelhaminia@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Adam Shephard <adam.shephard@warwick.ac.uk> Co-authored-by: gozdeg <gozdegunesli@gmail.com> Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> Co-authored-by: mbasheer04 <78800844+mbasheer04@users.noreply.github.com> Co-authored-by: vqdang <24943262+vqdang@users.noreply.github.com>
1 parent e14a4fc commit 2275bf0

204 files changed

Lines changed: 40840 additions & 19118 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/conda-env-create.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
name: Solve Conda Environment
44

5+
permissions:
6+
contents: read
7+
58
on:
69
push:
710
paths: [ "requirements/requirements*.yml", "conda-env-create.yml", "requirement*.txt"]
@@ -33,7 +36,7 @@ jobs:
3336
runs-on: ${{ matrix.os }}
3437
timeout-minutes: 20
3538
steps:
36-
- uses: actions/checkout@v2
39+
- uses: actions/checkout@v4
3740
- name: Copy requirements files
3841
shell: bash
3942
run: |
@@ -48,3 +51,4 @@ jobs:
4851
run: |
4952
micromamba info
5053
micromamba list
54+
python -c "import torch, numpy; print(torch.__version__, numpy.__version__)"

.github/workflows/docker-publish.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ env:
66
REGISTRY: ghcr.io
77
IMAGE_NAME: TissueImageAnalytics/tiatoolbox
88
image: ghcr.io/tissueimageanalytics/tiatoolbox
9-
TOOLBOX_VER: 1.6.0
9+
TOOLBOX_VER: 2.0.0
1010

1111
jobs:
1212
build-and-push-image:
@@ -15,10 +15,6 @@ jobs:
1515
fail-fast: true
1616
matrix:
1717
include:
18-
- dockerfile: ./docker/3.9/Debian/Dockerfile
19-
mtag: py3.9-debian
20-
- dockerfile: ./docker/3.9/Ubuntu/Dockerfile
21-
mtag: py3.9-ubuntu
2218
- dockerfile: ./docker/3.10/Debian/Dockerfile
2319
mtag: py3.10-debian
2420
- dockerfile: ./docker/3.10/Ubuntu/Dockerfile
@@ -31,7 +27,11 @@ jobs:
3127
mtag: py3.12-debian
3228
- dockerfile: ./docker/3.12/Ubuntu/Dockerfile
3329
mtag: py3.12-ubuntu
34-
- dockerfile: ./docker/3.12/Ubuntu/Dockerfile
30+
- dockerfile: ./docker/3.13/Ubuntu/Dockerfile
31+
mtag: py3.13-debian
32+
- dockerfile: ./docker/3.13/Ubuntu/Dockerfile
33+
mtag: py3.13-ubuntu
34+
- dockerfile: ./docker/3.13/Ubuntu/Dockerfile
3535
mtag: latest
3636
permissions:
3737
contents: read

.github/workflows/mypy-type-check.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# This workflow will perform code type checking using mypy
22

33
name: mypy type checking
4+
permissions:
5+
contents: read
46

57
on:
68
push:
@@ -16,7 +18,7 @@ jobs:
1618

1719
strategy:
1820
matrix:
19-
python-version: ["3.9", "3.10", "3.11", "3.12"]
21+
python-version: ["3.10", "3.11", "3.12", "3.13"]
2022

2123
steps:
2224

@@ -33,17 +35,25 @@ jobs:
3335
sudo apt update
3436
sudo apt-get install -y libopenslide-dev openslide-tools libopenjp2-7 libopenjp2-tools
3537
python -m pip install --upgrade pip
38+
pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu
3639
pip install -r requirements/requirements_dev.txt
3740
3841
- name: Perform type checking
3942
run: |
4043
mypy --install-types --non-interactive --follow-imports=skip \
4144
tiatoolbox/__init__.py \
4245
tiatoolbox/__main__.py \
43-
tiatoolbox/typing.py \
46+
tiatoolbox/type_hints.py \
4447
tiatoolbox/tiatoolbox.py \
4548
tiatoolbox/utils \
4649
tiatoolbox/tools \
4750
tiatoolbox/data \
4851
tiatoolbox/annotation \
49-
tiatoolbox/cli/common.py
52+
tiatoolbox/cli/common.py \
53+
tiatoolbox/models/__init__.py \
54+
tiatoolbox/models/models_abc.py \
55+
tiatoolbox/models/architecture/__init__.py \
56+
tiatoolbox/models/architecture/utils.py \
57+
tiatoolbox/wsicore/__init__.py \
58+
tiatoolbox/wsicore/wsimeta.py \
59+
tiatoolbox/wsicore/metadata/

.github/workflows/pip-install.yml

Lines changed: 181 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,193 @@
1-
# This workflow will install the package as is on the github default branch using pip
2-
31
name: pip Install
42

53
on:
6-
push:
7-
paths: [ "requirements*.yml", "conda-env-create.yml", "requirements/requirement*.txt", "setup*py", "setup*cfg", "pytproject*toml", "MANIFEST*in"]
4+
push:
5+
paths:
6+
- "requirements*.yml"
7+
- "conda-env-create.yml"
8+
- "requirements/requirement*.txt"
9+
- "setup*py"
10+
- "setup*cfg"
11+
- "pyproject*toml"
12+
- "MANIFEST*in"
13+
- ".github/workflows/pip-install.yml"
14+
pull_request:
15+
paths:
16+
- "requirements*.yml"
17+
- "conda-env-create.yml"
18+
- "requirements/requirement*.txt"
19+
- "setup*py"
20+
- "setup*cfg"
21+
- "pyproject*toml"
22+
- "MANIFEST*in"
23+
- ".github/workflows/pip-install.yml"
24+
25+
permissions:
26+
contents: read
827

928
jobs:
1029
build:
1130
runs-on: ${{ matrix.os }}
1231
strategy:
13-
fail-fast: true
32+
fail-fast: false
1433
matrix:
15-
python-version: ["3.9", "3.10", "3.11", "3.12"]
34+
python-version: ["3.10", "3.11", "3.12", "3.13"]
1635
os: [ubuntu-24.04, windows-latest, macos-latest]
36+
37+
# Force UTF-8 everywhere (Windows is the one that really needs it)
38+
env:
39+
PYTHONUTF8: "1"
40+
PYTHONIOENCODING: "utf-8"
41+
1742
steps:
18-
- name: Set up Python ${{ matrix.python-version }}
19-
uses: actions/setup-python@v3
20-
with:
21-
python-version: ${{ matrix.python-version }}
22-
- name: 🐧 Install OpenSlide & OpenJPEG
23-
if: runner.os == 'Linux'
24-
run: |
25-
sudo apt update
26-
sudo apt-get install -y libopenslide-dev openslide-tools libopenjp2-7 libopenjp2-tools
27-
python -m pip install --upgrade pip
28-
- name: 🍎 Install OpenSlide & OpenJPEG
29-
if: runner.os == 'macOS'
30-
run: |
31-
brew install openslide openjpeg
32-
python -m pip install --upgrade pip
33-
- name: 🪟 Install OpenJPEG
34-
if: runner.os == 'Windows'
35-
run: |
36-
# Install OpenJPEG
37-
git clone https://github.com/uclouvain/openjpeg.git
38-
cd openjpeg
39-
mkdir build
40-
cd build
41-
cmake -G "MinGW Makefiles" .. -DCMAKE_BUILD_TYPE=Release
42-
ls
43-
make -j4
44-
make install
45-
make clean
46-
- name: 🪟 Install OpenSlide
47-
if: runner.os == 'Windows'
48-
run: |
49-
choco install wget --no-progress
50-
wget https://github.com/openslide/openslide-winbuild/releases/download/v20220811/openslide-win64-20220811.zip
51-
7z x openslide-win64-20220811.zip
52-
ls openslide-win64-20220811
53-
# Add to PATH
54-
echo "$(realpath ./openslide-win64-20220811/bin)" >> $GITHUB_PATH
55-
echo "$(realpath ./openslide-win64-20220811/lib)" >> $GITHUB_PATH
56-
# Install
57-
mkdir "C:\Program Files\openslide"
58-
Copy-Item -Path ".\openslide-win64-20220811\*" -Destination "C:\Program Files\openslide" -Recurse
59-
ls "C:/Program Files/openslide"
60-
- name: 🪟 Install SQLite Shell
61-
if: runner.os == 'Windows'
62-
run: choco install sqlite.shell --no-progress
63-
- name: SQLite Version Information
64-
run: |
65-
sqlite3 --version
66-
sqlite3 ":memory:" -list ".output stdout" "pragma compile_options" ".exit"
67-
- name: OpenSlide Version Information
68-
if: runner.os == 'Linux'
69-
run: openslide-quickhash1sum --version
70-
- name: OpenJPEG Version Information
71-
continue-on-error: true # This -h option has exit code 1 for some reason
72-
run: opj_dump -h
73-
- name: pip Install From GitHub Repo on Linux and macOS
74-
if: runner.os != 'Windows'
75-
run: python -m pip install git+https://github.com/TissueImageAnalytics/tiatoolbox@${GITHUB_REF_NAME}
76-
- name: pip Install From GitHub on Windows
77-
if: runner.os == 'Windows'
78-
run: python -m pip install git+https://github.com/TissueImageAnalytics/tiatoolbox@$env:GITHUB_REF_NAME
79-
- name: Test TIAToolbox Import
80-
shell: python
81-
run: |
82-
import os
83-
if hasattr(os, "add_dll_directory"):
84-
# Required for Python>=3.8 on Windows
85-
with os.add_dll_directory(r"D:\a\tiatoolbox\tiatoolbox\openslide-win64-20220811\bin"):
86-
import tiatoolbox
87-
else:
88-
os.environ["PATH"] = r"D:\a\tiatoolbox\tiatoolbox\openslide-win64-20220811\bin;"
43+
- name: Checkout
44+
uses: actions/checkout@v4
45+
46+
- name: Install Miniconda
47+
uses: conda-incubator/setup-miniconda@v3
48+
with:
49+
channels: conda-forge
50+
channel-priority: strict
51+
auto-update-conda: true
52+
53+
# -------------------------------
54+
# Create environment (Linux/macOS)
55+
# -------------------------------
56+
- name: Create conda environment (Linux/macOS)
57+
if: runner.os != 'Windows'
58+
shell: bash
59+
run: |
60+
source $CONDA/etc/profile.d/conda.sh
61+
conda create -y -n test-env python=${{ matrix.python-version }}
62+
conda activate test-env
63+
conda install -y openjpeg sqlite
64+
python -m pip install --upgrade pip setuptools wheel
65+
66+
# -------------------------------
67+
# Create environment (Windows)
68+
# -------------------------------
69+
- name: Create conda environment (Windows)
70+
if: runner.os == 'Windows'
71+
shell: pwsh
72+
run: |
73+
conda create -y -n test-env python=${{ matrix.python-version }}
74+
conda activate test-env
75+
conda install -y openjpeg sqlite
76+
python -m pip install --upgrade pip setuptools wheel
77+
78+
# -------------------------------
79+
# Verify SQLite
80+
# -------------------------------
81+
- name: Verify SQLite (Linux/macOS)
82+
if: runner.os != 'Windows'
83+
shell: bash
84+
run: |
85+
source $CONDA/etc/profile.d/conda.sh
86+
conda activate test-env
87+
sqlite3 --version
88+
sqlite3 ":memory:" -list ".output stdout" "pragma compile_options" ".exit"
89+
90+
- name: Verify SQLite (Windows)
91+
if: runner.os == 'Windows'
92+
shell: pwsh
93+
run: |
94+
conda activate test-env
95+
sqlite3 --version
96+
sqlite3 ":memory:" -list ".output stdout" "pragma compile_options" ".exit"
97+
98+
# -------------------------------
99+
# Verify OpenJPEG
100+
# -------------------------------
101+
- name: Verify OpenJPEG (Linux/macOS)
102+
if: runner.os != 'Windows'
103+
shell: bash
104+
run: |
105+
source $CONDA/etc/profile.d/conda.sh
106+
conda activate test-env
107+
opj_dump -h || true # -h exits with code 1 in some builds
108+
109+
- name: Verify OpenJPEG (Windows)
110+
if: runner.os == 'Windows'
111+
shell: pwsh
112+
run: |
113+
conda activate test-env
114+
opj_dump -h || true # -h exits with code 1 in some builds
115+
116+
# -------------------------------
117+
# Install PyTorch (CPU-only)
118+
# -------------------------------
119+
- name: Install CPU-only PyTorch (Linux/macOS)
120+
if: runner.os != 'Windows'
121+
shell: bash
122+
run: |
123+
source $CONDA/etc/profile.d/conda.sh
124+
conda activate test-env
125+
pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu
126+
127+
- name: Install CPU-only PyTorch (Windows)
128+
if: runner.os == 'Windows'
129+
shell: pwsh
130+
run: |
131+
conda activate test-env
132+
pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu
133+
134+
# -------------------------------
135+
# (Windows only) make console UTF-8 (extra safety)
136+
# -------------------------------
137+
- name: Ensure UTF-8 console (Windows)
138+
if: runner.os == 'Windows'
139+
shell: pwsh
140+
run: |
141+
chcp 65001 > $null
142+
[Console]::InputEncoding = [System.Text.Encoding]::UTF8
143+
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
144+
145+
# -------------------------------
146+
# Install tiatoolbox from this commit
147+
# -------------------------------
148+
- name: Install tiatoolbox (Linux/macOS)
149+
if: runner.os != 'Windows'
150+
shell: bash
151+
run: |
152+
source $CONDA/etc/profile.d/conda.sh
153+
conda activate test-env
154+
pip install git+https://github.com/TissueImageAnalytics/tiatoolbox@${GITHUB_SHA}
155+
156+
- name: Install tiatoolbox (Windows)
157+
if: runner.os == 'Windows'
158+
shell: pwsh
159+
run: |
160+
conda activate test-env
161+
pip install git+https://github.com/TissueImageAnalytics/tiatoolbox@$env:GITHUB_SHA
162+
163+
# -------------------------------
164+
# Test Imports
165+
# -------------------------------
166+
- name: Test Imports (Linux/macOS)
167+
if: runner.os != 'Windows'
168+
shell: bash
169+
run: |
170+
source $CONDA/etc/profile.d/conda.sh
171+
conda activate test-env
172+
python - << 'EOF'
173+
import tiatoolbox
174+
print("tiatoolbox:", tiatoolbox.__version__)
175+
import openslide
176+
print("openslide:", openslide.__version__)
177+
import torch
178+
print("torch:", torch.__version__)
179+
EOF
180+
181+
- name: Test Imports (Windows)
182+
if: runner.os == 'Windows'
183+
shell: pwsh
184+
run: |
185+
conda activate test-env
186+
@"
89187
import tiatoolbox
188+
print("tiatoolbox:", tiatoolbox.__version__)
189+
import openslide
190+
print("openslide:", openslide.__version__)
191+
import torch
192+
print("torch:", torch.__version__)
193+
"@ | python -

0 commit comments

Comments
 (0)