Skip to content

Commit 9f7f878

Browse files
committed
Don't just pick first masks Channel. Use all
1 parent e69f9fe commit 9f7f878

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

ome_zarr.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -258,10 +258,11 @@ def load_ome_masks(self):
258258
color_dict = mask_attrs.get('color')
259259
colors = {int(k):self.to_rgba(v) for (k, v) in color_dict.items()}
260260
data = da.from_zarr(mask_path)
261-
# mask data is 5D (t, c, z, y, x) but each layer in napari is 4D (no C)
262-
# NB: Assume we want 'first Channel'
263-
data = data[:,0,:,:,:]
264-
masks.append((data, {'name': name, 'color': colors}, 'labels'))
261+
# Split masks into separate channels, 1 per layer
262+
for n in range(data.shape[1]):
263+
masks.append((data[:,n,:,:,:],
264+
{'name': name, 'color': colors},
265+
'labels'))
265266
return masks
266267

267268

0 commit comments

Comments
 (0)