def METHOD_NAME(labels, maxdist=9999999):
    """Spread the given labels to the background"""
    distances, features = distance_transform_edt(labels == 0,
                                                 return_distances=1,
                                                 return_indices=1)
    indexes = features[0] * labels.shape[1] + features[1]
    spread = labels.ravel()[indexes.ravel()].reshape(*labels.shape)
    spread *= (distances < maxdist)
    return spread