dipy/align/streamlinear.py
def decompose_matrix44(mat, size=12):
    """ Given a 4x4 homogeneous matrix return the parameter vector

    Parameters
    -----------
    mat : array
        Homogeneous 4x4 transformation matrix
    size : int
        Size of output vector. 3 for translation, 6 for rigid, 7 for similarity
        9 for scaling and 12 for affine. Default is 12.

    Returns
    -------
    t : ndarray
        One dimensional ndarray of 6, 7, 9 or 12 affine parameters.

    """
    scale, shear, angles, translate, _ = decompose_matrix(mat)

    t = np.zeros(12.)
    t[:3] = translate
    if size == 3:
        return t[:3]
    t[3: 6] = np.rad2deg(angles)
    if size == 6:
        return t[:6]
    if size == 7:
        t[6] = np.mean(scale)
        return t[:7]
    if size == 9:
        t[6:9] = scale
        return t[:9]
    if size == 12:
        t[6: 9] = scale
        t[9: 12] = shear
        return t

    raise ValueError('Size can be 3, 6, 7, 9 or 12')
 Given a 4x4 homogeneous matrix return the parameter vector

    Parameters
    -----------
    mat : array
        Homogeneous 4x4 transformation matrix
    size : int
        Size of output vector. 3 for translation, 6 for rigid, 7 for similarity
        9 for scaling and 12 for affine. Default is 12.

    Returns
    -------
    t : ndarray
        One dimensional ndarray of 6, 7, 9 or 12 affine parameters.

    
Given a 4x4 homogeneous matrix return the parameter vector
Parameters

mat : array
Homogeneous 4x4 transformation matrix
size : int
Size of output vector. 3 for translation, 6 for rigid, 7 for similarity
9 for scaling and 12 for affine. Default is 12.

Returns

t : ndarray
One dimensional ndarray of 6, 7, 9 or 12 affine parameters.
Given a 4x4 homogeneous matrix return the parameter vector Parameters mat : array Homogeneous 4x4 transformation matrix size : int Size of output vector . 3 for translation 6 for rigid 7 for similarity 9 for scaling and 12 for affine . Default is 12 . Returns t : ndarray One dimensional ndarray of 6 7 9 or 12 affine parameters .
def decompose_matrix44(mat, size=12):
    scale, shear, angles, translate, _ = decompose_matrix(mat)
    t = np.zeros(12.)
    t[:3] = translate
    if size == 3:
        return t[:3]
    t[3: 6] = np.rad2deg(angles)
    if size == 6:
        return t[:6]
    if size == 7:
        t[6] = np.mean(scale)
        return t[:7]
    if size == 9:
        t[6:9] = scale
        return t[:9]
    if size == 12:
        t[6: 9] = scale
        t[9: 12] = shear
        return t
    raise ValueError('Size can be 3, 6, 7, 9 or 12')
def decompose_matrix44 ( mat , size = 12 ) : scale , shear , angles , translate , _ = decompose_matrix ( mat ) t = np . zeros ( 12. ) t [ : 3 ] = translate if size == 3 : return t [ : 3 ] t [ 3 : 6 ] = np . rad2deg ( angles ) if size == 6 : return t [ : 6 ] if size == 7 : t [ 6 ] = np . mean ( scale ) return t [ : 7 ] if size == 9 : t [ 6 : 9 ] = scale return t [ : 9 ] if size == 12 : t [ 6 : 9 ] = scale t [ 9 : 12 ] = shear return t raise ValueError ( 'Size can be 3, 6, 7, 9 or 12' )
Given a 4x4 homogeneous matrix return the parameter vector
Parameters
Given a 4x4 homogeneous matrix return the parameter vector Parameters
""" Given a 4x4 homogeneous matrix return the parameter vector

    Parameters
    -----------
    mat : array
        Homogeneous 4x4 transformation matrix
    size : int
        Size of output vector. 3 for translation, 6 for rigid, 7 for similarity
        9 for scaling and 12 for affine. Default is 12.

    Returns
    -------
    t : ndarray
        One dimensional ndarray of 6, 7, 9 or 12 affine parameters.

    """
mat
size