def save(self, filename):
        """Save the RigidTransform to a file.

        The file format is:
        from_frame
        to_frame
        translation (space separated)
        rotation_row_0 (space separated)
        rotation_row_1 (space separated)
        rotation_row_2 (space separated)

        Parameters
        ----------
        filename : :obj:`str`
            The file to save the transform to.

        Raises
        ------
        ValueError
            If filename's extension isn't .tf.
        """
        file_root, file_ext = os.path.splitext(filename)
        if file_ext.lower() != TF_EXTENSION:
            raise ValueError('Extension %s not supported for RigidTransform. Must be stored with extension %s' %(file_ext, TF_EXTENSION))

        f = open(filename, 'w')
        f.write('%s\n' %(self._from_frame))
        f.write('%s\n' %(self._to_frame))
        f.write('%f %f %f\n' %(self._translation[0], self._translation[1], self._translation[2]))
        f.write('%f %f %f\n' %(self._rotation[0, 0], self._rotation[0, 1], self._rotation[0, 2]))
        f.write('%f %f %f\n' %(self._rotation[1, 0], self._rotation[1, 1], self._rotation[1, 2]))
        f.write('%f %f %f\n' %(self._rotation[2, 0], self._rotation[2, 1], self._rotation[2, 2]))
        f.close()
def save ( self , filename ) : file_root , file_ext = os . path . splitext ( filename ) if file_ext . lower ( ) != TF_EXTENSION : raise ValueError ( 'Extension %s not supported for RigidTransform. Must be stored with extension %s' % ( file_ext , TF_EXTENSION ) ) f = open ( filename , 'w' ) f . write ( '%s\n' % ( self . _from_frame ) ) f . write ( '%s\n' % ( self . _to_frame ) ) f . write ( '%f %f %f\n' % ( self . _translation [ 0 ] , self . _translation [ 1 ] , self . _translation [ 2 ] ) ) f . write ( '%f %f %f\n' % ( self . _rotation [ 0 , 0 ] , self . _rotation [ 0 , 1 ] , self . _rotation [ 0 , 2 ] ) ) f . write ( '%f %f %f\n' % ( self . _rotation [ 1 , 0 ] , self . _rotation [ 1 , 1 ] , self . _rotation [ 1 , 2 ] ) ) f . write ( '%f %f %f\n' % ( self . _rotation [ 2 , 0 ] , self . _rotation [ 2 , 1 ] , self . _rotation [ 2 , 2 ] ) ) f . close ( )
Save the RigidTransform to a file.

        The file format is:
        from_frame
        to_frame
        translation (space separated)
        rotation_row_0 (space separated)
        rotation_row_1 (space separated)
        rotation_row_2 (space separated)

        Parameters
        ----------
        filename : :obj:`str`
            The file to save the transform to.

        Raises
        ------
        ValueError
            If filename's extension isn't .tf.