Skip to content

Commit

Permalink
adding output_name option to replace _cp_masks with user-input (#1100)
Browse files Browse the repository at this point in the history
  • Loading branch information
carsen-stringer committed Feb 10, 2025
1 parent 16c3b46 commit 8526c84
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cellpose/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,9 @@ def main():
diams=diams, restore_type=restore_type,
ratio=1.)
if saving_something:
io.save_masks(image, masks, flows, image_name, png=args.save_png,
suffix = args.output_name if len(args.output_name) > 0 else "_cp_masks"
io.save_masks(image, masks, flows, image_name,
suffix=suffix, png=args.save_png,
tif=args.save_tif, save_flows=args.save_flows,
save_outlines=args.save_outlines,
dir_above=args.dir_above, savedir=args.savedir,
Expand Down
3 changes: 3 additions & 0 deletions cellpose/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ def get_arg_parser():
output_args.add_argument(
"--save_tif", action="store_true",
help="save masks as tif and outlines as text file for ImageJ")
output_args.add_argument(
"--output_name", default=[], type=str,
help="suffix for saved masks, default is _cp_masks")
output_args.add_argument("--no_npy", action="store_true",
help="suppress saving of npy")
output_args.add_argument(
Expand Down

0 comments on commit 8526c84

Please sign in to comment.