modenaxe / msk-STAPLE

STAPLE (Shared Tools for Automatic Personalised Lower Extremity modelling) consists of a collection of methods for generating skeletal models from three-dimensional bone geometries, usually segmented from medical images. The methods are currently being expanded to create complete musculoskeletal models.
Other
59 stars 17 forks source link

[Foot sole] Prototype function review #19

Closed modenaxe closed 4 years ago

modenaxe commented 4 years ago

@renaultJB I think the convex hull method is promising. A couple of things to keep in mind:

  1. The typical geometries of the foot used as body segment is like this one: image so you do not normally need to remove the phalanges as you did on your prototype.

  2. I think the convex hull approach can work well but needs some other check to ensure robustness. The largest triangle on the convex hull not always is the one on the foot sole, so some check using directions is probably needed (see below). image

  3. For definition of the ref syst we just need the most distal point on the calcaneus and the two most distal and lat/med points on the phalanges and these points CAN be on the convex hull in my opinion. image

renaultJB commented 4 years ago

I am changing a few things, now an initial superior to inferior axis (blue arrow) is computed from the centroid of the foot triangulation (black sphere) and the centroid of the convex hull of the foot (red sphere) which is located inferiorly relative to the one of the foot. The vector connecting the two spheres is made perpendicular to the principal inertia axis of the foot (posterior to anterior axis) to get an approximate vector (blue arrow) of the normal of the largest triangle. Foot

Then the convexhull is projected on plane (a first approximation of the sole plane) perpendicular to this vector (blue arrow). The largest triangle (area-wise) is identified on the projected version of the convex hull. This allows to eliminate the selection of a large triangle that can be found on the medial side of the foot, because the area of this triangle is drastically reduced when its projected on the first guess of the sole plane. However this could be used to the orientation of the medial to lateral vector.

With this method a correct blue plane is identified for all geometries of the test set.

ToDo

Given that the points on the metatarsus are closer than with the calcaneus tip, the anterior to posterior orientation can be identified for the first inertia axis.

The next step I want to implement to get the calcaneus tip and the medial and lateral metatarsal bone tips (the three points of interest for the foot sole):

  1. Select from the longest edges those which are below a plan parallel to the one defined by the largest triangle (the start and end of those edges must be below that plan)
  2. Cluster the points defining the largest edges in 3 clusters
  3. Associate the cluster to the medial and lateral distal points of the triangles
  4. Get the points as the furthest one from the ones from the triangles -> this gives the points corresponding to the distal medial and lateral metatarsal bone tips
  5. Keep the proximal vertices of the triangle as the calcaneus tip
renaultJB commented 4 years ago

Ok with the new commit the foot function performs the requirement and appear to robustly give the bony landmarks.

With the black sphere being the heel tip, the red one the medial meta bony landmark and the blue one the lateral meta bony landmarks.

Foot2 Foot3

However the sesamoids bones ventral to the medial meta are annoying as the medial meta bony landmark is generally found on one of them by the algorithm. @modenaxe is this really important ? Does the landmark have to be on the meta ?

modenaxe commented 4 years ago

@renaultJB very nice! Sesamoid bones are not an issue. They can be removed from the stl meshes. Between today and tomorrow I will check/integrate the script in the openSim workflow and if it works close the issue. Thank you!

modenaxe commented 4 years ago

Ok, it worked very well on all the datasets I have tried. It just needs a final update on the ref system but I think I can handle that. Well done @renaultJB !