mantidimaging.core.io.filenames module

class mantidimaging.core.io.filenames.FilenameGroup(directory: pathlib.Path, pattern: mantidimaging.core.io.filenames.FilenamePattern, all_indexes: List[int])[source]

Bases: object

all_files() Iterator[pathlib.Path][source]
find_all_files() None[source]
find_log_file() None[source]
classmethod from_file(path: Union[pathlib.Path, str]) mantidimaging.core.io.filenames.FilenameGroup[source]
class mantidimaging.core.io.filenames.FilenamePattern(prefix: str, digit_count: int, suffix: str)[source]

Bases: object

Representation of a filename pattern to handle stacks of related images

Handles patterns like “aaaa_####.bbb” where # are digits

PATTERN = re.compile('^([a-zA-Z0-9_]+?)([0-9]+)(\\.[a-zA-Z_]+)$')
PATTERN_d = '([0-9]+)'
PATTERN_p = '^([a-zA-Z0-9_]+?)'
PATTERN_s = '(\\.[a-zA-Z_]+)$'
classmethod from_name(filename: str) mantidimaging.core.io.filenames.FilenamePattern[source]
generate(index: int) str[source]
get_index(filename: str) int[source]
match(filename: str) bool[source]
match_metadata(filename: str) bool[source]