PyPO User Manual
MatTransform.py File Reference

Transformation formalism for PyPO. More...

Functions

def PyPO.MatTransform.MatRotate (theta, matAppend=None, pivot=None, radians=False)
 Generate a 3D rotation matrix and append to previous matrix. More...
 
def PyPO.MatTransform.MatTranslate (trans, matAppend=None)
 Generate a 3D translation matrix and append to previous matrix. More...
 
def PyPO.MatTransform.InvertMat (mat)
 Invert a transformation matrix, both the rotational and translational part. More...
 

Detailed Description

Transformation formalism for PyPO.

This script contains the methods for applying matrix transformations to objects.

Function Documentation

◆ InvertMat()

def PyPO.MatTransform.InvertMat (   mat)

Invert a transformation matrix, both the rotational and translational part.

Parameters
matFull 4D affine transformation matrix.
Returns
matInv Full 4D affine inverse transformation matrix.

◆ MatRotate()

def PyPO.MatTransform.MatRotate (   theta,
  matAppend = None,
  pivot = None,
  radians = False 
)

Generate a 3D rotation matrix and append to previous matrix.

The appending is done by right matrix multiplication of the old transformation matrix with the rotation matrix.

Parameters
thetaNumpy array of length 3 containing the xyz rotation angles.
matAppendThe previous matrix. Defaults to identity matrix.
pivotPivot for the rotation. Defaults to origin.
radiansWhether theta is in radians or degrees. Defaults to False (degrees).
Returns
matOut Full 4D affine transformation matrix.

◆ MatTranslate()

def PyPO.MatTransform.MatTranslate (   trans,
  matAppend = None 
)

Generate a 3D translation matrix and append to previous matrix.

The appending is done by right matrix multiplication of the old transformation matrix with the translation matrix.

Parameters
transNumpy array of length 3 containing the xyz translations, in mm.
matAppendThe previous matrix. Defaults to identity matrix.
Returns
matOut Full 4D affine transformation matrix.