slider2d: slides Semilandmarks along curves 2D by minimising bending...

View source: R/slider2d.r

slider2dR Documentation

slides Semilandmarks along curves 2D by minimising bending energy of a thin-plate spline deformation.

Description

slides Semilandmarks along curves 2D. The positions are sought by minimising bending energy (of a thin-plate spline deformation) or Procrustes distance

Usage

slider2d(
  dataframe,
  SMvector,
  outlines,
  tol = 1e-05,
  deselect = FALSE,
  recursive = TRUE,
  iterations = 0,
  initproc = FALSE,
  pairedLM = NULL,
  bending = TRUE,
  stepsize = 1,
  silent = FALSE
)

Arguments

dataframe

Input k x 2 x n real array, where k is the number of points and n is the sample size. Ideally the

SMvector

A vector containing the row indices of (semi-) landmarks on the curve(s) and surfaces that are allowed to slide

outlines

A vector (or if threre are several curves) a list of vectors (containing the rowindices) of the (Semi-)landmarks forming the curve(s) in the successive position on the curve - including the beginning and end points, that are not allowed to slide.

tol

numeric: Threshold for convergence in the sliding process

deselect

Logical: if TRUE, the SMvector is interpreted as those landmarks, that are not allowed to slide.

recursive

Logical: if TRUE, during the iterations of the sliding process, the outcome of the previous iteration will be used. Otherwise the original configuration will be used in all iterations.

iterations

integer: select manually the max. number of iterations that will be performed during the sliding process (usefull, when there is very slow convergence). 0 means iteration until convergence.

initproc

requests initial Procrustes fit before sliding.

pairedLM

A X x 2 numeric matrix with the indices of the rows containing paired Landmarks. E.g. the left column contains the lefthand landmarks, while the right side contains the corresponding right hand landmarks. - This will ideally create symmetric mean to get rid of assymetry.

bending

if TRUE, bending energy will be minimized, Procrustes distance otherwise.

stepsize

integer: dampening factor for the amount of sliding. Useful to keep semi-landmarks from sliding too far off the surface. The displacement is calculated as \Upsilon = \Upsilon^0 + stepsize * UT. Default is set to 1 for bending=TRUE and 0.5 for bending=FALSE.

silent

logical: if TRUE, console output is suppressed.

Value

returns an array containing slided coorndinates in the original space - not yet processed by a Procrustes analysis.

Warning

Depending on the amount of landmarks this can use an extensive amount of your PC's resources, especially when running in parallel. As the computation time and RAM usage of matrix algebra involved is quadratic to the amount of landmarks used, doubling the amount of semi-landmarks will quadruple computation time and system resource usage. You can easily stall you computer with this function with inappropriate data.

Author(s)

Stefan Schlager

See Also

relaxLM, slider3d


zarquon42b/Morpho documentation built on Jan. 28, 2024, 2:11 p.m.