Skip to content

Commit afe72b5

Browse files
authored
BUG: fix bug when no cells on canvas. (#397)
1 parent 42fbac6 commit afe72b5

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

backend/deepcell_label/export.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,10 @@ def rewrite_labeled(labeled, cells):
157157
overlap_values.append([value, group])
158158

159159
# Rewrite overlapping values with values higher than all cells
160-
new_overlap_value = max(cells_at_t, key=lambda c: c['cell'])['cell'] + 1
160+
if len(cells_at_t) == 0:
161+
new_overlap_value = 0
162+
else:
163+
new_overlap_value = max(cells_at_t, key=lambda c: c['cell'])['cell'] + 1
161164
for overlap_value, overlap_cells in overlap_values:
162165
for cell in overlap_cells:
163166
frame = labeled[:, t, :, :]

0 commit comments

Comments
 (0)