LandmarkTransform
Introduction
vtkLandmarkTransform is a cell which representant a triangle. It contains static method to make some computations directly link to triangle.
Usage
'''js import vtkLandmarkTransform from '@kitware/vtk.js/Common/Transform/LandmarkTransform';
const transform = LandmarkTransform.New(); transform.setMode(Mode.RIGID_BODY); transform.setSourceLandmark(...); // vtkPoints transform.setTargetLandmark(...); // vtkPoints transform.update(); const transformMatrix = transform.getMatrix(); '''
Methods
extend
Method used to decorate a given object (publicAPI+model) with vtkLandmarkTransform characteristics.
| Argument | Type | Required | Description |
|---|---|---|---|
publicAPI | Yes | object on which methods will be bounds (public) | |
model | Yes | object on which data structure will be bounds (protected) | |
initialValues | ILandmarkTransformInitialValues | No | (default: {}) |
getMatrix
Mat4 matrix, result of the landmark transform. If vtkLandmarkTransformed failed, default is identity.
getMode
Get the number of degrees of freedom to constrain the solution to.
getSourceLandmark
Get list of 3D points which defines the source points.
getTargetLandmark
Get list of 3D points which defines the target points.
newInstance
Method used to create a new instance of vtkLandmarkTransform.
| Argument | Type | Required | Description |
|---|---|---|---|
initialValues | ILandmarkTransformInitialValues | No | for pre-setting some of its content |
setMode
Set the number of degrees of freedom to constrain the solution to:
Mode.RIGID_BODY: Rotation and translation onluMode.SIMILARITY: rotation, translation and isotropic scalingMode.AFFINE: collinearity is preserved. Ratios of distances along a line are preserved.
| Argument | Type | Required | Description |
|---|---|---|---|
mode | Mode | Yes | The value of mode. |
setSourceLandmark
Set list of 3D points which defines the source points.
| Argument | Type | Required | Description |
|---|---|---|---|
sourceLandmark | vtkPoints | Yes |
setTargetLandmark
Set list of 3D points which defines the target points.
| Argument | Type | Required | Description |
|---|---|---|---|
targetLandmark | vtkPoints | Yes |
update
Launch the computation of the matrix according to target and source points.