def regional_atlas(graph, label_image, xxx_todo_changeme1): # label image is required to hold continuous ids starting from 1
    r"""
    Regional term based on a probability atlas.
    
    An implementation of a regional term, suitable to be used with the
    `~medpy.graphcut.generate.graph_from_labels` function.
    
    This regional term introduces statistical probability of a voxel to belong to the
    object to segment. It computes the sum of all statistical atlas voxels under each
    region and uses this value as terminal node weight for the graph cut.

    Parameters
    ----------
    graph : GCGraph
        The graph to add the weights to.
    label_image : ndarray
        The label image.
    probability_map : ndarray
        The probability atlas image associated with the object to segment.
    alpha : float
        The energy terms alpha value, balancing between boundary and regional term. 
    
    Notes
    -----
    This function requires a probability atlas image of the same shape as the original image
    to be passed along. That means that `~medpy.graphcut.generate.graph_from_labels` has to
    be called with ``regional_term_args`` set to the probability atlas image.
    
    This function is tested on 2D and 3D images and theoretically works for all dimensionalities.    
    """
    (probability_map, alpha) = xxx_todo_changeme1
    label_image = scipy.asarray(label_image)
    probability_map = scipy.asarray(probability_map)
    __check_label_image(label_image)
    
    # finding the objects in the label image (bounding boxes around regions)
    objects = scipy.ndimage.find_objects(label_image)
    
    # iterate over regions and compute the respective sums of atlas values
    for rid in range(1, len(objects) + 1):
        weight = scipy.sum(probability_map[objects[rid - 1]][label_image[objects[rid - 1]] == rid])
        graph.set_tweight(rid - 1, alpha * weight, -1. * alpha * weight)