#NEWLINE# def _as_vector( self ) : #NEWLINE# #INDENT# '\n        Return the parameters of the transform as a 1D array. These parameters\n        are parametrised as deltas from the identity warp. The parameters\n        are output in the order ``[a, b, tx, ty]``, given that\n        ``a = k cos(theta) - 1`` and ``b = k sin(theta)`` where ``k`` is a\n        uniform scale and `theta` is a clockwise rotation in radians.\n\n        **2D**\n\n        ========= ===========================================\n        parameter definition\n        ========= ===========================================\n        a         `a = k cos(theta) - 1`\n        b         `b = k sin(theta)`\n        tx        Translation in `x`\n        ty        Translation in `y`\n        ========= ===========================================\n\n        .. note::\n\n            Only 2D transforms are currently supported.\n\n        Returns\n        -------\n        params : ``(P,)`` `ndarray`\n            The values that parameterise the transform.\n\n        Raises\n        ------\n        DimensionalityError, NotImplementedError\n            If the transform is not 2D\n        ' #NEWLINE# n_dims = self . n_dims #NEWLINE# if ( n_dims == 2 ) : #NEWLINE# #INDENT# params = ( self . h_matrix - np . eye ( ( n_dims + 1 ) ) ) #NEWLINE# params = params [ : n_dims , : ] . ravel ( order = 'F' ) #NEWLINE# return params [ [ 0 , 1 , 4 , 5 ] ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( n_dims == 3 ) : #NEWLINE# #INDENT# raise NotImplementedError ( '3D similarity transforms cannot be vectorized yet.' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise ValueError ( 'Only 2D and 3D Similarity transforms are currently supported.' )