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)
| 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: |