Skip to content

shapeworks::MeshWarper

Module: Mesh Classes

More...

#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()
Return the map of landmarks id (Key) to vertice index (Value)
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.
vtkSmartPointer< vtkPolyData > prep_mesh(vtkSmartPointer< vtkPolyData > mesh)
Prep incoming 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 (traingles split). Then a biharmonic deformation 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()

Return the map of landmarks id (Key) to vertice index (Value)

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 prep_mesh

static vtkSmartPointer< vtkPolyData > prep_mesh(
    vtkSmartPointer< vtkPolyData > mesh
)

Prep incoming 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 2022-07-23 at 17:50:04 -0600