Building GP model correctly

50 views
Skip to first unread message

Andy Keeling

unread,
Feb 9, 2018, 9:55:42 AM2/9/18
to statismo
I am trying to create a GP model (like the femur example), for small (15mm) dental metal clasps.

I have 3D scans of a clasp before (pre) and after (post) it has been used. The clasp arm bends a little after excessive use and I planned to used Statismo to measure the amount of displacement using point-to-point correspondence.

What I did:

1) Build GP model using the 'pre' clasp: statismo-build-gp-model -r c:\clasps\pre_cocr_19_aligned.vtk -k gaussian -s 0.05 -p 0.5 -n 250 c:\clasps\GaussMod_cocr_pre_19.h5

2) Use this Gaussian to try and fit the surface of the 'post' clasp (so I have registered the two meshes) : statismo-fit-surface -i c:\clasps\gaussmod_cocr_pre_19.h5 -n 1000 -t c:\clasps\post_cocr_19_aligned.vtk -w 0 -p -o c:\clasps\fit_post_cocr_19.vtk -j c:\clasps\fit-projected_post_cocr_19.vtk

I then have a look at the resulting fit_post_cocr_19.vtk file, expecting it to match the post_cocr_19_aligned.vtk mesh (if the Gaussian Process was good), but it seems that no matter what parameters I try, it always ends up fitting the 'pre' model (on which the Gaussian was formed) ie pre_cocr_19_aligned.vtk

Questions
1) Am I misunderstanding how to check the validity of my GP ? I presume 'statismo-fit-surface' should create a version of the input mesh which has the same number of (registered) points as the model the GP was created on, BUT in the shape of the input mesh (not the shape of the GP-training mesh) ?

I had planned to use 'statismo-fit-surface' on a number of clasps, then create a PCA model for future use. However, it looks like I will just be building the PCA model on identical looking clasps (which obviously won't work).

I attach my two vtk files - the issue is that the larger 'arm' is flexed out slightly in the 'post' mesh, but every time I try to fit this surface to the GP from the pre mesh, the arm flexes back to the pre position.
I presumed that rigid registration was the way to go, because the shapes are still almost identical.
It is the movement of the tip that I am interested in.

Can anyone guide my misunderstandings? How do I generate the fit_post_cocr_19.vtk such that it matches post_cocr_19_aligned.vtk but has the same number of registered points as pre_cocr_19_aligned.vtk ?

Thanks

Andy
post_cocr_19_aligned.vtk
pre_cocr_19_aligned.vtk

Marcel Luethi

unread,
Feb 12, 2018, 9:41:55 AM2/12/18
to Andy Keeling, statismo
Dear Andy,

Sorry for the delayed response.

The approach your using looks good. I suspect that the problem is that
your model is not flexible enough. The easiest way to check the
validity of your GP model is to visualize it using the viewer
(https://github.com/statismo/statismo/wiki/Statismo%20Viewer). Once
you loaded the model, you can click on it on the scene view on the
left. You should see sliders and a random button. Pressing the random
button generates a random instance of your shape model. If all random
instances look like the reference shape you started with, you would
have found the problem.


The important parameters are the scale of the kernel (parameter s) and
the smoothness (parameter p). You choose s as 0.05, which means that
your deformations have a variance of 0.05 mm^2 (i.e. standard
deviation of sqrt(0.05) mm). Given that your shapes are around 10 mm
long, I would think that this is too small. For the smoothness
parameter, something in the range of 1 to 10 mm is reasonable for a
shape of this size.

Best regards,

Marcel
> --
> You received this message because you are subscribed to the Google Groups
> "statismo" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to statismo-user...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Andy Keeling

unread,
Feb 14, 2018, 5:53:27 AM2/14/18
to statismo
Perfect thanks! The new parameters worked well.

I am still struggling to understand the difference in application of GP models vs PCA.

It seems that, in order to create the PCA model, we already need to have done the hard part of aligning and creating models with corresponding points.
So the GP model must be a statistical (probabilistic) model. Therefore it can be used to create new (probable) examples of similar shapes, and could also be used for shape fitting?

So my question is, having created my GP model, what do I gain by fitting,say, 10 separate real scans to this model and creating a PCA model?
Is it simply that the GP model is a guess at appropriate shape variability, and the PCA model is more accurate because of the increased sample size (from n=1 for GP, to n=10 for PCA in this case).

Thanks for the great tool BTW!

Marcel Luethi

unread,
Feb 16, 2018, 3:28:05 AM2/16/18
to Andy Keeling, statismo
Hi Andy,

Great that it works.

Regarding the difference of a GP Model to a PCA Model. A PCA model is
just a special kind of a GP model (in which the mean and covariance
function are learned from data). Learning these quantities from data
makes the model more specific to this problem. This is a huge
advantage when you have incomplete data or a lot of noise in the data.
GP Models, which are built using analytically defined covariance
functions, will do very badly in such cases.

If you are interested in learning more about the differences and the
basic ideas, you can register for our MOOC on this topic, which starts
the 26. Febrary:
https://www.futurelearn.com/courses/statistical-shape-modelling/

Best regards,

Marcel
Reply all
Reply to author
Forward
0 new messages