Tutorial 4 Final Exercise

19 megtekintés
Ugrás az első olvasatlan üzenetre

Nicole Wu

olvasatlan,
2021. aug. 27. 18:46:192021. 08. 27.
– scalismo
Hi,

I just completed Tutorial 4 (Full track version). For the last exercise where it asks me to sample a random deformation and then use it to warp the reference mesh, I was able to sample the random deformation and display it, but am not sure what syntax/function to use to apply the sampled deformation field to the reference mesh. Please let me know what the appropriate code for this action should be. Thank you.

Best,
Nicole

Maia R.

olvasatlan,
2021. szept. 28. 10:06:322021. 09. 28.
– scalismo
// Get a random deformation field and apply to the reference
val sampleDeformation1 : DiscreteField[_3D, UnstructuredPointsDomain[_3D], EuclideanVector[_3D]] = faceGP.sample

// Interpolate in order to apply to a mesh
val interpolator = NearestNeighborInterpolator[_3D, EuclideanVector[_3D]]()
val continuousDeformationField1: Field[_3D, EuclideanVector[_3D] ] = sampleDeformation1.interpolate(interpolator)

// Apply continuous transformation
import scalismo.registration.Transformation

val sampleTransformation1 = Transformation( (pt: Point[_3D]) => pt + continuousDeformationField1(pt))

// Apply to faceReference
val sampleMesh = faceReference.transform(sampleTransformation1)
Válasz mindenkinek
Válasz a szerzőnek
Továbbítás
0 új üzenet