Learn R Programming

Morpho (version 2.1)

warp.mesh: warping a mesh onto another configuration

Description

warps an the surface of a mesh3d object onto another configuration via reference and target landmark configuration by using a thin-plate spline interpolation.

Usage

warp.mesh(mesh, matr, matt, lambda = 0, updateNormals = TRUE,
  silent = FALSE)

Arguments

mesh
object of class "mesh3d"
matr
matrix of landmarks on the reference surface
matt
matrix of corresponding landmarks on the target surface
lambda
integer: regularisation parameter of the TPS.
updateNormals
Logical: requests the (re)calculation of vertex normals.
silent
logical: suppress messages.

Value

  • object of class "mesh3d"

Details

the surface is mapped via the tps3d function onto the target shape.

See Also

ply2mesh,file2mesh,mesh2ply,warpmovie3d, rotmesh.onto

Examples

Run this code
require(rgl)
data(nose)##load data
##warp a mesh onto another landmark configuration:
warpnose.long <- warp.mesh(shortnose.mesh,shortnose.lm,longnose.lm)
shade3d(warpnose.long,col=skin1)

data(boneData)
## deform mesh belonging to the first specimen
## onto the landmark configuration of the 10th specimen
warpskull <- warp.mesh(skull_0144_ch_fe.mesh,boneLM[,,1],
                     boneLM[,,10])
## render deformed mesh and landmarks
shade3d(warpskull, col=2, specular=1)
spheres3d(boneLM[,,1])
## render original mesh
shade3d(skull_0144_ch_fe.mesh, col=3, specular=1)
spheres3d(boneLM[,,10])

Run the code above in your browser using DataLab