This repository was archived by the owner on Mar 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 147
Plotting heatmap and thumbnails for test PANDA slides #634
Merged
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
f654ce3
heatmap and thumbnail output, deepmil module for panda
3de38e2
deepmil module panda subclass
5647e71
heatmap of selected tiles with correct location
3e2748a
scaled and shifted rectangle coordinates
e4f614f
slide dataset at container level
9d303ea
Instantiate dataset class in basemil
625db8a
dataset paths for AML
588bb49
fix merge conflicts
1deb0b9
heatmap utils selected
5879ff8
fix mypy and flake8 errors
ec20c30
mypy error resolved
974bc69
address PR comments
4fb31f9
flake8 errors resolved
e6b5f58
PR comments addressed
5d5bc76
add test for plots
fd0a1f2
PR comments more
a60265d
test for heatmap
46e3a3a
tests for heatmap
b97675f
update and fix merge conflict
e25b41e
add file comparison plot tests
f33cd65
reverting test_dict values for other test with hardcoded values
6899c91
PR comments Valentina
89de304
PR comments
4de59b1
change colormap to reds
7b4094c
remove redundant for loop
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| # ------------------------------------------------------------------------------------------ | ||
| # Copyright (c) Microsoft Corporation. All rights reserved. | ||
| # Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. | ||
| # ------------------------------------------------------------------------------------------ | ||
|
|
||
| from typing import List | ||
| import numpy as np | ||
|
|
||
|
|
||
| def location_selected_tiles(tile_coords: np.ndarray, | ||
| location_bbox: List[int], | ||
| level: int) -> np.ndarray: | ||
| """ Return the scaled and shifted tile co-ordinates for selected tiles in the slide. | ||
| :param tile_coords: XY tile coordinates, assumed to be spaced by multiples of `tile_size` (shape: [N, 2]) in original resolution. | ||
| :param location_bbox: Location of the bounding box on the slide in original resolution. | ||
| :param level: The downsampling level (e.g. 0, 1, 2) of the tiles if available. | ||
| (e.g. PANDA levels are 0 for original, 1 for 4x downsampled, 2 for 16x downsampled). | ||
| """ | ||
| level_dict = {0: 1, 1: 4, 2: 16} | ||
| factor = level_dict[level] | ||
|
|
||
| x_tr, y_tr = location_bbox | ||
| tile_xs, tile_ys = tile_coords.T | ||
| tile_xs = tile_xs - x_tr | ||
| tile_ys = tile_ys - y_tr | ||
| tile_xs = tile_xs//factor | ||
| tile_ys = tile_ys//factor | ||
|
|
||
| sel_coords = np.transpose([tile_xs.tolist(), tile_ys.tolist()]) | ||
|
|
||
| return sel_coords |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.