From f2127941f2ad63db9a3265e46de65e5822c390b2 Mon Sep 17 00:00:00 2001 From: Mr-Milk Date: Fri, 1 Dec 2023 10:32:58 +0100 Subject: [PATCH] Fix parsing metadata error --- lazyslide/readers/base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lazyslide/readers/base.py b/lazyslide/readers/base.py index befa8c1..5488d05 100644 --- a/lazyslide/readers/base.py +++ b/lazyslide/readers/base.py @@ -123,7 +123,7 @@ def _get_best_level_to_downsample(self, factor): def parse_metadata(filename, metadata: Dict): - fields = set(metadata.values()) + fields = set(metadata.keys()) mpp_keys = [] # openslide specific mpp keys @@ -168,7 +168,7 @@ def parse_metadata(filename, metadata: Dict): if N_LEVEL_KEY in fields: n_level_tmp = metadata.get(N_LEVEL_KEY) if n_level_tmp is not None: - n_level = n_level_tmp + n_level = int(n_level_tmp) for level in range(n_level): height = metadata.get(LEVEL_HEIGHT_KEY(level))