Closed modenaxe closed 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.
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.
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):
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.
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 ?
@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!
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 !
@renaultJB I think the convex hull method is promising. A couple of things to keep in mind:
The typical geometries of the foot used as body segment is like this one: so you do not normally need to remove the phalanges as you did on your prototype.
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).
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.