navis.transforms.AffineTransform¶
- class navis.transforms.AffineTransform(matrix, direction='forward')[source]¶
Affine transformation of 3D spatial data.
- Parameters:
matrix ((4, 4) np.ndarray) – Affine matrix.
Examples
A simple scaling transform
>>> from navis import transforms >>> import numpy as np >>> M = np.diag([1e3, 1e3, 1e3, 1]) >>> tr = transforms.affine.AffineTransform(M) >>> points = np.array([[0, 0, 0], [1, 1, 1]]) >>> tr.xform(points) array([[ 0., 0., 0.], [1000., 1000., 1000.]])
Initialize transform.
Methods
__init__
(matrix[, direction])Initialize transform.
append
(other)Append another transform to this one.
check_if_possible
([on_error])Test if running the transform is possible.
copy
()Return copy of transform.
xform
(points[, invert])Apply transform to points.