From 2ed2544f49ea219a968d30594672807dc7575e83 Mon Sep 17 00:00:00 2001 From: Holger Frey Date: Thu, 2 May 2019 14:39:28 +0200 Subject: [PATCH] removed autoamtic sorting of cuts --- mtor/postproc.py | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/mtor/postproc.py b/mtor/postproc.py index a98d37e..084f17e 100644 --- a/mtor/postproc.py +++ b/mtor/postproc.py @@ -59,22 +59,12 @@ def annotate_one_color_coded_image( path.unlink() -def sort_cut_images(file_stems, parameters): +def rename_cut_images(file_stems, parameters): for path in tqdm(list(parameters.cuts_dir.iterdir())): if not path.stem.startswith("."): label = ( LABEL_SELECTED if path.stem in file_stems else LABEL_DISCARDED ) - new_path = ( - parameters[f"cuts_{label}_dir"] - / f"{path.stem}_cut_{label}{path.suffix}" - ) - path.rename(new_path) - + new_path = path.with_name(f"{path.stem}_cut_{label}{path.suffix}") + path.rename(new_path) -def remove_cuts_dir(parameters): - cuts_dir = parameters["cuts_dir"] - if cuts_dir.is_dir(): - for item in cuts_dir.iterdir(): - item.unlink() - parameters["cuts_dir"].rmdir()