grab_files_from_dir#
- grab_files_from_dir(input_path, file_types=('*.jpg', '*.png', '*.tif'))[source]#
Grab file paths specified by file extensions.
- Parameters:
input_path (str or pathlib.Path) – Path to the directory where files need to be searched.
file_types (str or tuple(str)) – File types (extensions) to be searched.
- Returns:
File paths as a python list. It has been sorted to ensure the same ordering across platforms.
- Return type:
Examples
>>> from tiatoolbox import utils >>> file_types = ("*.ndpi", "*.svs", "*.mrxs") >>> files_all = utils.misc.grab_files_from_dir(input_path, ... file_types=file_types)