Description Usage Arguments Value Note References See Also Examples
View source: R/statismoBuildConditionalModel.r
generate a statistical model using an array of superimposed landmarks
1 2 | statismoBuildConditionalModel(x, representer, sigma = 0, scale = FALSE,
trainingData, conditioningData, surrogateInfo, exVar = 1)
|
x |
array of aligned 3D-coordinates or a list of aligned registered meshes. |
representer |
matrix or triangular mesh of class "mesh3d" with vertices corresponding to rows in the array. |
sigma |
noise in the data |
scale |
logical: set to TRUE, if scaling was involved in the registration. |
trainingData |
a numeric matrix containing categorial variables (as integers) and continuous variables for each sample in |
conditioningData |
a numeric vector of length |
surrogateInfo |
a numeric vector of zeros and ones coding wether the variables in the i-th column of |
exVar |
with 0 < exVar <= 1. Allows to reduce the model according to the variance explained. |
an statistical model of class pPCA (pPCA-class
)
If you want to use a data.frame of mixed variables, you can use the helper function manageConditioningData to extract and convert the information to accomodate the necesseties of the function.
R. Blanc, M. Reyes, C. Seiler and G. Szekely. 2009. Conditional Variability of Statistical Shape Models Based on Surrogate Variables. In Proc. MICCAI 2009
pPCA, pPCA-class, rigidAlign, meshalign, manageConditioningData
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | require(Morpho)
data(boneData)
align <- rigidAlign(boneLM)$rotated
pop <- name2factor(boneLM,which=3)
##prepare data
conddata <- manageConditioningData(pop)
##now condition the model to Chinese
condmod <- statismoBuildConditionalModel(align,trainingData=conddata$trainingData,
conditioningData=1, surrogateInfo=conddata$surrogateInfo)
##now the mean of this model corresponds to the shape of the average Chinese
chinmean <- apply(align[,,pop=="ch"],1:2,mean)
modmean <- DrawMean(condmod)
stopifnot(all.equal(chinmean, modmean,tolerance = 1e-6,check.attributes = FALSE))
## Not run:
deformGrid3d(chinmean,modmean)
## save it
statismoSaveModel(condmod,"condmod.h5")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.