shapeworks::MeshWarper
Module: Mesh Classes
#include <MeshWarper.h>
Inherited by shapeworks::QMeshWarper
Public Functions
| Name | |
|---|---|
| void | set_reference_mesh(vtkSmartPointer< vtkPolyData > reference_mesh, const Eigen::MatrixXd & reference_particles, const Eigen::MatrixXd & landmarks ={}) Set the reference mesh and particles. |
| bool | generate_warp() Generate warp, return true on success. |
| bool | get_warp_available() Return if the warp is available. |
| bool | is_contour() const |
| vtkSmartPointer< vtkPolyData > | build_mesh(const Eigen::MatrixXd & particles) Build a mesh for a given set of particles. |
| Eigen::MatrixXd | extract_landmarks(vtkSmartPointer< vtkPolyData > warped_mesh) Return the landmarks (matrix [Nx3]) from the warped builded mesh. |
| bool | is_contour() Return if set as a contour. |
| std::map< int, int > | get_landmarks_map() const Return the map of landmarks id (Key) to vertice index (Value) |
| std::vector< int > | get_good_particle_indices() const Return the indexes of good particles (those that really control the warping) |
| const Eigen::MatrixXd & | get_warp_matrix() const Return the warp matrix. |
| bool | has_bad_particles() const Return true if warping has removed any bad particle(s) |
| vtkSmartPointer< vtkPolyData > | get_reference_mesh() Return the reference mesh which has been cleaned and vertices added. |
| const Eigen::MatrixXd & | get_reference_particles() const Return the reference particles. |
| void | set_warp_method(WarpMethod method) Set the warp method (Laplacian or Biharmonic) |
| WarpMethod | get_warp_method() const Get the current warp method. |
| int | get_num_warp_vertices() const Return the number of vertices in the warped mesh. |
Protected Functions
| Name | |
|---|---|
| virtual void | update_progress(float p) For overriding to handle progress updates. |
Detailed Description
class shapeworks::MeshWarper;
This class implements mesh warping based on correspondence particles. Correspondence points are embedded into the mesh as new vertices (triangles split). Then a deformation (Laplacian or biharmonic) is used to warp the mesh to new sets of correspondence particles.
It can optionally be used to warp landmarks along with the mesh by embedding them as vertices
Public Functions Documentation
function set_reference_mesh
void set_reference_mesh(
vtkSmartPointer< vtkPolyData > reference_mesh,
const Eigen::MatrixXd & reference_particles,
const Eigen::MatrixXd & landmarks ={}
)
Set the reference mesh and particles.
function generate_warp
bool generate_warp()
Generate warp, return true on success.
function get_warp_available
bool get_warp_available()
Return if the warp is available.
function is_contour
inline bool is_contour() const
function build_mesh
vtkSmartPointer< vtkPolyData > build_mesh(
const Eigen::MatrixXd & particles
)
Build a mesh for a given set of particles.
function extract_landmarks
Eigen::MatrixXd extract_landmarks(
vtkSmartPointer< vtkPolyData > warped_mesh
)
Return the landmarks (matrix [Nx3]) from the warped builded mesh.
function is_contour
inline bool is_contour()
Return if set as a contour.
function get_landmarks_map
inline std::map< int, int > get_landmarks_map() const
Return the map of landmarks id (Key) to vertice index (Value)
function get_good_particle_indices
inline std::vector< int > get_good_particle_indices() const
Return the indexes of good particles (those that really control the warping)
function get_warp_matrix
inline const Eigen::MatrixXd & get_warp_matrix() const
Return the warp matrix.
function has_bad_particles
inline bool has_bad_particles() const
Return true if warping has removed any bad particle(s)
function get_reference_mesh
inline vtkSmartPointer< vtkPolyData > get_reference_mesh()
Return the reference mesh which has been cleaned and vertices added.
function get_reference_particles
inline const Eigen::MatrixXd & get_reference_particles() const
Return the reference particles.
function set_warp_method
inline void set_warp_method(
WarpMethod method
)
Set the warp method (Laplacian or Biharmonic)
function get_warp_method
inline WarpMethod get_warp_method() const
Get the current warp method.
function get_num_warp_vertices
int get_num_warp_vertices() const
Return the number of vertices in the warped mesh.
Protected Functions Documentation
function update_progress
inline virtual void update_progress(
float p
)
For overriding to handle progress updates.
Reimplemented by: shapeworks::QMeshWarper::update_progress
Updated on 2026-03-13 at 00:14:03 +0000