data(nose)
## define some landmarks
refind <- c(1:3,4,19:20)
## use a subset of shortnose.lm as anchor points for a TPS-deformation
reflm <- shortnose.lm[refind,]
tarlm <- reflm
##replace the landmark at the tip of the nose with that of longnose.lm
tarlm[4,] <- longnose.lm[4,]
## deform a set of semilandmarks by applying a TPS-deformation
## based on 5 reference points
deformed <- tps3d(shortnose.lm, reflm, tarlm,threads=1)
if (FALSE) {
##visualize results by applying a deformation grid
deformGrid3d(shortnose.lm,deformed,ngrid = 5)
data(nose)##load data
##warp a mesh onto another landmark configuration:
longnose.mesh <- tps3d(shortnose.mesh,shortnose.lm,longnose.lm,threads=1)
require(rgl)
shade3d(longnose.mesh,col=skin1)
}
data(boneData)
## deform mesh belonging to the first specimen
## onto the landmark configuration of the 10th specimen
if (FALSE) {
warpskull <- tps3d(skull_0144_ch_fe.mesh,boneLM[,,1],
boneLM[,,10], threads=1)
## 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