Skip to content

Commit

Permalink
update io_sc.py: silence prep scs and add verbose arg
Browse files Browse the repository at this point in the history
  • Loading branch information
dummyindex committed Apr 15, 2024
1 parent d5648c5 commit 9d605b9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions livecellx/core/io_sc.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


def process_scs_from_single_label_mask(
label_mask, img_dataset, time, bg_val=0, min_contour_len=10, label_mask_dataset=None
label_mask, img_dataset, time, bg_val=0, min_contour_len=10, label_mask_dataset=None, verbose=False
):
labels = set(np.unique(label_mask))
if bg_val in labels:
Expand All @@ -29,7 +29,7 @@ def process_scs_from_single_label_mask(
if len(contour) >= min_contour_len:
filtered_label_contours.append(contour)

if len(filtered_label_contours) < len(label_contours):
if verbose and len(filtered_label_contours) < len(label_contours):
main_info(
"at time {}, label {} has {} contours found by opencv, {} of them are filtered by contour length threshold: {}".format(
time,
Expand All @@ -42,7 +42,7 @@ def process_scs_from_single_label_mask(

label_contours = filtered_label_contours

if len(label_contours) > 1:
if verbose and len(label_contours) > 1:
main_warning("at time {}, label {} has {} contours".format(time, label, len(label_contours)))
main_warning("lengths of each contour: {}".format([len(c) for c in label_contours]))

Expand Down

0 comments on commit 9d605b9

Please sign in to comment.