Skip to content

Commit

Permalink
adding option for multiprocessing in save_rois (#974)
Browse files Browse the repository at this point in the history
  • Loading branch information
carsen-stringer committed Sep 10, 2024
1 parent 3429e20 commit 4dec50d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cellpose/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ def save_to_png(images, masks, flows, file_names):
save_masks(images, masks, flows, file_names, png=True)


def save_rois(masks, file_name):
def save_rois(masks, file_name, multiprocessing=None):
""" save masks to .roi files in .zip archive for ImageJ/Fiji
Args:
Expand All @@ -582,7 +582,7 @@ def save_rois(masks, file_name):
Returns:
None
"""
outlines = utils.outlines_list(masks)
outlines = utils.outlines_list(masks, multiprocessing=multiprocessing)
nonempty_outlines = [outline for outline in outlines if len(outline)!=0]
if len(outlines)!=len(nonempty_outlines):
print(f"empty outlines found, saving {len(nonempty_outlines)} ImageJ ROIs to .zip archive.")
Expand Down

0 comments on commit 4dec50d

Please sign in to comment.