require(rgl)
data(nose)
### relax shornose against longnose
# define fix landmarks
fix <- c(1:5,20:21)
# define surface patch by specifying row indices of matrices
# all except those defined as fix
surp <- c(1:dim(shortnose.lm)[1])[-fix]
## to reduce this example's computation time,
# we only use the right hand semi-landmarks
# (which keeps the left hand ones fix)
surp <- surp[1:316]
relax <- relaxLM(shortnose.lm[1:323, ],
longnose.lm[1:323, ], mesh=shortnose.mesh, iterations=1,
SMvector=fix, deselect=TRUE, surp=surp)
# visualize differences red=before and green=after sliding
deformGrid3d(shortnose.lm[1:323, ], relax, ngrid=0)
# add surface
wire3d(shortnose.mesh, col="white")
Run the code above in your browser using DataLab