visualise differences between two superimposed sets of 2D landmarks by deforming a square grid based on a thin-plate spline interpolation
deformGrid2d(
matrix,
tarmatrix,
ngrid = 0,
lwd = 1,
show = c(1:2),
lines = TRUE,
lcol = 1,
lty = 2,
col1 = 2,
col2 = 3,
pcaxis = FALSE,
add = FALSE,
wireframe = NULL,
margin = 0.2,
gridcol = "grey",
gridlty = 1,
cex1 = 1,
cex2 = 1,
...
)
if ngrid > 1
the coordinates of the displaced grid knots are returned.
reference matrix containing 2D landmark coordinates or mesh of class "mesh3d"
target matrix containing 2D landmark coordinates or mesh of class "mesh3d"
number of grid lines to be plotted; ngrid=0 suppresses grid creation.
width of lines connecting landmarks.
integer (vector): if c(1:2) both configs will be plotted, show = 1 only plots the reference and show = 2 the target. plotted. Options are combinations of 1,2 and 3.
logical: if TRUE, lines between landmarks will be plotted.
color of lines
line type
color of "matrix"
color of "tarmat"
logical: align grid by shape's principal axes.
logical: if TRUE, output will be drawn on existing plot.
list/vector containing row indices to be plotted as wireframe (see lineplot
.)
margin around the bounding box to draw the grid
color of the grid
linetype for grid
control size of points belonging to matrix
control size of points belonging to tarmatrix
additional parameters passed to plot
Stefan Schlager
tps3d
if (require(shapes)) {
proc <- procSym(gorf.dat)
deformGrid2d(proc$mshape,proc$rotated[,,1],ngrid=5,pch=19)
}
Run the code above in your browser using DataLab