def index_singleton_clusters(clusters):
    """Replace cluster labels of -1 with ascending integers larger than the maximum cluster index.
    """
    clusters = clusters.copy()
    filt = clusters == -1
    n = clusters.max()
    clusters[filt] = range(n, n + len(filt))
    return clusters