Browse Source

removed autoamtic sorting of cuts

master
Holger Frey 6 years ago
parent
commit
2ed2544f49
  1. 14
      mtor/postproc.py

14
mtor/postproc.py

@ -59,22 +59,12 @@ def annotate_one_color_coded_image( @@ -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}"
)
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()

Loading…
Cancel
Save