Skip to content

Commit

Permalink
Fix wsireader get mpp issue (#7921)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
KumoLiu authored Jul 16, 2024
1 parent ac86ed4 commit 4fbe800
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion monai/data/wsi_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 4fbe800

Please sign in to comment.