Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicole Bussola committed Jan 13, 2021
1 parent 1280929 commit 29d45af
Showing 1 changed file with 12 additions and 24 deletions.
36 changes: 12 additions & 24 deletions src/histolab/tiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,27 +166,6 @@ def _tiles_locator(self):
else self._tiles_generator
)

# def _tiles_coords(self, slide: Slide) -> Tuple[CoordinatePair]:
# """Return tile coordinates according to the invoked tiler.
#
# Parameters
# ----------
# slide : Slide
# Slide reference from which tile coordinates are retrieved.
#
# Returns
# -------
# tile_coords : Tuple[CoordinatePair]
# Tuple of tile coordinate pairs.
# """
# tiles = (
# self._highest_score_tiles(slide)[0]
# if isinstance(self, ScoreTiler)
# else self._tiles_generator(slide)
# )
# tiles_coords = (tile[1] for tile in tiles)
# return tiles_coords

def _tiles_generator(self, slide: Slide) -> Tuple[Tile, CoordinatePair]:
raise NotImplementedError

Expand Down Expand Up @@ -728,7 +707,7 @@ def extract(self, slide: Slide, report_path: str = None):
def _highest_score_tiles(
self, slide: Slide, scaled: bool = False
) -> List[Tuple[float, CoordinatePair]]:
"""Calculate the tiles with the highest scores and their extraction coordinates.
r"""Calculate the tiles with the highest scores and their extraction coordinates.
Parameters
----------
Expand All @@ -740,8 +719,17 @@ def _highest_score_tiles(
Returns
-------
List[Tuple[float, CoordinatePair]]
List of tuples containing the (scaled) scores and the extraction coordinates
for the tiles with the highest scores. Each tuple represents a tile.
List of tuples containing the scores and the extraction coordinates
for the tiles with the highest scores. If scaled=True, each score `s_i` of
the i-th tile is normalized as
.. math::
s_{\hat{i}}=\frac{s_i-\min_{j\in T}{s_j}}{\max_{j\in T}{s_j}-\min_{j\in T}{s_j}}
where `T` is the set of all the retrieved tiles. Notice that the normalized
scores range between 0 and 1. This could be useful to have a more intuitive
comparison between the scores. Each tuple represents a tile.
Raises
------
Expand Down

0 comments on commit 29d45af

Please sign in to comment.