Skip to content

Commit 4c02eee

Browse files
committed
retrieves the correct image in case there are multiple scales in the zarr
1 parent fe6b988 commit 4c02eee

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sopa/io/reader/_wsi_reader.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,8 @@ def read_region(self, location, level, size):
240240
"""Get a region from the slide."""
241241
x_start, y_start = location
242242
x_end, y_end = x_start + size[0], y_start + size[1]
243-
tile = self.slide[:, slice(y_start, y_end), slice(x_start, x_end)]
243+
image = next(iter(self.slide[f"scale{level}"].values()))
244+
tile = image[:, slice(y_start, y_end), slice(x_start, x_end)]
244245
return tile.transpose("x", "y", "c")
245246

246247
def close(self):

0 commit comments

Comments
 (0)