Skip to content

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.

ArgumentTypeRequiredDescription
publicAPIYesobject on which methods will be bounds (public)
modelYesobject on which data structure will be bounds (protected)
initialValuesILandmarkTransformInitialValuesNo(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.

ArgumentTypeRequiredDescription
initialValuesILandmarkTransformInitialValuesNofor 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 onlu
  • Mode.SIMILARITY : rotation, translation and isotropic scaling
  • Mode.AFFINE : collinearity is preserved. Ratios of distances along a line are preserved.
ArgumentTypeRequiredDescription
modeModeYesThe value of mode.

setSourceLandmark ​

Set list of 3D points which defines the source points.

ArgumentTypeRequiredDescription
sourceLandmarkvtkPointsYes

setTargetLandmark ​

Set list of 3D points which defines the target points.

ArgumentTypeRequiredDescription
targetLandmarkvtkPointsYes

update ​

Launch the computation of the matrix according to target and source points.