![]() |
ImFusion SDK 4.3
|
#include <ImFusion/US/MotionTrajectoryModel.h>
Base class for helper classes modeling arbitrary motion trajectories using various parameterization methods. More...
Inheritance diagram for MotionTrajectoryModel: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 | |
| Configurable & | operator= (const Configurable &) |
| Configurable & | operator= (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< Param > | m_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. | |
|
explicit |
| size | The number of frames in the motion sequence. |
|
pure virtual |
Returns the name of the current motion model.
Implemented in ComposedMotionModel, EveryFrameModel, GatingMotionModel, KeyframeMotionModel, ParametricMotionModel, PiecewiseMotionModel, and SimpleMotionModel.
|
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.
|
virtual |
Reimplemented in ComposedMotionModel, and PiecewiseMotionModel.
|
virtual |
Reimplemented in ComposedMotionModel, EveryFrameModel, PiecewiseMotionModel, and SimpleMotionModel.
|
pure virtual |
Computes a set of m_size matrices describing the intended motion trajectory.
Implemented in ComposedMotionModel, EveryFrameModel, GatingMotionModel, KeyframeMotionModel, ParametricMotionModel, PiecewiseMotionModel, and SimpleMotionModel.
|
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.
| mat | Pose waypoints as 4x4 matrices, using the TOWORLD convention. |
Implemented in ComposedMotionModel, EveryFrameModel, GatingMotionModel, KeyframeMotionModel, ParametricMotionModel, PiecewiseMotionModel, and SimpleMotionModel.
| 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.
| relShiftBefore | 4x4 transformation matrix representing the relative shift. |
|
overridevirtual |
Sets one or multiple properties.
The following property parameters may be serialized:
Reimplemented from Configurable.
Reimplemented in ParametricMotionModel, and SimpleMotionModel.
|
overridevirtual |
Retrieve the properties of this object.
The following property parameters may be deserialized:
Reimplemented from Configurable.
Reimplemented in ParametricMotionModel, and SimpleMotionModel.
|
static |
Returns a list of supported motion models.
|
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.