navis.transforms.thinplate.TPStransform¶
- class navis.transforms.thinplate.TPStransform(landmarks_source, landmarks_target)[source]¶
Thin Plate Spline transforms of 3D spatial data.
- Parameters:
landmarks_source ((M, 3) numpy array) – Source landmarks as x/y/z coordinates.
landmarks_target ((M, 3) numpy array) – Target landmarks as x/y/z coordinates.
Examples
>>> from navis import transforms >>> import numpy as np >>> # Generate some mock landmarks >>> src = np.array([[0, 0, 0], [10, 10, 10], [100, 100, 100], [80, 10, 30]]) >>> trg = np.array([[1, 15, 5], [9, 18, 21], [80, 99, 120], [5, 10, 80]]) >>> tr = transforms.thinplate.TPStransform(src, trg) >>> points = np.array([[0, 0, 0], [50, 50, 50]]) >>> tr.xform(points) array([[ 1. , 15. , 5. ], [40.55555556, 54. , 65. ]])
Initialize class.
Methods
__init__
(landmarks_source, landmarks_target)Initialize class.
append
(other)Append another transform to this one.
check_if_possible
([on_error])Test if running the transform is possible.
copy
()Make copy.
xform
(points)Transform points.
Attributes
A
W