import pathlib


def is_dicom(path: pathlib.Path) -> bool:
    """Check if the input is a DICOM file.

    Args:
        path (pathlib.Path): Path to the file to check.

    Returns:
        bool: True if the file is a DICOM file.

    """
    path = pathlib.Path(path)
    is_dcm = path.suffix.lower() == ".dcm"
    is_dcm_dir = path.is_dir() and any(
        p.suffix.lower() == ".dcm" for p in path.iterdir()
    )
    return is_dcm or is_dcm_dir