from pathlib import Path
from typing import Callable
from typing import List


def get_files(
    dir: Path, predicate: Callable[[str], bool] = lambda f: f.endswith(".nii.gz")
) -> List[Path]:
    """Collect list of file names filtered by 'predicate'"""
    return [f for f in Path(dir).glob("*.*") if predicate(f"{f}")]