Skip to content

Commit 1c11b1e

Browse files
authored
REL: Release 1.3.0 (#496)
### Major Updates and Feature Improvements - Adds an AnnotationTileGenerator and AnnotationRenderer which allows serving of tiles rendered directly from an annotation store. - Adds [DFBR](https://arxiv.org/abs/2202.09971) registration model and jupyter notebook example - Adds DICE metric - Adds [SCCNN](https://doi.org/10.1109/tmi.2016.2525803) architecture. \[[read the docs](https://tia-toolbox.readthedocs.io/en/develop/_autosummary/tiatoolbox.models.architecture.sccnn.SCCNN.html)\] - Adds [MapDe](https://arxiv.org/abs/1806.06970) architecture. \[[read the docs](https://tia-toolbox.readthedocs.io/en/develop/_autosummary/tiatoolbox.models.architecture.mapde.MapDe.html)\] - Adds support for reading MPP metadata from NGFF v0.4 - Adds enhancements to tiatoolbox.annotation.storage that are useful when using an AnnotationStore for visualization purposes. ### Changes to API - None ### Bug Fixes and Other Changes - Fixes colorbar_params #410 - Fixes Jupyter notebooks for better read the docs rendering - Fixes typos, metadata and links - Fixes nucleus_segmentor_engine for boundary artefacts - Fixes the colorbar cropping in tests - Adds citation in README.md and CITATION.cff to Nature Communications Medicine paper - Fixes a bug #452 raised by @rogertrullo where only the numerator of the TIFF resolution tags was being read. - Fixes HoVer-Net+ post-processing to be inline with original work. - Fixes a bug where an exception would be raised if the OME XML is missing objective power. ### Development related changes - Uses Furo theme for readthedocs - Replaces nbgallery and nbsphinx with myst-nb for jupyter notebook rendering - Uses myst for markdown parsing - Uses requirements.txt to define dependencies for requirements consistency - Adds notebook AST pre-commit hook - Adds check to validate python examples in the code - Adds check to resolve imports - Fixes an error in a docstring which triggered the failing test. - Adds pre-commit hooks to format markdown and notebook markdown - Adds pip install workflow to resolve dependencies when requirements file is updated - Improves TIAToolbox import using LazyLoader Signed-off-by: Shan E Ahmed Raza <13048456+shaneahmed@users.noreply.github.com>
1 parent 9b3d3b1 commit 1c11b1e

File tree

126 files changed

+23532
-13028
lines changed

Some content is hidden

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

126 files changed

+23532
-13028
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
* TIA Toolbox version:
2-
* Python version:
3-
* Operating System:
1+
- TIA Toolbox version:
2+
- Python version:
3+
- Operating System:
44

55
### Description
66

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

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ name: Solve Conda Environment
44

55
on:
66
push:
7-
paths: [ "requirements*.yml", "conda-env-create.yml" ]
7+
paths: [ "requirements*.yml", "conda-env-create.yml", "requirement*.txt"]
88
pull_request:
9-
paths: [ "requirements*.yml", "conda-env-create.yml" ]
9+
paths: [ "requirements*.yml", "conda-env-create.yml", "requirement*.txt"]
1010
schedule: # Run on the 1st of every month at midnight
1111
- cron: "0 0 1 * *"
1212

@@ -16,15 +16,30 @@ jobs:
1616
fail-fast: true
1717
matrix:
1818
os: [ubuntu-latest, windows-latest]
19+
kind: ["dev", "prod"]
1920
include:
2021
- os: ubuntu-latest
22+
kind: prod
2123
requirements: requirements.conda.yml
24+
- os: ubuntu-latest
25+
kind: dev
26+
requirements: requirements.dev.conda.yml
2227
- os: windows-latest
28+
kind: prod
2329
requirements: requirements.win64.conda.yml
30+
- os: windows-latest
31+
kind: dev
32+
requirements: requirements.win64.dev.conda.yml
2433
runs-on: ${{ matrix.os }}
2534
timeout-minutes: 20
2635
steps:
2736
- uses: actions/checkout@v2
37+
- name: Copy requirements files
38+
shell: bash
39+
run: |
40+
cp ./requirements*.txt /tmp/
41+
mkdir /tmp/docs/
42+
cp ./docs/requirements*.txt /tmp/docs/
2843
- uses: mamba-org/provision-with-micromamba@main
2944
with:
3045
environment-name: tiatoolbox

.github/workflows/pip-install.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# This workflow will install the package as is on the github default branch using pip
2+
3+
name: pip Install
4+
5+
on:
6+
push:
7+
paths: [ "requirements*.yml", "conda-env-create.yml", "requirement*.txt", "setup*py", "setup*cfg", "pytproject*toml", "MANIFEST*in"]
8+
9+
jobs:
10+
build:
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
fail-fast: true
14+
matrix:
15+
python-version: ["3.7", "3.8", "3.9", "3.10"]
16+
os: [ubuntu-22.04, windows-latest, macos-latest]
17+
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;"
89+
import tiatoolbox

.pre-commit-config.yaml

Lines changed: 34 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,36 @@
11
repos:
2+
- repo: local
3+
hooks:
4+
- id: pytest-changed-files
5+
name: pytest-changed-files
6+
entry: pytest
7+
files: tests/.*\btest_\w*.py
8+
require_serial: true
9+
language: system
10+
stages: [push]
11+
- id: notebook-check-ast
12+
name: check notebook ast
13+
entry: python pre-commit/notebook_check_ast.py
14+
types_or: [jupyter]
15+
language: python
16+
- id: notebook-markdown-format
17+
name: notebook markdown format
18+
entry: python pre-commit/notebook_markdown_format.py
19+
require_serial: true
20+
types_or: [jupyter]
21+
language: python
22+
additional_dependencies:
23+
- mdformat
24+
- mdformat-black
25+
- mdformat-myst
26+
- repo: https://github.com/executablebooks/mdformat
27+
rev: 0.7.16
28+
hooks:
29+
- id: mdformat
30+
# Optionally add plugins
31+
additional_dependencies:
32+
- mdformat-gfm # GitHub flavoured markdown
33+
- mdformat-black # Black formatting for python verbatim blocks
234
- repo: https://github.com/pre-commit/pre-commit-hooks
335
rev: v4.3.0
436
hooks:
@@ -32,15 +64,15 @@ repos:
3264
hooks:
3365
- id: isort
3466
- repo: https://github.com/psf/black
35-
rev: 22.6.0 # Replace with any tag/version: https://github.com/psf/black/tags
67+
rev: 22.10.0 # Replace with any tag/version: https://github.com/psf/black/tags
3668
hooks:
3769
- id: black
3870
language_version: python3 # Should be a command that runs python3.7+
3971
additional_dependencies: ['click==8.0.4'] # Currently >8.0.4 breaks black
4072
- id: black-jupyter
4173
language: python
4274
- repo: https://github.com/PyCQA/flake8
43-
rev: 4.0.1
75+
rev: 5.0.4
4476
hooks:
4577
- id: flake8
4678
additional_dependencies: [
@@ -59,24 +91,6 @@ repos:
5991
flake8-return, # Check return statements
6092
flake8-simplify, # Suggestions to simplify code
6193
flake8-spellcheck, # Spelling checker
62-
flake8-sql, # Check SQL statement style
6394
flake8-use-fstring, # Encourages use of f-strings vs old style
6495
pep8-naming, # Check PEP8 class naming
6596
]
66-
- repo: local
67-
hooks:
68-
- id: pytest-changed-files
69-
name: pytest-changed-files
70-
entry: pytest
71-
files: tests/.*\btest_\w*.py
72-
language: system
73-
stages: [push]
74-
- repo: local
75-
hooks:
76-
- id: requirements-consistency
77-
name: check requirements are consistent
78-
entry: python pre-commit/requirements_consistency.py
79-
files: "(requirements.*.(txt|yml|yaml)|setup.py)$"
80-
pass_filenames: false
81-
language: python
82-
additional_dependencies: [pyyaml]

.readthedocs.yml

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,26 @@
55
# Required
66
version: 2
77

8+
# Set the version of Python and other tools you might need
9+
build:
10+
os: ubuntu-22.04
11+
tools:
12+
python: "3.10"
13+
apt_packages:
14+
- openslide-tools
15+
- libopenjp2-7-dev
16+
- libopenjp2-tools
17+
818
# Build documentation in the docs/ directory with Sphinx
919
sphinx:
1020
configuration: docs/conf.py
1121

12-
# Build documentation with MkDocs
13-
# mkdocs:
14-
# configuration: mkdocs.yml
15-
1622
# Optionally build your docs in additional formats such as PDF
1723
formats:
1824
- pdf
19-
- epub
20-
21-
# Install apt packages
22-
build:
23-
apt_packages:
24-
- openslide-tools
25-
- libopenjp2-7-dev
26-
- libopenjp2-tools
2725

2826
# Optionally set the version of Python and requirements required to build your docs
2927
python:
30-
version: "3.8"
3128
install:
3229
- requirements: requirements.txt
3330
- requirements: docs/requirements.txt

AUTHORS.md

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,24 @@
1-
Credits
2-
=======
1+
# Credits
32

4-
Development Lead
5-
----------------
3+
## Development Lead
64

75
- TIA Centre led by Nasir Rajpoot <tia@dcs.warwick.ac.uk>
8-
- Shan E Ahmed Raza <shaneahmed>
9-
- John Pocock <John-P>
10-
- Simon Graham <simongraham>
11-
- Dang Vu <vqdang>
12-
- Mostafa Jahanifar <mostafajahanifar>
13-
- David Epstein <DavidBAEpstein>
14-
- Srijay Deshpande <Srijay-lab>
15-
- George Hadjigeorgiou <ghadjigeorghiou>
16-
- Adam Shephard <adamshephard>
17-
- Mark Eastwood <measty>
18-
- Wenqi Lu <wenqi006>
19-
- Saad Bashir <rajasaad>
6+
- Shan E Ahmed Raza \<@shaneahmed>
7+
- John Pocock \<@John-P>
8+
- Simon Graham \<@simongraham>
9+
- Dang Vu \<@vqdang>
10+
- Mostafa Jahanifar \<@mostafajahanifar>
11+
- David Epstein \<@DavidBAEpstein>
12+
- Mark Eastwood \<@measty>
13+
- Srijay Deshpande \<@Srijay-lab>
14+
- Ruqayya Awan \<@ruqayya>
15+
- Adam Shephard \<@adamshephard>
16+
- George Hadjigeorgiou \<@ghadjigeorghiou>
17+
- Wenqi Lu \<@wenqi006>
18+
- Saad Bashir \<@rajasaad>
2019

21-
Contributors
22-
------------
20+
## Contributors
2321

24-
- Rob Jewsbury <R-J96>
25-
- Mohsin Bilal <mbhahsmi>
26-
- Fayyaz Minhas <foxtrotmike>
22+
- Rob Jewsbury \<@R-J96>
23+
- Mohsin Bilal \<@mbhahsmi>
24+
- Fayyaz Minhas \<@foxtrotmike>

CITATION.cff

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ authors:
4343
- family-names: "Raza"
4444
given-names: "Shan E Ahmed"
4545
orcid: "https://orcid.org/0000-0002-1097-1738"
46-
title: "TIAToolbox: An End-to-End Toolbox for Advanced Tissue Image Analytics"
47-
version: 1.2.1
46+
title: "TIAToolbox as an end-to-end library for advanced tissue image analytics"
47+
version: 1.3.0
4848
doi: 10.5281/zenodo.5802442
49-
date-released: 2022-07-07
49+
date-released: 2022-10-20
5050
url: "https://github.com/TissueImageAnalytics/tiatoolbox"
5151
preferred-citation:
5252
type: article
@@ -93,8 +93,8 @@ preferred-citation:
9393
- family-names: "Raza"
9494
given-names: "Shan E Ahmed"
9595
orcid: "https://orcid.org/0000-0002-1097-1738"
96-
doi: "10.1101/2021.12.23.474029"
97-
journal: "bioRxiv"
98-
month: 12
99-
title: "TIAToolbox: An End-to-End Toolbox for Advanced Tissue Image Analytics"
100-
year: 2021
96+
doi: "10.1038/s43856-022-00186-5"
97+
journal: "Communications Medicine"
98+
month: 09
99+
title: "TIAToolbox as an end-to-end library for advanced tissue image analytics"
100+
year: 2022

0 commit comments

Comments
 (0)