Skip to content

Conversation

@measty
Copy link
Collaborator

@measty measty commented Aug 4, 2023

This PR adds the bokeh visualization.

The main features this PR adds:

Visualization interface with following features:

  1. Viewing of slides
  2. Viewing of annotation-store overlays
  3. Viewing of graph overlays
  4. Viewing of low-res image overlays
  5. Dual linked window functionality
  6. Various options to control how annotations are displayed/which annotations are displayed
  7. Run hovernet on a selected region
  8. Inspect annotation properties with double-click
  9. Slide info is shown below main view window

Adds cli command tiatoolbox visualize to launch UI. The usage has been changed to either:

tiatoolbox visualize --base-path path\to\parent\of\slides_and_overlays

or

tiatoolbox visualize --slides path\to\slides --overlays path\to\overlays

Adds a documentation page on how to use the UI, and providing some examples of how to create/modify an annotation store for visualization in some common scenarios.

Documentation available at this link https://tia-toolbox.readthedocs.io/en/add-bokeh-app/

@shaneahmed shaneahmed changed the title ENH: Add bokeh visualization ENH: Add bokeh Visualization Aug 4, 2023
@shaneahmed shaneahmed added this to the Release v1.5.0 milestone Aug 4, 2023
@shaneahmed shaneahmed added the enhancement New feature or request label Aug 4, 2023
@measty
Copy link
Collaborator Author

measty commented Nov 30, 2023

I tried to load the output of Cerberus (.dat files) directly, but the annotations weren't scaled correctly, so I ended up having to manually calculate the scale factor then converting them into annotation store. This is not a big problem, but it would be good if this can be done automatically? (The output of Cerberus has information about base resolution of the WSI and process resolution)

I've added a check in store_from_dat that looks to see if resolution information is available in the .dat file, and will use it to calculate a scale_factor if it is there.

@Jiaqi-Lv
Copy link
Collaborator

Jiaqi-Lv commented Dec 1, 2023

I have just noticed a bug, If I dis-select all types of annotations, all the annotations would still appear on the slide.

@measty
Copy link
Collaborator Author

measty commented Dec 4, 2023

I have just noticed a bug, If I dis-select all types of annotations, all the annotations would still appear on the slide.

Those buttons aren't really meant to be used to turn everything off (just use the overlay toggle for that) but i've fixed it so that if someone does do this it will act as expected and turn all types off.

Copy link
Member

@shaneahmed shaneahmed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @measty

This is a great addition to the toolbox.

@shaneahmed
Copy link
Member

@John-P Please can you confirm if you are happy with this PR? We are waiting for this PR to make the next release before Christmas.

@shaneahmed
Copy link
Member

Thanks @measty for adding this feature to the toolbox.

@shaneahmed shaneahmed merged commit c3b49e6 into develop Dec 15, 2023
@shaneahmed shaneahmed deleted the add-bokeh-app branch December 15, 2023 11:26
@shaneahmed shaneahmed mentioned this pull request Dec 15, 2023
shaneahmed added a commit that referenced this pull request Dec 15, 2023
## 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]>
@shaneahmed shaneahmed mentioned this pull request Dec 15, 2023
shaneahmed added a commit that referenced this pull request Dec 15, 2023
## 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants