ImFusion SDK 4.3
MotionTrajectoryModel Class Referenceabstract

#include <ImFusion/US/MotionTrajectoryModel.h>

Base class for helper classes modeling arbitrary motion trajectories using various parameterization methods. More...

+ Inheritance diagram for MotionTrajectoryModel:

Detailed Description

Base class for helper classes modeling arbitrary motion trajectories using various parameterization methods.

This class serves as the common interface for different motion trajectory models, each implementing a specific parameterization scheme. All models maintain a complete internal state stored in m_pars. However, they may choose to expose only a subset of these parameters to the optimizer or user interface.

Note that methods inherited from Configurable operate on the full parameter vector, regardless of which subset is exposed externally.

All poses are represented using the TOWORLD convention.

Public Types

typedef std::function< MotionTrajectoryModel *(int)> createModelFunc
 Function signature for creating a motion model with a given size.
 

Public Member Functions

 MotionTrajectoryModel (int size)
 
virtual std::string name () const =0
 Returns the name of the current motion model.
 
virtual std::vector< mat4 > defineMotion () const =0
 Computes a set of m_size matrices describing the intended motion trajectory.
 
virtual mat4 fitMatrices (const std::vector< mat4 > &mat)=0
 Fit motion parameters to a sequence of pose matrices.
 
void setRelativeShiftMatrix (const mat4 &relShiftBefore)
 Sets the relative shift matrix applied before the motion.
 
void configure (const Properties *p) override
 Sets one or multiple properties.
 
void configuration (Properties *p) const override
 Retrieve the properties of this object.
 
- Public Member Functions inherited from Configurable
virtual void configureDefaults ()
 Retrieve the properties of this object, replaces values with their defaults and sets it again.
 
void registerParameter (ParameterBase *param)
 Register the given Parameter or SubProperty, so that it will be configured during configure()/configuration().
 
void unregisterParameter (const ParameterBase *param)
 Remove the given Parameter or SubProperty from the list of registered parameters.
 
 Configurable (const Configurable &rhs)
 
 Configurable (Configurable &&rhs) noexcept
 
Configurableoperator= (const Configurable &)
 
Configurableoperator= (Configurable &&) noexcept
 

Static Public Member Functions

static std::vector< std::pair< std::string, createModelFunc > > & supportedModels ()
 Returns a list of supported motion models.
 

Protected Member Functions

std::vector< mat4 > rigidMotion (const mat4 &m0, const mat4 &m1, int startFrame=0, int endFrame=-1) const
 Helper method to interpolate a rigid motion between m0 and m1.
 

Protected Attributes

const int m_size
 Size of the model, regularly the number of frames.
 
std::vector< double > m_pars
 Full motion parameter vector - not necessarily the exposed ones.
 
mat4 m_relShift
 Generic helper matrix to incorporate optional shifts. Considered by rigidMotion().
 
- Protected Attributes inherited from Configurable
std::vector< Paramm_params
 List of all registered Parameter and SubProperty instances.
 
virtual int numberOfParameters () const
 
virtual std::vector< double > parameters () const
 
virtual void setParameters (const std::vector< double > &pars)
 

Additional Inherited Members

- Public Attributes inherited from Configurable
Signal signalParametersChanged
 Emitted whenever one of the registered Parameters' or SubPropertys' signalValueChanged signal was emitted.
 

Constructor & Destructor Documentation

◆ MotionTrajectoryModel()

MotionTrajectoryModel ( int size)
explicit
Parameters
sizeThe number of frames in the motion sequence.

Member Function Documentation

◆ name()

virtual std::string name ( ) const
pure virtual

◆ numberOfParameters()

virtual int numberOfParameters ( ) const
virtual

Accessors for the exposed parameters. Default implement access the full vector m_pars, but derived classes may choose to only expose some of them depending on some internal state.

Reimplemented in ComposedMotionModel, EveryFrameModel, and PiecewiseMotionModel.

◆ parameters()

virtual std::vector< double > parameters ( ) const
virtual

Reimplemented in ComposedMotionModel, and PiecewiseMotionModel.

◆ setParameters()

virtual void setParameters ( const std::vector< double > & pars)
virtual

◆ defineMotion()

virtual std::vector< mat4 > defineMotion ( ) const
pure virtual

Computes a set of m_size matrices describing the intended motion trajectory.

Implemented in ComposedMotionModel, EveryFrameModel, GatingMotionModel, KeyframeMotionModel, ParametricMotionModel, PiecewiseMotionModel, and SimpleMotionModel.

◆ fitMatrices()

virtual mat4 fitMatrices ( const std::vector< mat4 > & mat)
pure virtual

Fit motion parameters to a sequence of pose matrices.

Computes and sets internal parameters to approximate the given trajectory, and returns a registration matrix to align the model to the input poses.

Parameters
matPose waypoints as 4x4 matrices, using the TOWORLD convention.
Returns
Registration matrix aligning the fitted motion to the input.

Implemented in ComposedMotionModel, EveryFrameModel, GatingMotionModel, KeyframeMotionModel, ParametricMotionModel, PiecewiseMotionModel, and SimpleMotionModel.

◆ setRelativeShiftMatrix()

void setRelativeShiftMatrix ( const mat4 & relShiftBefore)

Sets the relative shift matrix applied before the motion.

Can be used to model a constant offset, such as the probe top shift in ultrasound sweeps.

Parameters
relShiftBefore4x4 transformation matrix representing the relative shift.

◆ configure()

void configure ( const Properties * p)
overridevirtual

Sets one or multiple properties.

The following property parameters may be serialized:

  • "parameters": a std::vector of parameter values.
  • "relShift": a 4x4 pose matrix representing the relative shift.

Reimplemented from Configurable.

Reimplemented in ParametricMotionModel, and SimpleMotionModel.

◆ configuration()

void configuration ( Properties * p) const
overridevirtual

Retrieve the properties of this object.

The following property parameters may be deserialized:

  • "parameters": a std::vector of parameter values.
  • "relShift": a 4x4 pose matrix representing the relative shift.

Reimplemented from Configurable.

Reimplemented in ParametricMotionModel, and SimpleMotionModel.

◆ supportedModels()

static std::vector< std::pair< std::string, createModelFunc > > & supportedModels ( )
static

Returns a list of supported motion models.

Returns
A vector of pairs, where each pair contains:
  • the name of the model
  • a function to create a model instance with a given size

◆ rigidMotion()

std::vector< mat4 > rigidMotion ( const mat4 & m0,
const mat4 & m1,
int startFrame = 0,
int endFrame = -1 ) const
protected

Helper method to interpolate a rigid motion between m0 and m1.

If startFrame and endFrame are provided, all matrices before are set to m0, all after to m1.


The documentation for this class was generated from the following file:
Search Tab / S to search, Esc to close