Skip to content

Commit 4fbe800

Browse files
authored
Fix wsireader get mpp issue (#7921)
Fixes #7918 ### Description The main issue is that enum is expressed differently between different pythons Related PR: #7905 ### Types of changes <!--- Put an `x` in all the boxes that apply, and remove the not applicable items --> - [x] Non-breaking change (fix or new feature that would not break existing functionality). - [ ] Breaking change (fix or new feature that would cause existing functionality to change). - [ ] New tests added to cover the changes. - [ ] Integration tests passed locally by running `./runtests.sh -f -u --net --coverage`. - [ ] Quick tests passed locally by running `./runtests.sh --quick --unittests --disttests`. - [ ] In-line docstrings updated. - [ ] Documentation updated, tested `make html` command in the `docs/` folder. Signed-off-by: YunLiu <55491388+KumoLiu@users.noreply.github.com>
1 parent ac86ed4 commit 4fbe800

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

monai/data/wsi_reader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1097,7 +1097,7 @@ def get_mpp(self, wsi, level: int) -> tuple[float, float]:
10971097
):
10981098
unit = wsi.pages[level].tags.get("ResolutionUnit")
10991099
if unit is not None:
1100-
unit = str(unit.value)[8:]
1100+
unit = str(unit.value.name)
11011101
if unit is None or len(unit) == 0:
11021102
warnings.warn("The resolution unit is missing. `micrometer` will be used as default.")
11031103
unit = "micrometer"

0 commit comments

Comments
 (0)