def test_modality(file, modalities):
    """
    Check if the image modality is in the search list
    :param modalities:
    :param file:
    :return:
    """
    if not file or not modalities:
        return False
    for modality in modalities:
        if file.Modality == modality:
            return True
    else:
        return False