From f211ef1d711e1f9d8cd0262d5f72a3a87ec901a8 Mon Sep 17 00:00:00 2001 From: YunLiu <55491388+KumoLiu@users.noreply.github.com> Date: Tue, 16 Jul 2024 13:15:22 +0800 Subject: [PATCH] fix #7918 Signed-off-by: YunLiu <55491388+KumoLiu@users.noreply.github.com> --- monai/data/wsi_reader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monai/data/wsi_reader.py b/monai/data/wsi_reader.py index 96d84d8cf1..2a4fe9f7a8 100644 --- a/monai/data/wsi_reader.py +++ b/monai/data/wsi_reader.py @@ -1097,7 +1097,7 @@ def get_mpp(self, wsi, level: int) -> tuple[float, float]: ): unit = wsi.pages[level].tags.get("ResolutionUnit") if unit is not None: - unit = str(unit.value)[8:] + unit = str(unit.value.name) if unit is None or len(unit) == 0: warnings.warn("The resolution unit is missing. `micrometer` will be used as default.") unit = "micrometer"