Marginalization tutorial 4

89 views
Skip to first unread message

Masu de Ridder

unread,
Nov 30, 2021, 5:53:11 AM11/30/21
to scalismo
Dear Scalismo,

I was wondering if the following part of tutorial 4 is still possible? This part has been removed in newer versions of the tutorial and I have not yet been able to do this in Scalismo.

val middleNose = referencePointSet.point(PointId(8152))
val nosePtIDs : Iterator[PointId] = referencePointSet.pointsWithId
.filter( ptAndId => { // yields tuples with point and ids
val (pt, id) = ptAndId
(pt - middleNose).norm > 40
})
.map(ptAndId => ptAndId._2) // extract the id's

Or is this only possible with the clip function?

Kind regards,
Masu de Ridder

Max

unread,
Nov 30, 2021, 7:18:30 AM11/30/21
to scalismo
Hi,

yes, it is still possible (btw it is Tutorial 5, not 4). What part are you struggling with?

Best
Max

Masu de Ridder

unread,
Dec 1, 2021, 8:08:06 AM12/1/21
to scalismo
Hi Max,

Thank you for the quick response, and sorry it is indeed tutorial 5!
I was able to apply the marginalization, but not when using a point distribution model. Is this possible or can I convert a PDM to a statistical Mesh Model?

Kind regards,
Masu de Ridder

Max

unread,
Dec 1, 2021, 11:24:46 AM12/1/21
to scalismo
Sure, it is possible to marginalize a PDM (see http://unibas-gravis.github.io/scalismo/latest/api/scalismo/statisticalmodel/PointDistributionModel.html). Just call pdm.marginal(nosePtIDs.toIndexedSeq) and you will get a marginalized PDM.

PDMs were introduced in Scalismo 0.90 as a generalization of StatisticalMeshModels (see this blog post from Marcel here: https://scalismo.org/blog/pdms-scalismo-090). The key difference between both representations is the domain on which they can be defined. StatisticalMeshModels strictly require a triangle mesh, while PDMs can be defined over arbitrary datasets. Both classes offer a method for marginalization.

Could you provide a small code snipped illustrating your issue?

Best
Max
Reply all
Reply to author
Forward
0 new messages