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()