Skip to content

Commit d836c86

Browse files
committed
Fix color norm may raise data type incompatible issue
1 parent c7bb57f commit d836c86

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

wsidata/_accessors/iter.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ def tissue_images(
166166
level_downsample = self._obj.properties.level_downsample[level]
167167
if color_norm is not None:
168168
cn = ColorNormalizer(method=color_norm)
169-
cn_func = lambda x: cn(x).numpy() # noqa
169+
cn_func = lambda x: cn(x).numpy().astype(np.uint8) # noqa
170170
else:
171171
cn_func = lambda x: x # noqa
172172

@@ -280,7 +280,7 @@ def tile_images(
280280

281281
if color_norm is not None:
282282
cn = ColorNormalizer(method=color_norm)
283-
cn_func = lambda x: cn(x).numpy() # noqa
283+
cn_func = lambda x: cn(x).numpy().astype(np.uint8) # noqa
284284
else:
285285
cn_func = lambda x: x # noqa
286286

0 commit comments

Comments
 (0)