Browse Source

changed default output directory

main
Holger Frey 4 years ago
parent
commit
1bdbe08167
  1. 13
      sensospot_images/__init__.py

13
sensospot_images/__init__.py

@ -159,18 +159,20 @@ def process(
"-o", "-o",
"--output", "--output",
default=None, default=None,
help="Output directory name, defaults to folder on desktop", help="Output directory name, defaults to new folder in parent of source",
) )
@click.option( @click.option(
"-w", "-w",
"--wells", "--wells",
default="*", default="*",
show_default=True,
help="restrict to this wells, * = all", help="restrict to this wells, * = all",
) )
@click.option( @click.option(
"-e", "-e",
"--Exposures", "--Exposures",
default="*", default="*",
show_default=True,
help="restrict to this exposure ids, * = all", help="restrict to this exposure ids, * = all",
) )
@click.option( @click.option(
@ -178,21 +180,22 @@ def process(
"--scale", "--scale",
type=int, type=int,
default=3, default=3,
show_default=True,
help="scale-up of images", help="scale-up of images",
) )
@click.option( @click.option(
"--spots", "--spots",
default=False, default=False,
is_flag=True, is_flag=True,
show_default=True,
help="include cropped images of spots", help="include cropped images of spots",
) )
def run(source, output=None, wells="*", exposures="*", scale=3, spots=False): def run(source, output=None, wells="*", exposures="*", scale=3, spots=False):
source = Path(source)
if output is None or not Path(output).is_dir(): if output is None or not Path(output).is_dir():
default = Path.home() / "Desktop" parent = source.absolute().parent
if not default.is_dir():
default = Path.home()
now = datetime.now().strftime("%Y-%m-%d %H-%M-%S") now = datetime.now().strftime("%Y-%m-%d %H-%M-%S")
output = default / now output = parent / now
output.mkdir(exist_ok=True) output.mkdir(exist_ok=True)
process(source, output, wells, exposures, scale, spots) process(source, output, wells, exposures, scale, spots)

Loading…
Cancel
Save