Skip to content

Conversation

@John-P
Copy link
Contributor

@John-P John-P commented Dec 7, 2021

Adds a simple Zoomify viewer class.

Key Features

  • Take a dictionary of WSIReader objects
  • Display then as layers in the web browser (localhost:5000) by serving Zoomify tiles
  • Togglable layers
  • Adjustable opacity
  • Layer re-ordering
  • Mini-map
  • Fullscreen
  • Rotation (shift + alt) with reset button
  • Mouse coordinates in baseline pixels (bottom right)
  • Scale bar in microns
  • Works with JP2 images but can be very slow and a little glitchy sometimes.

To Do

  • Rename class / module?
  • Unit tests

Dependencies

  • OpenLayers (BSD) and ol-ext (BSD-like, French version) Javascript for the frontend.
  • Flask (BSD) for the server.

Demo

ZoomifyViewer.mp4

Update: Added Graticule & Screen Space Graticule (Grids)

ZoomifyViewer.Graticules.mp4

Demo Code

from tiatoolbox.wsiscore.wsireader import WSIReader
from tiatoolbox.visualization.tileserver import TileServer

wsi = WSIReader.open("/home/john/Downloads/CMU-1.svs")
wsi2 = WSIReader.open("/home/john/Downloads/JP2K-33003-1.svs")
app = TileServer(
    title="Testing TileServer",
    layers={
        "JPEG SVS": wsi,
        "JP2 SVS": wsi2,
    },
)
app.run()

Future Extensions

  • Allow annotation store as layer to display vector polygons / rendered as tiles
  • IPython support for embedding in notebooks
  • Make the layers UI a bit prettier

@John-P John-P added the enhancement New feature or request label Dec 7, 2021
@John-P
Copy link
Contributor Author

John-P commented Dec 7, 2021

As a result this has made some bugs in VirtualWSIReader in combination with ZoomifyGenerator apparent and will be useful for testing and debugging.

@John-P
Copy link
Contributor Author

John-P commented Dec 7, 2021

@shaneahmed Only a quick draft and simple tool but may be useful to motivate Zoomify tile generation and also as a way of debugging it / showing results in general.

@John-P John-P linked an issue Dec 7, 2021 that may be closed by this pull request
@John-P John-P self-assigned this Dec 7, 2021
@John-P John-P marked this pull request as ready for review December 7, 2021 10:44
@codecov
Copy link

codecov bot commented Dec 7, 2021

Codecov Report

Merging #212 (3a51b21) into develop (9bb597d) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop     #212   +/-   ##
========================================
  Coverage    99.83%   99.83%           
========================================
  Files           52       53    +1     
  Lines         4848     4883   +35     
  Branches       796      798    +2     
========================================
+ Hits          4840     4875   +35     
  Misses           2        2           
  Partials         6        6           
Impacted Files Coverage Δ
tiatoolbox/visualization/tileserver.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9bb597d...3a51b21. Read the comment docs.

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 @John-P This will strengthen visualisation part. Can we add tests to fix coverage?

@shaneahmed shaneahmed merged commit f6c0712 into develop Dec 17, 2021
@shaneahmed shaneahmed deleted the feature-zommify-viz branch December 17, 2021 12:01
@shaneahmed shaneahmed mentioned this pull request Dec 22, 2021
shaneahmed added a commit that referenced this pull request Dec 23, 2021
### Major Updates and Feature Improvements
- Adds nucleus instance segmentation base class
  - Adds  [HoVerNet](https://www.sciencedirect.com/science/article/abs/pii/S1361841519301045) architecture
- Adds multi-task segmentor [HoVerNet+](https://arxiv.org/abs/2108.13904) model
- Adds <a href="https://www.thelancet.com/journals/landig/article/PIIS2589-7500(2100180-1/fulltext">IDaRS</a> pipeline
- Adds [SlideGraph](https://arxiv.org/abs/2110.06042) pipeline
- Adds PCam patch classification models
- Adds support for stain augmentation feature
- Adds classes and functions under `tiatoolbox.tools.graph` to enable construction of graphs in a format which can be used with PyG (PyTorch Geometric).
- Add classes which act as a mutable mapping (dictionary like) structure and enables efficient management of annotations. (#135)
- Adds example notebook for adding advanced models
- Adds classes which can generate zoomify tiles from a WSIReader object.
- Adds WSI viewer using Zoomify/WSIReader API (#212)
- Adds README to example page for clarity
- Adds support to override or specify mpp and power

### Changes to API
- Replaces `models.controller` API with `models.engine`
- Replaces `CNNPatchPredictor` with `PatchPredictor`

### Bug Fixes and Other Changes
- Fixes  Fix `filter_coordinates` read wrong resolutions for patch extraction
- For `PatchPredictor`
  - `ioconfig` will supersede everything
  - if `ioconfig` is not provided
    - If `model` is pretrained (defined in `pretrained_model.yaml` )
      - Use the yaml ioconfig
      - Any other input patch reading arguments will overwrite the yaml ioconfig (at the same keyword).
    - If `model` is not defined, all input patch reading arguments must be provided else exception will be thrown.
- Improves performance of mask based patch extraction

### Development related changes
- Improve tests performance for Travis runs
- Adds feature detection mechanism to detect the platform and installed packages etc.
- On demand imports for some libraries for performance
- Improves performance of mask based patch extraction

Co-authored-by: Shan Raza <[email protected]>
@shaneahmed shaneahmed mentioned this pull request Dec 23, 2021
shaneahmed added a commit that referenced this pull request Dec 23, 2021
- Bump version: 0.8.0 → 1.0.0

### Major Updates and Feature Improvements
- Adds nucleus instance segmentation base class
  - Adds  [HoVerNet](https://www.sciencedirect.com/science/article/abs/pii/S1361841519301045) architecture
- Adds multi-task segmentor [HoVerNet+](https://arxiv.org/abs/2108.13904) model
- Adds <a href="https://www.thelancet.com/journals/landig/article/PIIS2589-7500(2100180-1/fulltext">IDaRS</a> pipeline
- Adds [SlideGraph](https://arxiv.org/abs/2110.06042) pipeline
- Adds PCam patch classification models
- Adds support for stain augmentation feature
- Adds classes and functions under `tiatoolbox.tools.graph` to enable construction of graphs in a format which can be used with PyG (PyTorch Geometric).
- Add classes which act as a mutable mapping (dictionary like) structure and enables efficient management of annotations. (#135)
- Adds example notebook for adding advanced models
- Adds classes which can generate zoomify tiles from a WSIReader object.
- Adds WSI viewer using Zoomify/WSIReader API (#212)
- Adds README to example page for clarity
- Adds support to override or specify mpp and power

### Changes to API
- Replaces `models.controller` API with `models.engine`
- Replaces `CNNPatchPredictor` with `PatchPredictor`

### Bug Fixes and Other Changes
- Fixes  Fix `filter_coordinates` read wrong resolutions for patch extraction
- For `PatchPredictor`
  - `ioconfig` will supersede everything
  - if `ioconfig` is not provided
    - If `model` is pretrained (defined in `pretrained_model.yaml` )
      - Use the yaml ioconfig
      - Any other input patch reading arguments will overwrite the yaml ioconfig (at the same keyword).
    - If `model` is not defined, all input patch reading arguments must be provided else exception will be thrown.
- Improves performance of mask based patch extraction

### Development related changes
- Improve tests performance for Travis runs
- Adds feature detection mechanism to detect the platform and installed packages etc.
- On demand imports for some libraries for performance
- Improves performance of mask based patch extraction

Co-authored-by: @tialab
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.

Add DeepZoom Tile Indexing

4 participants