Skip to content

Commit

Permalink
🔖 Release 1.5.0 (#757)
Browse files Browse the repository at this point in the history
## 1.5.0 (2023-12-15)

### Major Updates and Feature Improvements

- Adds the bokeh visualization tool. #684
  - The tool allows a user to launch a server on their machine to visualise whole slide images, overlay the results of deep learning algorithms or to select a patch from whole slide image and run TIAToolbox deep learning engines.
  - This tool powers the TIA demos server. For details please see https://tiademos.dcs.warwick.ac.uk/.
- Extends Annotation to Support Init from WKB #639
- Adds `IOConfig` for NuClick in `pretrained_model.yaml` #709
- Adds functions to save the TIAToolbox Engine outputs to Zarr and AnnotationStore files. #724
- Adds Support for QuPath Annotation Imports #721

### Changes to API

- Adds `model.to(device)` and `model.load_model_from_file()` functionality to make it compatible with PyTorch API. #733
- Replaces `pretrained` with `weights` to make the engines compatible with the new PyTorch API. #621
- Adds support for high-level imports for various utility functions and classes such as `WSIReader`, `PatchPredictor` and `imread` #606, #607,
- Adds `tiatoolbox.typing` for type hints. #619
- Fixes incorrect file size saved by `save_tiles`, issue with certain WSIs raised by @TomastpPereira
- TissueMasker transform now returns mask instead of a list. #748
  - Fixes #732

### Bug Fixes and Other Changes

- Fixes `pixman` incompability error on Colab #601
- Removes `shapely.speedups`. The module no longer has any affect in Shapely >=2.0. #622
- Fixes errors in the slidegraph example notebook #608
- Fixes bugs in WSI Registration #645, #670, #693
- Fixes the situation where PatchExtractor.get_coords() can return patch coords which lie fully outside the bounds of a slide. #712
  - Fixes #710
- Fixes #738 raised by @xiachenrui

### Development related changes

- Replaces `flake8` and `isort` with `ruff` #625, #666
- Adds `mypy` checks to `root` and `utils` package. This will be rolled out in phases to other modules. #723
- Adds a module to detect file types using magic number/signatures #616
- Uses `poetry` for version updates instead of `bump2version`. #638
- Removes `setup.cfg` and uses `pyproject.toml` for project configurations.
- Reduces runtime for some unit tests e.g., #627, #630, #631, #629
- Reuses models and datasets in tests on GitHub actions by utilising cache #641, #644
- Set up parallel tests locally #671

**Full Changelog:** v1.4.0...v1.5.0

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: mostafajahanifar <[email protected]>
Co-authored-by: John Pocock <[email protected]>
Co-authored-by: DavidBAEpstein <[email protected]>
Co-authored-by: David Epstein <[email protected]>
Co-authored-by: Ruqayya Awan <[email protected]>
Co-authored-by: Mark Eastwood <[email protected]>
Co-authored-by: adamshephard <[email protected]>
Co-authored-by: adamshephard <[email protected]>
Co-authored-by: Abdol <[email protected]>
Co-authored-by: Jiaqi-Lv <[email protected]>
Co-authored-by: Abishek <[email protected]>
Co-authored-by: Dmitrii Blaginin <[email protected]>
  • Loading branch information
14 people authored Dec 15, 2023
1 parent 51f504b commit bba59ba
Show file tree
Hide file tree
Showing 171 changed files with 37,182 additions and 25,466 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ env:
REGISTRY: ghcr.io
IMAGE_NAME: TissueImageAnalytics/tiatoolbox
image: ghcr.io/tissueimageanalytics/tiatoolbox
TOOLBOX_VER: 1.4.1
TOOLBOX_VER: 1.5.0

jobs:
build-and-push-image:
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/mypy-type-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# This workflow will perform code type checking using mypy

name: mypy type checking

on:
push:
branches: [ develop, pre-release, master, main ]
pull_request:
branches: [ develop, pre-release, master, main ]

jobs:

build:

runs-on: ubuntu-22.04

strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]

steps:

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}

- name: Checkout repository
uses: actions/checkout@v3

- name: Setup mypy
run: |
pip install mypy
- name: Perform type checking
run: |
mypy --install-types --non-interactive --follow-imports=skip \
tiatoolbox/__init__.py \
tiatoolbox/__main__.py \
tiatoolbox/typing.py \
tiatoolbox/tiatoolbox.py \
tiatoolbox/utils/*.py
13 changes: 8 additions & 5 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,13 @@ jobs:
sudo apt update
sudo apt-get install -y libopenslide-dev openslide-tools libopenjp2-7 libopenjp2-tools
python -m pip install --upgrade pip
python -m pip install flake8 pytest pytest-cov pytest-runner
python -m pip install ruff==0.0.286 pytest pytest-cov pytest-runner
pip install -r requirements/requirements.txt
- name: Cache tiatoolbox static assets
uses: actions/cache@v3
with:
key: tiatoolbox-home-static
path: ~/.tiatoolbox
- name: Print Version Information
run: |
echo "---SQlite---"
Expand All @@ -46,12 +51,10 @@ jobs:
python -c "import sqlite3; print('SQLite %s' % sqlite3.sqlite_version)"
python -c "import numpy; print('Numpy %s' % numpy.__version__)"
python -c "import openslide; print('OpenSlide %s' % openslide.__version__)"
- name: Lint with flake8
- name: Lint with ruff
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
ruff check .
- name: Test with pytest
run: |
pytest --basetemp={envtmpdir} \
Expand Down
45 changes: 10 additions & 35 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ repos:
require_serial: true
language: system
stages: [push]
- id: notebook-check-ast
name: check notebook ast
entry: python pre-commit/notebook_check_ast.py
types_or: [jupyter]
language: python
- id: notebook-markdown-format
name: notebook markdown format
entry: python pre-commit/notebook_markdown_format.py
Expand All @@ -28,15 +23,15 @@ repos:
- mdformat-black
- mdformat-myst
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.16
rev: 0.7.17
hooks:
- id: mdformat
# Optionally add plugins
additional_dependencies:
- mdformat-gfm # GitHub flavoured markdown
- mdformat-black # Black formatting for python verbatim blocks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-ast # Simply checks whether the files parse as valid Python.
- id: fix-byte-order-marker # Removes utf-8 byte order marker.
Expand All @@ -52,49 +47,29 @@ repos:
- id: mixed-line-ending # Replaces or checks mixed line endings.
- id: requirements-txt-fixer # Sorts entries in requirements.txt.
- id: trailing-whitespace # Trims trailing whitespace.
exclude: 'setup.cfg'
- id: file-contents-sorter # Sorts the lines in specified files (defaults to alphabetical).
files: whitelist.txt
- id: debug-statements # Checks for debugger imports and py37+ `breakpoint()` calls in python source.
- id: pretty-format-json # Sets a standard for formatting JSON files.
exclude_types: [jupyter]
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks:
- id: rst-backticks # Detect common mistake of using single backticks when writing rst.
- id: rst-directive-colons # Detect mistake of rst directive not ending with double colon.
- id: rst-inline-touching-normal # Detect mistake of inline code touching normal text in rst.
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 23.3.0 # Replace with any tag/version: https://github.com/psf/black/tags
rev: 23.11.0 # Replace with any tag/version: https://github.com/psf/black/tags
hooks:
- id: black
language_version: python3 # Should be a command that runs python3.+
additional_dependencies: ['click==8.0.4'] # Currently >8.0.4 breaks black
- id: black-jupyter
language: python
- repo: https://github.com/PyCQA/flake8
rev: 5.0.4
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.1.7
hooks:
- id: flake8
additional_dependencies: [
flake8-bugbear, # Detect potential bugs
flake8-builtins, # Check for built-ins being used as variables
flake8-cognitive-complexity, # Check max function complexity
flake8-comprehensions, # Suggestions for better list/set/dict comprehensions
flake8-eradicate, # Find dead/commented out code
flake8-expression-complexity, # Check max expression complexity
flake8-fixme, # Check for FIXME, TODO, and XXX left in comments
flake8-isort, # Check import ordering
flake8-logging-format, # Validate (lack of) logging format strings
flake8-mutable, # Check for mutable default arguments
flake8-pie, # Misc. linting rules
flake8-pytest-style, # Check against pytest style guide
flake8-return, # Check return statements
flake8-simplify, # Suggestions to simplify code
flake8-spellcheck, # Spelling checker
flake8-use-fstring, # Encourages use of f-strings vs old style
pep8-naming, # Check PEP8 class naming
]
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
types_or: [python, pyi, jupyter]
10 changes: 7 additions & 3 deletions AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,19 @@
- TIA Centre led by Nasir Rajpoot <[email protected]>
- Shan E Ahmed Raza \<@shaneahmed>
- John Pocock \<@John-P>
- Mark Eastwood \<@measty>
- Simon Graham \<@simongraham>
- Dang Vu \<@vqdang>
- Mostafa Jahanifar \<@mostafajahanifar>
- David Epstein \<@DavidBAEpstein>
- Mark Eastwood \<@measty>
- Srijay Deshpande \<@Srijay-lab>
- Ruqayya Awan \<@ruqayya>
- Adam Shephard \<@adamshephard>
- Ruqayya Awan \<@ruqayya>
- Abdullah Alsalemi \<@Abdol>
- Dmitrii Blaginin \<@blaginin>
- Srijay Deshpande \<@Srijay-lab>
- Jiaqi Lv\<@Jiaqi-Lv>
- George Hadjigeorgiou \<@ghadjigeorghiou>
- Abishekraj Vinayagar Gnanasambandam \<@AbishekRajVG>
- Wenqi Lu \<@wenqi006>
- Saad Bashir \<@rajasaad>

Expand Down
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -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.4.1 # TIAToolbox version
version: 1.5.0 # TIAToolbox version
doi: 10.5281/zenodo.5802442
date-released: 2022-10-20
url: "https://github.com/TissueImageAnalytics/tiatoolbox"
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ A reminder for the maintainers on how to deploy.
Make sure all your changes are committed (including an entry in HISTORY.rst).
Then run::

$ bump2version patch # possible: major / minor / patch
$ poetry version patch # use: "poetry version --help" for other options
$ git push
$ git push --tags

Expand Down
45 changes: 45 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,50 @@
# History

## 1.5.0 (2023-12-15)

### Major Updates and Feature Improvements

- Adds the bokeh visualization tool. #684
- The tool allows a user to launch a server on their machine to visualise whole slide images, overlay the results of deep learning algorithms or to select a patch from whole slide image and run TIAToolbox deep learning engines.
- This tool powers the TIA demos server. For details please see https://tiademos.dcs.warwick.ac.uk/.
- Extends Annotation to Support Init from WKB #639
- Adds `IOConfig` for NuClick in `pretrained_model.yaml` #709
- Adds functions to save the TIAToolbox Engine outputs to Zarr and AnnotationStore files. #724
- Adds Support for QuPath Annotation Imports #721

### Changes to API

- Adds `model.to(device)` and `model.load_model_from_file()` functionality to make it compatible with PyTorch API. #733
- Replaces `pretrained` with `weights` to make the engines compatible with the new PyTorch API. #621
- Adds support for high-level imports for various utility functions and classes such as `WSIReader`, `PatchPredictor` and `imread` #606, #607,
- Adds `tiatoolbox.typing` for type hints. #619
- Fixes incorrect file size saved by `save_tiles`, issue with certain WSIs raised by @TomastpPereira
- TissueMasker transform now returns mask instead of a list. #748
- Fixes #732

### Bug Fixes and Other Changes

- Fixes `pixman` incompability error on Colab #601
- Removes `shapely.speedups`. The module no longer has any affect in Shapely >=2.0. #622
- Fixes errors in the slidegraph example notebook #608
- Fixes bugs in WSI Registration #645, #670, #693
- Fixes the situation where PatchExtractor.get_coords() can return patch coords which lie fully outside the bounds of a slide. #712
- Fixes #710
- Fixes #738 raised by @xiachenrui

### Development related changes

- Replaces `flake8` and `isort` with `ruff` #625, #666
- Adds `mypy` checks to `root` and `utils` package. This will be rolled out in phases to other modules. #723
- Adds a module to detect file types using magic number/signatures #616
- Uses `poetry` for version updates instead of `bump2version`. #638
- Removes `setup.cfg` and uses `pyproject.toml` for project configurations.
- Reduces runtime for some unit tests e.g., #627, #630, #631, #629
- Reuses models and datasets in tests on GitHub actions by utilising cache #641, #644
- Set up parallel tests locally #671

**Full Changelog:** https://github.com/TissueImageAnalytics/tiatoolbox/compare/v1.4.0...v1.5.0

## 1.4.1 (2023-07-25)

### Bug Fixes and Other Changes
Expand Down
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ include requirements/requirements.txt
include make.bat
include Makefile
include conf.py
include tiatoolbox/visualization/bokeh_app/templates/index.html

recursive-include tests *
recursive-include docs
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ lint: ## check style with flake8
flake8 tiatoolbox tests

test: ## run tests quickly with the default Python
pytest
pytest -n auto

coverage: ## check code coverage quickly with the default Python
pytest --cov=tiatoolbox --cov-report=term --cov-report=html --cov-report=xml
Expand Down
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,29 @@
<a href="https://github.com/TissueImageAnalytics/tiatoolbox/actions/workflows/pip-install.yml">
<img src="https://img.shields.io/pypi/pyversions/tiatoolbox.svg" alt="Supported Python versions"/>
</a>
<a href="https://github.com/psf/black">
<img src="https://img.shields.io/badge/code%20style-black-000000.svg" alt="Code Style black"/>
</a>
<a href="https://github.com/TissueImageAnalytics/tiatoolbox/actions/workflows/python-package.yml">
<br>
<a href="https://github.com/TissueImageAnalytics/tiatoolbox/actions/workflows/python-package.yml">
<img src="https://github.com/TissueImageAnalytics/tiatoolbox/actions/workflows/python-package.yml/badge.svg" alt="GitHub Workflow passing"/>
</a>
<a href="https://codecov.io/gh/TissueImageAnalytics/tiatoolbox">
<img src="https://codecov.io/gh/TissueImageAnalytics/tiatoolbox/branch/master/graph/badge.svg?token=7UZEMacQHm" alt="Code Coverage"/>
</a>
<br>
<br>
<a href="https://github.com/psf/black">
<img src="https://img.shields.io/badge/code%20style-black-000000.svg" alt="Code Style black"/>
</a>
<a href="https://github.com/astral-sh/ruff">
<img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json" alt="Code Style black"/>
</a>
<br><br>
<a href="#cite-this-repository"><img src="https://img.shields.io/badge/Cite%20this%20repository-BibTeX-brightgreen" alt="DOI"></a> <a href="https://doi.org/10.1038/s43856-022-00186-5"><img src="https://img.shields.io/badge/DOI-10.1038%2Fs43856--022--00186--5-blue" alt="DOI"></a>
<br>

## Getting Started

TIAToolbox is a computational pathology toolbox developed by TIA Centre that provides an end-to-end API for pathology image analysis using best practices. It is based on **[PyTorch](https://pytorch.org/)**, a popular deep learning framework that enables efficient and flexible implementation of state-of-the-art algorithms. TIAToolbox supports many features through a command-line interface and can integrate with standard PyTorch modules. It also offers tools for data loading, pre-processing, model inference, post-processing, and visualization. Whether you are a computational, biomedical, or clinical researcher, TIAToolbox can help you get started in digital pathology with minimal effort.

### All Users

This package is for those interested in digital pathology: including graduate students, medical staff, members of the TIA Centre and of PathLAKE, and anyone, anywhere, who may find it useful. We will continue to improve this package, taking account of developments in pathology, microscopy, computing and related disciplines. Please send comments and criticisms to **[[email protected]](mailto:[email protected])**.
Expand Down
Loading

0 comments on commit bba59ba

Please sign in to comment.