Skip to content

Commit eb4cecd

Browse files
authored
Merge branch 'develop' into fix-zarr-check
2 parents 2212eef + ba0109f commit eb4cecd

File tree

10 files changed

+30
-172
lines changed

10 files changed

+30
-172
lines changed

.readthedocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ version: 2
99
build:
1010
os: ubuntu-24.04
1111
tools:
12-
python: "3.10"
12+
python: "3.12"
1313
apt_packages:
1414
- openslide-tools
1515
- libopenjp2-7-dev

README.md

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,25 +45,21 @@
4545

4646
## Getting Started
4747

48-
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.
48+
TIAToolbox is a computational pathology toolbox developed by the TIA Centre. It provides an end-to-end API for pathology image analysis using best practices. Based on **[PyTorch](https://pytorch.org/)**, a popular deep learning framework, TIAToolbox enables efficient and flexible implementation of state-of-the-art algorithms. It supports many features through a command-line interface and can integrate with standard PyTorch modules. The toolbox 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.
4949

5050
### All Users
5151

52-
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])**.
53-
54-
**`tiatoolbox`** is a multipurpose name that we use for 1) a certain computer program, 2) a Python package of related programs, created by us at the TIA Centre to help people get started in Digital Pathology, 3) this repository, 4) a certain virtual environment.
52+
This package is designed for those interested in digital pathology, including graduate students, medical staff, members of the TIA Centre and PathLAKE, and anyone who may find it useful. We will continue to improve this package, taking into account developments in pathology, microscopy, computing, and related disciplines. Please send comments and feedback to **[[email protected]](mailto:[email protected])**.
5553

5654
### Developers
5755

58-
Anyone wanting to contribute to this repository, please first look at our [Wiki](https://github.com/TissueImageAnalytics/tiatoolbox/wiki) and at our web page for [contributors](https://github.com/TissueImageAnalytics/tiatoolbox/blob/master/CONTRIBUTING.rst). See also the *Prepare for development* section of this document.
59-
60-
### Links, if needed
56+
If you want to contribute to this repository, please first look at our [Wiki](https://github.com/TissueImageAnalytics/tiatoolbox/wiki) and our [contributor guidelines](https://github.com/TissueImageAnalytics/tiatoolbox/blob/master/CONTRIBUTING.rst). Also, see the *Prepare for development* section of this document.
6157

62-
The [bash](https://www.gnu.org/software/bash) shell is available on all commonly encountered platforms. Commands in this README are in bash. Windows users can use the command prompt to install conda and python packages.
58+
### Useful Links
6359

64-
[conda](https://github.com/conda/conda) is a management system for software packages and [virtual environments](https://docs.conda.io/projects/conda/en/latest/user-guide/concepts/environments.html). To get `conda`, download [Anaconda](https://www.anaconda.com/), which includes hundreds of the most useful Python packages, using 2GB disk space. Alternatively, [miniconda](https://docs.conda.io/en/latest/miniconda.html) uses 400MB, and packages can be added as needed.
60+
The [bash](https://www.gnu.org/software/bash) shell is available on all commonly encountered platforms. Commands in this README are in bash. Windows users can use the command prompt to install conda and Python packages.
6561

66-
[GitHub](https://github.com/about) is powered by the version control system [git](https://git-scm.com/), which has many users and uses. In GitHub, it is used to track versions of code and other documents.
62+
[conda](https://github.com/conda/conda) is a management system for software packages and [virtual environments](https://docs.conda.io/projects/conda/en/latest/user-guide/concepts/environments.html). To get `conda`, download [Anaconda](https://www.anaconda.com/), which includes hundreds of the most useful Python packages, using 2GB of disk space. Alternatively, [miniconda](https://docs.conda.io/en/latest/miniconda.html) uses 400MB, and packages can be added as needed.
6763

6864
### Examples Taster
6965

docs/basic_functionalities.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Basic Functionalities
22
*********************
33

44
.. toctree::
5-
:maxdepth: 2
5+
:maxdepth: 1
66
:glob:
77

88
_notebooks/jnb/*

docs/conf.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484

8585
# General information about the project.
8686
project = "TIA Toolbox"
87-
copyright = "2023, TIA Lab"
87+
copyright = "2025, TIA Lab"
8888
author = "TIA Lab"
8989

9090
# The version info for the project you're documenting, acts as replacement
@@ -2005,8 +2005,8 @@ def all_but_ipynb(dir_path, contents):
20052005
)
20062006

20072007
# shutil.copy(
2008-
# os.path.join(PROJ_ROOT, "docs/notebooks.rst"),
2009-
# os.path.join(PROJ_ROOT, "docs/_notebooks/notebooks.rst"),
2008+
# os.path.join(PROJ_ROOT, "docs/usage_examples.rst"),
2009+
# os.path.join(PROJ_ROOT, "docs/_notebooks/usage_examples.rst"),
20102010
# )
20112011

20122012
# Read in the file
@@ -2016,8 +2016,8 @@ def all_but_ipynb(dir_path, contents):
20162016
# Replace the target string
20172017
file_data = file_data.replace(".rst", ".html")
20182018
file_data = file_data.replace(".ipynb", ".html")
2019-
file_data = file_data.replace("../docs/", "../")
20202019
file_data = file_data.replace("](./", "](./jnb/")
2020+
file_data = file_data.replace("../docs/", "./")
20212021

20222022
# Write the file out again
20232023
with open("_notebooks/README.md", "w") as file:

docs/index.rst

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
Welcome to TIA Toolbox's documentation!
22
=======================================
33

4-
.. image:: tia_logo.png
5-
:alt: alternate text
6-
:align: center
4+
.. include:: ../README.md
5+
:parser: myst_parser.sphinx_
6+
7+
Index
8+
-----
79

810
.. toctree::
9-
:maxdepth: 2
11+
:maxdepth: 1
1012

1113
Readme <readme.rst>
1214
Installation <installation.rst>
13-
Usage <usage.rst>
1415
Pre-trained Models <pretrained.rst>
15-
Jupyter Notebooks <notebooks.rst>
16+
Usage Examples <usage_examples.rst>
1617
Algorithms <algorithms.rst>
1718
Visualization <visualization.rst>
1819
API Reference <_autosummary/tiatoolbox>

docs/jnb_pipelines.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Pipelines
22
*********
33

44
.. toctree::
5-
:maxdepth: 2
5+
:maxdepth: 1
66
:glob:
77

88
_notebooks/jnb/inference-pipelines/*

docs/usage.rst

Lines changed: 0 additions & 134 deletions
This file was deleted.
Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,20 @@
11
Jupyter Notebooks
22
#################
33

4-
.. toctree::
5-
:maxdepth: 2
6-
7-
_notebooks/README.md
4+
.. include:: _notebooks/README.md
5+
:parser: myst_parser.sphinx_
86

9-
|
7+
Index
8+
-----
109

1110
.. toctree::
12-
:maxdepth: 3
13-
:glob:
11+
:maxdepth: 2
1412

1513
Basic Functionalities <basic_functionalities.rst>
1614

1715
|
1816
1917
.. toctree::
20-
:maxdepth: 3
21-
:glob:
18+
:maxdepth: 2
2219

2320
Pipelines <jnb_pipelines.rst>

tests/models/test_arch_mapde.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
ON_GPU = toolbox_env.has_gpu()
1515

1616

17-
def _load_mapde(name: str) -> torch.nn.Module:
17+
def _load_mapde(name: str) -> MapDe:
1818
"""Loads MapDe model with specified weights."""
1919
model = MapDe()
2020
weights_path = fetch_pretrained_weights(name)
2121
map_location = select_device(on_gpu=ON_GPU)
2222
pretrained = torch.load(weights_path, map_location=map_location)
2323
model.load_state_dict(pretrained)
24-
24+
model.to(map_location)
2525
return model
2626

2727

@@ -45,7 +45,6 @@ def test_functionality(remote_sample: Callable) -> None:
4545
model = _load_mapde(name="mapde-conic")
4646
patch = model.preproc(patch)
4747
batch = torch.from_numpy(patch)[None]
48-
model = model.to()
4948
output = model.infer_batch(model, batch, device=select_device(on_gpu=ON_GPU))
5049
output = model.postproc(output[0])
5150
assert np.all(output[0:2] == [[19, 171], [53, 89]])

tests/models/test_arch_sccnn.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
from tiatoolbox.wsicore.wsireader import WSIReader
1313

1414

15-
def _load_sccnn(name: str) -> torch.nn.Module:
15+
def _load_sccnn(name: str) -> SCCNN:
1616
"""Loads SCCNN model with specified weights."""
1717
model = SCCNN()
1818
weights_path = fetch_pretrained_weights(name)
1919
map_location = select_device(on_gpu=env_detection.has_gpu())
2020
pretrained = torch.load(weights_path, map_location=map_location)
2121
model.load_state_dict(pretrained)
22-
22+
model.to(map_location)
2323
return model
2424

2525

@@ -48,7 +48,6 @@ def test_functionality(remote_sample: Callable) -> None:
4848
)
4949
output = model.postproc(output[0])
5050
assert np.all(output == [[8, 7]])
51-
5251
model = _load_sccnn(name="sccnn-conic")
5352
output = model.infer_batch(
5453
model,

0 commit comments

Comments
 (0)