entente.landmarks.landmarker module

Functions for transferring landmarks from one mesh to another.

This module requires libspatialindex and rtree. See note in trimesh_search.py.

class entente.landmarks.landmarker.Landmarker(source_mesh, landmarks)[source]

Bases: object

An object which encapsulates a source mesh and a set of landmarks on that mesh. Its function is to transfer those landmarks onto a new mesh.

The resultant landmarks will always be on or near the surface of the mesh.

Parameters:
  • source_mesh (lace.mesh.Mesh) – The source mesh
  • landmarks (dict) – A mapping of landmark names to the points, which are 3x1 arraylike objects.
classmethod load(source_mesh_path, landmark_path)[source]

Create a landmarker using the given paths to a source mesh and landmarks.

Parameters:
  • source_mesh_path (str) – File path to the source mesh.
  • landmark_path (str) – File path to a meshlab .pp file containing the landmark points.
transfer_landmarks_onto(target)[source]

Transfer landmarks onto the given target mesh, which must be in the same topology as the source mesh.

Parameters:target (lace.mesh.Mesh) – Target mesh
Returns:A mapping of landmark names to a np.ndarray with shape 3x1.
Return type:dict