Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion histolab/tile.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def calculate_tissue_mask(
"""
np_tile = np.array(self._image)

border_thickness = 10
border_thickness = min(np_tile.shape) // 4

np_tile_border = np.pad(
np_tile,
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified tests/expectations/mask-arrays/tissue-mask-tcga-lung-rgb.npy
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 5 additions & 4 deletions tests/unit/test_tile.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,11 @@ def it_knows_its_tissue_mask(
)
_tile_tissue_mask_filters.return_value = filters
_call = method_mock(request, Compose, "__call__")
mask_with_border = np.ones((30, 30), dtype=np.uint8) * 255
border_thickness = 50
mask_with_border = np.ones((110, 110), dtype=np.uint8) * 255
mask_with_border[
10:20,
10:20,
border_thickness : 110 - border_thickness,
border_thickness : 110 - border_thickness,
] = COMPLEX_MASK
_call.return_value = mask_with_border
image = PILIMG.RGB_RANDOM_COLOR_10X10
Expand All @@ -245,7 +246,7 @@ def it_knows_its_tissue_mask(
tissue_mask = tile.tissue_mask

_tile_tissue_mask_filters.assert_called_once()
assert _call.call_args_list[0][0][1].size == (30, 30) # image with border
assert _call.call_args_list[0][0][1].size == (110, 110) # image with border
assert isinstance(tissue_mask, np.ndarray) is True
np.testing.assert_allclose(tissue_mask, COMPLEX_MASK)

Expand Down