Skip to content

Commit

Permalink
Bug fix in Surface Mesh Multiscale Task.
Browse files Browse the repository at this point in the history
If label image of input region is empty, skip region.
  • Loading branch information
nrepina committed Aug 24, 2024
1 parent 5446770 commit 8062cf5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/scmultiplex/fractal/surface_mesh_multiscale.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,13 @@ def surface_mesh_multiscale(
seg, parent_mask = mask_by_parent_object(
seg, groupby_dask, groupby_idlist, row_int, label_str
)
# Only proceed if labelmap is not empty
if np.amax(seg) == 0:
logger.warning(
f"Skipping object ID {label_str}. Label image contains no labeled objects."
)
# Skip this object
continue
else:
# Check that label exists in object
if float(label_str) not in seg:
Expand Down

0 comments on commit 8062cf5

Please sign in to comment.