diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index d3cfe4601..09ef5d1e6 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -6,7 +6,7 @@ env: REGISTRY: ghcr.io IMAGE_NAME: TissueImageAnalytics/tiatoolbox image: ghcr.io/tissueimageanalytics/tiatoolbox - TOOLBOX_VER: 1.6.0 + TOOLBOX_VER: 2.0.0 jobs: build-and-push-image: diff --git a/.github/workflows/pip-install.yml b/.github/workflows/pip-install.yml index d44ba013d..03ab1b823 100644 --- a/.github/workflows/pip-install.yml +++ b/.github/workflows/pip-install.yml @@ -34,142 +34,160 @@ jobs: python-version: ["3.10", "3.11", "3.12", "3.13"] os: [ubuntu-24.04, windows-latest, macos-latest] + # Force UTF-8 everywhere (Windows is the one that really needs it) + env: + PYTHONUTF8: "1" + PYTHONIOENCODING: "utf-8" + steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Install Miniconda - uses: conda-incubator/setup-miniconda@v3 - with: - channels: conda-forge - channel-priority: strict - auto-update-conda: true - - # ------------------------------- - # Create environment (Linux/macOS) - # ------------------------------- - - name: Create conda environment (Linux/macOS) - if: runner.os != 'Windows' - shell: bash - run: | - source $CONDA/etc/profile.d/conda.sh - conda create -y -n test-env python=${{ matrix.python-version }} - conda activate test-env - conda install -y openjpeg sqlite - - # ------------------------------- - # Create environment (Windows) - # ------------------------------- - - name: Create conda environment (Windows) - if: runner.os == 'Windows' - shell: pwsh - run: | - conda create -y -n test-env python=${{ matrix.python-version }} - conda activate test-env - conda install -y openjpeg sqlite - - # ------------------------------- - # Verify SQLite - # ------------------------------- - - name: Verify SQLite (Linux/macOS) - if: runner.os != 'Windows' - shell: bash - run: | - source $CONDA/etc/profile.d/conda.sh - conda activate test-env - sqlite3 --version - sqlite3 ":memory:" -list ".output stdout" "pragma compile_options" ".exit" - - - name: Verify SQLite (Windows) - if: runner.os == 'Windows' - shell: pwsh - run: | - conda activate test-env - sqlite3 --version - sqlite3 ":memory:" -list ".output stdout" "pragma compile_options" ".exit" - - # ------------------------------- - # Verify OpenJPEG - # ------------------------------- - - name: Verify OpenJPEG (Linux/macOS) - if: runner.os != 'Windows' - shell: bash - run: | - source $CONDA/etc/profile.d/conda.sh - conda activate test-env - opj_dump -h || true # This -h option exits with code 1 for some reason - - - name: Verify OpenJPEG (Windows) - if: runner.os == 'Windows' - shell: pwsh - run: | - conda activate test-env - opj_dump -h || true # This -h option exits with code 1 for some reason - - # ------------------------------- - # Install PyTorch - # ------------------------------- - - name: Install CPU-only PyTorch (Linux/macOS) - if: runner.os != 'Windows' - shell: bash - run: | - source $CONDA/etc/profile.d/conda.sh - conda activate test-env - pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu - - - name: Install CPU-only PyTorch (Windows) - if: runner.os == 'Windows' - shell: pwsh - run: | - conda activate test-env - pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu - - # ------------------------------- - # Install tiatoolbox - # ------------------------------- - - name: Install tiatoolbox (Linux/macOS) - if: runner.os != 'Windows' - shell: bash - run: | - source $CONDA/etc/profile.d/conda.sh - conda activate test-env - pip install git+https://github.com/TissueImageAnalytics/tiatoolbox@${GITHUB_SHA} - - - name: Install tiatoolbox (Windows) - if: runner.os == 'Windows' - shell: pwsh - run: | - conda activate test-env - pip install git+https://github.com/TissueImageAnalytics/tiatoolbox@$env:GITHUB_SHA - - # ------------------------------- - # Test Imports - # ------------------------------- - - name: Test Imports (Linux/macOS) - if: runner.os != 'Windows' - shell: bash - run: | - source $CONDA/etc/profile.d/conda.sh - conda activate test-env - python - << 'EOF' - import tiatoolbox - print("tiatoolbox:", tiatoolbox.__version__) - import openslide - print("openslide:", openslide.__version__) - import torch - print("torch:", torch.__version__) - EOF - - - name: Test Imports (Windows) - if: runner.os == 'Windows' - shell: pwsh - run: | - conda activate test-env - @" - import tiatoolbox - print("tiatoolbox:", tiatoolbox.__version__) - import openslide - print("openslide:", openslide.__version__) - import torch - print("torch:", torch.__version__) - "@ | python - + - name: Checkout + uses: actions/checkout@v4 + + - name: Install Miniconda + uses: conda-incubator/setup-miniconda@v3 + with: + channels: conda-forge + channel-priority: strict + auto-update-conda: true + + # ------------------------------- + # Create environment (Linux/macOS) + # ------------------------------- + - name: Create conda environment (Linux/macOS) + if: runner.os != 'Windows' + shell: bash + run: | + source $CONDA/etc/profile.d/conda.sh + conda create -y -n test-env python=${{ matrix.python-version }} + conda activate test-env + conda install -y openjpeg sqlite + python -m pip install --upgrade pip setuptools wheel + + # ------------------------------- + # Create environment (Windows) + # ------------------------------- + - name: Create conda environment (Windows) + if: runner.os == 'Windows' + shell: pwsh + run: | + conda create -y -n test-env python=${{ matrix.python-version }} + conda activate test-env + conda install -y openjpeg sqlite + python -m pip install --upgrade pip setuptools wheel + + # ------------------------------- + # Verify SQLite + # ------------------------------- + - name: Verify SQLite (Linux/macOS) + if: runner.os != 'Windows' + shell: bash + run: | + source $CONDA/etc/profile.d/conda.sh + conda activate test-env + sqlite3 --version + sqlite3 ":memory:" -list ".output stdout" "pragma compile_options" ".exit" + + - name: Verify SQLite (Windows) + if: runner.os == 'Windows' + shell: pwsh + run: | + conda activate test-env + sqlite3 --version + sqlite3 ":memory:" -list ".output stdout" "pragma compile_options" ".exit" + + # ------------------------------- + # Verify OpenJPEG + # ------------------------------- + - name: Verify OpenJPEG (Linux/macOS) + if: runner.os != 'Windows' + shell: bash + run: | + source $CONDA/etc/profile.d/conda.sh + conda activate test-env + opj_dump -h || true # -h exits with code 1 in some builds + + - name: Verify OpenJPEG (Windows) + if: runner.os == 'Windows' + shell: pwsh + run: | + conda activate test-env + opj_dump -h || true # -h exits with code 1 in some builds + + # ------------------------------- + # Install PyTorch (CPU-only) + # ------------------------------- + - name: Install CPU-only PyTorch (Linux/macOS) + if: runner.os != 'Windows' + shell: bash + run: | + source $CONDA/etc/profile.d/conda.sh + conda activate test-env + pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu + + - name: Install CPU-only PyTorch (Windows) + if: runner.os == 'Windows' + shell: pwsh + run: | + conda activate test-env + pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu + + # ------------------------------- + # (Windows only) make console UTF-8 (extra safety) + # ------------------------------- + - name: Ensure UTF-8 console (Windows) + if: runner.os == 'Windows' + shell: pwsh + run: | + chcp 65001 > $null + [Console]::InputEncoding = [System.Text.Encoding]::UTF8 + [Console]::OutputEncoding = [System.Text.Encoding]::UTF8 + + # ------------------------------- + # Install tiatoolbox from this commit + # ------------------------------- + - name: Install tiatoolbox (Linux/macOS) + if: runner.os != 'Windows' + shell: bash + run: | + source $CONDA/etc/profile.d/conda.sh + conda activate test-env + pip install git+https://github.com/TissueImageAnalytics/tiatoolbox@${GITHUB_SHA} + + - name: Install tiatoolbox (Windows) + if: runner.os == 'Windows' + shell: pwsh + run: | + conda activate test-env + pip install git+https://github.com/TissueImageAnalytics/tiatoolbox@$env:GITHUB_SHA + + # ------------------------------- + # Test Imports + # ------------------------------- + - name: Test Imports (Linux/macOS) + if: runner.os != 'Windows' + shell: bash + run: | + source $CONDA/etc/profile.d/conda.sh + conda activate test-env + python - << 'EOF' + import tiatoolbox + print("tiatoolbox:", tiatoolbox.__version__) + import openslide + print("openslide:", openslide.__version__) + import torch + print("torch:", torch.__version__) + EOF + + - name: Test Imports (Windows) + if: runner.os == 'Windows' + shell: pwsh + run: | + conda activate test-env + @" + import tiatoolbox + print("tiatoolbox:", tiatoolbox.__version__) + import openslide + print("openslide:", openslide.__version__) + import torch + print("torch:", torch.__version__) + "@ | python - diff --git a/AUTHORS.md b/AUTHORS.md index bd87fcb25..2b1d3b965 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -2,28 +2,34 @@ ## Development Lead -- TIA Centre led by Nasir Rajpoot +- Tissue Image Analytics Centre - Shan E Ahmed Raza \<@shaneahmed> - John Pocock \<@John-P> - Mark Eastwood \<@measty> +- Jiaqi Lv \<@Jiaqi-Lv> +- Mostafa Jahanifar \<@mostafajahanifar> +- Adam Shephard \<@adamshephard> - Simon Graham \<@simongraham> - Dang Vu \<@vqdang> -- Mostafa Jahanifar \<@mostafajahanifar> - David Epstein \<@DavidBAEpstein> -- Adam Shephard \<@adamshephard> - Abdullah Alsalemi \<@Abdol> - Ruqayya Awan \<@ruqayya> -- Jiaqi Lv \<@Jiaqi-Lv> - Dmitrii Blaginin \<@blaginin> +- Yijie Zhu \<@YijieZhu15> - Srijay Deshpande \<@Srijay-lab> - George Hadjigeorgiou \<@ghadjigeorghiou> +- Gozde Gunesli \<@gozdeg> - Abishekraj Vinayagar Gnanasambandam \<@AbishekRajVG> - Wenqi Lu \<@wenqi006> - Saad Bashir \<@rajasaad> +- Behnaz Elhaminia \<@behnazelhaminia> ## Contributors +- Nasir Rajpoot \<@nmrajpoot> +- Fayyaz Minhas \<@foxtrotmike> - George Batchkala \<@GeorgeBatch> +- Aleksandar Acic \<@aacic> - Rob Jewsbury \<@R-J96> - Mohsin Bilal \<@mbhahsmi> -- Fayyaz Minhas \<@foxtrotmike> +- Musraf Basheer \ diff --git a/CITATION.cff b/CITATION.cff index b3ebd06ef..e5e745f04 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -44,7 +44,7 @@ authors: given-names: "Shan E Ahmed" orcid: "https://orcid.org/0000-0002-1097-1738" title: "TIAToolbox as an end-to-end library for advanced tissue image analytics" -version: 1.6.0 # TIAToolbox version +version: 2.0.0 # TIAToolbox version doi: 10.5281/zenodo.5802442 date-released: 2022-10-20 url: "https://github.com/TissueImageAnalytics/tiatoolbox" diff --git a/HISTORY.md b/HISTORY.md index 51fe651c7..46a6d4350 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,5 +1,207 @@ # History +## 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. + +### 🖼️ WSI Registration Visualization in TIAViz + +TIAViz now supports **interactive WSI registration visualisation**, allowing users to compare aligned slides in two modes: + +- **Side‑by‑side view** — view fixed and moving WSIs next to each other for direct comparison +- **Overlay mode** — blend registered WSIs with adjustable transparency for visual inspection of alignment quality + +This feature enables intuitive, high‑resolution exploration of slide registration results directly within TIAViz. + +### 🧩 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:** https://github.com/TissueImageAnalytics/tiatoolbox/compare/v1.6.0...v2.0.0 + +______________________________________________________________________ + ## TIAToolbox v1.6.0 (2024-12-12) ### Major Updates and Feature Improvements diff --git a/LICENSE b/LICENSE index 2188d02a9..f19add6f5 100644 --- a/LICENSE +++ b/LICENSE @@ -3,7 +3,7 @@ BSD 3-Clause License Model weights are provided under a different license. For details, please see https://tia-toolbox.readthedocs.io/en/latest/pretrained.html -Copyright (c) 2023, Tissue Image Analytics (TIA) Centre +Copyright (c) 2026, Tissue Image Analytics (TIA) Centre All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/docs/conf.py b/docs/conf.py index 143a9fe94..4d34f4ffd 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -88,7 +88,7 @@ # General information about the project. project = "TIA Toolbox" -copyright = "2025, TIA Lab" # noqa: A001 +copyright = "2026, TIA Lab" # noqa: A001 author = "TIA Lab" # The version info for the project you're documenting, acts as replacement diff --git a/pyproject.toml b/pyproject.toml index df11c053f..c8deca9d3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,7 +25,7 @@ [tool.poetry] name = "TIA Centre" -version = "1.6.0" +version = "2.0.0" description = "test" authors = ["TIA Centre "] diff --git a/setup.py b/setup.py index e75877ce0..6e0663c09 100644 --- a/setup.py +++ b/setup.py @@ -63,6 +63,6 @@ test_suite="tests", tests_require=test_requirements, url="https://github.com/TissueImageAnalytics/tiatoolbox", - version="1.6.0", + version="2.0.0", zip_safe=False, ) diff --git a/tiatoolbox/__init__.py b/tiatoolbox/__init__.py index d40f4a758..64774d573 100644 --- a/tiatoolbox/__init__.py +++ b/tiatoolbox/__init__.py @@ -16,7 +16,7 @@ __author__ = """TIA Centre""" __email__ = "TIA@warwick.ac.uk" -__version__ = "1.6.0" +__version__ = "2.0.0" # This will set the tiatoolbox external data # default to be the user home folder, should work on both Window and Unix/Linux