if (require(shapes)) {
data <- gorf.dat
### set first landmark of first specimen to NA
data[1,,1] <- NA
repair <- fixLMtps(data,comp=5)
### view difference between estimated and actual landmark
plot(repair$out[,,1],asp=1,pch=21,cex=0.7,col=2)#estimated landmark
points(gorf.dat[,,1],col=3,pch=20)#actual landmark
}
## 3D-example:
data(boneData)
data <- boneLM
### set first and 5th landmark of first specimen to NA
data[c(1,5),,1] <- NA
repair <- fixLMtps(data,comp=10)
## view difference between estimated and actual landmark
if (FALSE) {
deformGrid3d(repair$out[,,1], boneLM[,,1],ngrid=0)
}
## Now use a gaussian kernel to compute the weights and use all other configs
gaussWeight <- function(r,sigma=0.05) {
sigma <- 2*sigma^2
return(exp(-r^2/ sigma))
}
repair <- fixLMtps(data,comp=79,weightfun=gaussWeight)
Run the code above in your browser using DataLab