statismoBuildConditionalModel: generate a statistical model using an array of superimposed...

Description Usage Arguments Value Note References See Also Examples

View source: R/statismoBuildConditionalModel.r

Description

generate a statistical model using an array of superimposed landmarks

Usage

1
2
statismoBuildConditionalModel(x, representer, sigma = 0, scale = FALSE,
  trainingData, conditioningData, surrogateInfo, exVar = 1)

Arguments

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 x

conditioningData

a numeric vector of length ncol(trainingData) containing the parameters to condition the model to

surrogateInfo

a numeric vector of zeros and ones coding wether the variables in the i-th column of trainingData is categorial or continuous. 0 = categorial, 1 = continuous.

exVar

with 0 < exVar <= 1. Allows to reduce the model according to the variance explained.

Value

an statistical model of class pPCA (pPCA-class)

Note

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.

References

R. Blanc, M. Reyes, C. Seiler and G. Szekely. 2009. Conditional Variability of Statistical Shape Models Based on Surrogate Variables. In Proc. MICCAI 2009

See Also

pPCA, pPCA-class, rigidAlign, meshalign, manageConditioningData

Examples

 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)

zarquon42b/RvtkStatismo documentation built on May 4, 2019, 9:09 p.m.