visualise differences between two superimposed sets of 3D landmarks by deforming a cubic grid based on a thin-plate spline interpolation
deformGrid3d(
matrix,
tarmatrix,
ngrid = 0,
align = FALSE,
lwd = 1,
showaxis = c(1, 2),
show = c(1, 2),
lines = TRUE,
lcol = 1,
add = FALSE,
col1 = 2,
col2 = 3,
type = c("s", "p"),
size = NULL,
pcaxis = FALSE,
ask = TRUE,
margin = 0.2,
createMesh = FALSE,
slice1 = NULL,
slice2 = NULL,
slice3 = NULL,
gridcol = 1,
gridwidth = 1,
...
)
if createMesh=TRUE
, a mesh containing spheres of reference and target as well as the displacement vectors is returned. Otherwise the knots of the displaced grid is returned.
reference matrix containing 3D landmark coordinates or mesh of class "mesh3d"
target matrix containing 3D landmark coordinates or mesh of class "mesh3d"
number of grid lines to be plotted; ngrid=0 suppresses grid creation.
logical: if TRUE, tarmatrix
will be aligned rigidly to matrix
width of lines connecting landmarks.
integer (vector): which dimensions of the grid to be plotted. Options are combinations of 1,2 and 3.
integer (vector): if c(1:2) both configs will be plotted, show = 1 only plots the reference and show = 2 the target
logical: if TRUE, lines between landmarks will be plotted.
color of lines
logical: add to existing rgl window.
color of "matrix"
color of "tarmat"
"s" renders landmarks as spheres; "p" as points - much faster for very large pointclouds.
control size/radius of points/spheres
logical: align grid by shape's principal axes.
logical: if TRUE for > 1000 coordinates the user will be asked to prefer points over spheres.
margin around the bounding box to draw the grid
logical: if TRUE, a triangular mesh of spheres and displacement vectors (can take some time depending on number of reference points and grid density).
integer or vector of integers: select slice(s) for the dimensions
integer or vector of integers: select slice(s) for the dimensions
integer or vector of integers: select slice(s) for the dimensions
define color of grid
integer: define linewidth of grid
additional parameters passed to rotonto
in case align=TRUE
Stefan Schlager
tps3d
if (interactive()){
data(nose)
deformGrid3d(shortnose.lm,longnose.lm,ngrid=10)
## select some slices
deformGrid3d(shortnose.lm,longnose.lm,showaxis=1:3,ngrid=10,slice1=2,slice2=5,slice3=7)
}
Run the code above in your browser using DataLab