def boundary_difference_exponential(graph, xxx_todo_changeme4):
    r"""
    Boundary term processing adjacent voxels difference value using an exponential relationship.
    
    An implementation of a boundary term, suitable to be used with the
    `~medpy.graphcut.generate.graph_from_voxels` function.
    
    Finds all edges between all neighbours of the image and uses their difference in
    intensity values as edge weight.
    
    The weights are normalized using an exponential function and a smoothing factor
    :math:`\sigma`. The :math:`\sigma` value has to be supplied manually, since its
    ideal settings differ greatly from application to application.
    
    The weights between two neighbouring voxels :math:`(p, q)` is then computed as
    
    .. math::
    
        w(p,q) = \exp^{-\frac{|I_p - I_q|^2}{\sigma^2}}
    
    , for which :math:`w(p, q) \in (0, 1]` holds true.
    
    When the created edge weights should be weighted according to the slice distance,
    provide the list of slice thicknesses via the ``spacing`` parameter. Then all weights
    computed for the corresponding direction are divided by the respective slice
    thickness. Set this parameter to `False` for equally weighted edges.     
    
    Parameters
    ----------
    graph : GCGraph
        The graph to add the weights to.
    original_image : ndarray
        The original image.
    sigma : float
        The sigma parameter to use in the boundary term.
    spacing : sequence of float or False
        A sequence containing the slice spacing used for weighting the
        computed neighbourhood weight value for different dimensions. If
        `False`, no distance based weighting of the graph edges is performed.
        
    Notes
    -----
    This function requires the original image to be passed along. That means that
    `~medpy.graphcut.generate.graph_from_voxels` has to be called with ``boundary_term_args`` set to the
    original image.
    """
    (original_image, sigma, spacing) = xxx_todo_changeme4
    original_image = scipy.asarray(original_image)
    
    def boundary_term_exponential(intensities):
        """
        Implementation of a exponential boundary term computation over an array.
        """
        # apply exp-(x**2/sigma**2)
        intensities = scipy.power(intensities, 2)
        intensities /= math.pow(sigma, 2)
        intensities *= -1
        intensities = scipy.exp(intensities)
        intensities[intensities <= 0] = sys.float_info.min
        return intensities
    
    __skeleton_difference(graph, original_image, boundary_term_exponential, spacing)
r"""
    Boundary term processing adjacent voxels difference value using an exponential relationship.
    
    An implementation of a boundary term, suitable to be used with the
    `~medpy.graphcut.generate.graph_from_voxels` function.
    
    Finds all edges between all neighbours of the image and uses their difference in
    intensity values as edge weight.
    
    The weights are normalized using an exponential function and a smoothing factor
    :math:`\sigma`. The :math:`\sigma` value has to be supplied manually, since its
    ideal settings differ greatly from application to application.
    
    The weights between two neighbouring voxels :math:`(p, q)` is then computed as
    
    .. math::
    
        w(p,q) = \exp^{-\frac{|I_p - I_q|^2}{\sigma^2}}
    
    , for which :math:`w(p, q) \in (0, 1]` holds true.
    
    When the created edge weights should be weighted according to the slice distance,
    provide the list of slice thicknesses via the ``spacing`` parameter. Then all weights
    computed for the corresponding direction are divided by the respective slice
    thickness. Set this parameter to `False` for equally weighted edges.     
    
    Parameters
    ----------
    graph : GCGraph
        The graph to add the weights to.
    original_image : ndarray
        The original image.
    sigma : float
        The sigma parameter to use in the boundary term.
    spacing : sequence of float or False
        A sequence containing the slice spacing used for weighting the
        computed neighbourhood weight value for different dimensions. If
        `False`, no distance based weighting of the graph edges is performed.
        
    Notes
    -----
    This function requires the original image to be passed along. That means that
    `~medpy.graphcut.generate.graph_from_voxels` has to be called with ``boundary_term_args`` set to the
    original image.