prepare_file_dir_cli¶

prepare_file_dir_cli(img_input, output_path, file_types, mode, sub_dirname)[source]¶

Prepares CLI for running code on multiple files or a directory.

Checks for existing directories to run tests. Converts file path to list of file paths or creates list of file paths if input is a directory.

Parameters:
  • img_input (str or Path) – File path to images.

  • output_path (str or Path) – Output directory path.

  • file_types (str) – File types to process using cli.

  • mode (str) – wsi or tile mode.

  • sub_dirname (str) – Name of subdirectory to save output.

Returns:

list of file paths to process. pathlib.Path: updated output path.

Return type:

list