def prune_by_tum_detect(iqms):
    """Prunes to only contain IQMs for imgs with identifiable tumour

    Parameters
    ----------
    iqms : dict
        The dict of IQMs for one beamformer

    Returns
    -------
    pruned_iqms : dict
        The dict of the IQMs for all images which had an identifiable
        tumour response
    """

    pruned_iqms = dict()  # Init dict to return

    for old_key in iqms.keys():  # For each expt

        # If the tumour for this image was detected, using the SCR
        # criterion
        if iqms[old_key][2] >= 0:
            pruned_iqms[old_key] = iqms[old_key]

    return pruned_iqms