Skip to content

Commit 8526c84

Browse files
adding output_name option to replace _cp_masks with user-input (#1100)
1 parent 16c3b46 commit 8526c84

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

cellpose/__main__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,9 @@ def main():
240240
diams=diams, restore_type=restore_type,
241241
ratio=1.)
242242
if saving_something:
243-
io.save_masks(image, masks, flows, image_name, png=args.save_png,
243+
suffix = args.output_name if len(args.output_name) > 0 else "_cp_masks"
244+
io.save_masks(image, masks, flows, image_name,
245+
suffix=suffix, png=args.save_png,
244246
tif=args.save_tif, save_flows=args.save_flows,
245247
save_outlines=args.save_outlines,
246248
dir_above=args.dir_above, savedir=args.savedir,

cellpose/cli.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,9 @@ def get_arg_parser():
146146
output_args.add_argument(
147147
"--save_tif", action="store_true",
148148
help="save masks as tif and outlines as text file for ImageJ")
149+
output_args.add_argument(
150+
"--output_name", default=[], type=str,
151+
help="suffix for saved masks, default is _cp_masks")
149152
output_args.add_argument("--no_npy", action="store_true",
150153
help="suppress saving of npy")
151154
output_args.add_argument(

0 commit comments

Comments
 (0)