MCPcopy Create free account
hub / github.com/Project-MONAI/MONAI / get_downsample_ratio

Method get_downsample_ratio

monai/data/wsi_reader.py:1343–1352  ·  view source on GitHub ↗

Returns the down-sampling ratio of the whole slide image at a given level. Args: wsi: a whole slide image object loaded from a file. level: the level number where the downsample ratio is calculated.

(self, wsi, level: int)

Source from the content-addressed store, hash-verified

1341 return (wsi.pages[level].imagelength, wsi.pages[level].imagewidth)
1342
1343 def get_downsample_ratio(self, wsi, level: int) -> float:
1344 """
1345 Returns the down-sampling ratio of the whole slide image at a given level.
1346
1347 Args:
1348 wsi: a whole slide image object loaded from a file.
1349 level: the level number where the downsample ratio is calculated.
1350
1351 """
1352 return float(wsi.pages[0].imagelength) / float(wsi.pages[level].imagelength)
1353
1354 @staticmethod
1355 def get_file_path(wsi) -> str:

Callers 1

_get_patchMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected