dipy/align/streamlinear.py
def bundle_min_distance(t, static, moving):
    """ MDF-based pairwise distance optimization function (MIN)

    We minimize the distance between moving streamlines as they align
    with the static streamlines.

    Parameters
    -----------
    t : ndarray
        t is a vector of of affine transformation parameters with
        size at least 6.
        If size is 6, t is interpreted as translation + rotation.
        If size is 7, t is interpreted as translation + rotation +
        isotropic scaling.
        If size is 12, t is interpreted as translation + rotation +
        scaling + shearing.

    static : list
        Static streamlines

    moving : list
        Moving streamlines.

    Returns
    -------
    cost: float

    """
    aff = compose_matrix44(t)
    moving = transform_streamlines(moving, aff)
    d01 = distance_matrix_mdf(static, moving)

    rows, cols = d01.shape
    return 0.25 * (np.sum(np.min(d01, axis=0)) / float(cols) +
                   np.sum(np.min(d01, axis=1)) / float(rows)) ** 2
 MDF-based pairwise distance optimization function (MIN)

    We minimize the distance between moving streamlines as they align
    with the static streamlines.

    Parameters
    -----------
    t : ndarray
        t is a vector of of affine transformation parameters with
        size at least 6.
        If size is 6, t is interpreted as translation + rotation.
        If size is 7, t is interpreted as translation + rotation +
        isotropic scaling.
        If size is 12, t is interpreted as translation + rotation +
        scaling + shearing.

    static : list
        Static streamlines

    moving : list
        Moving streamlines.

    Returns
    -------
    cost: float

    
MDF-based pairwise distance optimization function (MIN)
We minimize the distance between moving streamlines as they align
with the static streamlines.

Parameters

t : ndarray
t is a vector of of affine transformation parameters with
size at least 6.
If size is 6, t is interpreted as translation + rotation.
If size is 7, t is interpreted as translation + rotation +
isotropic scaling.
If size is 12, t is interpreted as translation + rotation +
scaling + shearing.

static : list
Static streamlines

moving : list
Moving streamlines.

Returns

float
MDF - based pairwise distance optimization function ( MIN ) We minimize the distance between moving streamlines as they align with the static streamlines . Parameters t : ndarray t is a vector of of affine transformation parameters with size at least 6 . If size is 6 t is interpreted as translation + rotation . If size is 7 t is interpreted as translation + rotation + isotropic scaling . If size is 12 t is interpreted as translation + rotation + scaling + shearing . static : list Static streamlines moving : list Moving streamlines . Returns float
def bundle_min_distance(t, static, moving):
    aff = compose_matrix44(t)
    moving = transform_streamlines(moving, aff)
    d01 = distance_matrix_mdf(static, moving)
    rows, cols = d01.shape
    return 0.25 * (np.sum(np.min(d01, axis=0)) / float(cols) +
                   np.sum(np.min(d01, axis=1)) / float(rows)) ** 2
def bundle_min_distance ( t , static , moving ) : aff = compose_matrix44 ( t ) moving = transform_streamlines ( moving , aff ) d01 = distance_matrix_mdf ( static , moving ) rows , cols = d01 . shape return 0.25 * ( np . sum ( np . min ( d01 , axis = 0 ) ) / float ( cols ) + np . sum ( np . min ( d01 , axis = 1 ) ) / float ( rows ) ) ** 2
MDF-based pairwise distance optimization function (MIN)
We minimize the distance between moving streamlines as they align
with the static streamlines.
MDF - based pairwise distance optimization function ( MIN ) We minimize the distance between moving streamlines as they align with the static streamlines .
""" MDF-based pairwise distance optimization function (MIN)

    We minimize the distance between moving streamlines as they align
    with the static streamlines.

    Parameters
    -----------
    t : ndarray
        t is a vector of of affine transformation parameters with
        size at least 6.
        If size is 6, t is interpreted as translation + rotation.
        If size is 7, t is interpreted as translation + rotation +
        isotropic scaling.
        If size is 12, t is interpreted as translation + rotation +
        scaling + shearing.

    static : list
        Static streamlines

    moving : list
        Moving streamlines.

    Returns
    -------
    cost: float

    """
t
static
moving