Public Types | Public Member Functions | Protected Member Functions | List of all members
mirtk::MeanSquaredDisplacementError Class Reference

#include <MeanSquaredDisplacementError.h>

Inheritance diagram for mirtk::MeanSquaredDisplacementError:
Inheritance graph
Collaboration diagram for mirtk::MeanSquaredDisplacementError:
Collaboration graph

Public Types

typedef RegisteredImage::DisplacementImageType DisplacementImageType
 Type of cached displacement fields.
 
typedef GenericImage< GradientTypeGradientImageType
 Type of non-parametric gradient image.
 
typedef double GradientType
 Type of non-parametric gradient components.
 
- Public Types inherited from mirtk::EnergyTerm
typedef ObjectFactory< enum EnergyMeasure, EnergyTermFactoryType
 Type of energy term factory.
 

Public Member Functions

virtual void Initialize ()
 Initialize energy term once input and parameters have been set.
 
 MeanSquaredDisplacementError (const char *="", double=1.)
 Constructor.
 
virtual void Update (bool gradient=true)
 
- Public Member Functions inherited from mirtk::DataFidelity
virtual ~DataFidelity ()
 Destructor.
 
- Public Member Functions inherited from mirtk::EnergyTerm
virtual enum EnergyMeasure EnergyMeasure () const =0
 Energy measure implemented by this term.
 
void Gradient (double *gradient, double step)
 
virtual void GradientStep (const double *gradient, double &min, double &max) const
 
double InitialValue ()
 Returns initial value of energy term.
 
void NormalizedGradient (double *gradient, double step)
 
virtual ParameterList Parameter () const
 Get parameter key/value as string map.
 
string Prefix (const char *=NULL) const
 Prefix to be used for debug output files.
 
virtual void Print (Indent=0) const
 Print debug information.
 
virtual double RawValue (double) const
 
double RawValue ()
 
void ResetInitialValue ()
 Reset initial value of energy term.
 
void ResetValue ()
 Reset cached value of energy term.
 
virtual bool Upgrade ()
 Update energy term after convergence.
 
double Value ()
 Evaluate energy term.
 
virtual void WriteDataSets (const char *, const char *, bool=true) const
 Write input of data fidelity term.
 
virtual void WriteGradient (const char *, const char *) const
 Write gradient of data fidelity term w.r.t each transformed input.
 
virtual ~EnergyTerm ()
 Destructor.
 
- Public Member Functions inherited from mirtk::Configurable
string DefaultName () const
 
virtual bool Set (const char *, const char *)
 Set parameter value from string.
 
virtual ~Configurable ()
 Destructor.
 
- Public Member Functions inherited from mirtk::Observable
void AddObserver (Observer &)
 Add observer.
 
void Broadcast (Event, const void *=NULL)
 Broadcast event to observers.
 
void ClearObservers ()
 Delete all observers.
 
void DeleteObserver (Observer &)
 Delete observer.
 
void NotifyObservers (Event, const void *=NULL)
 Notify all observers about given event if this object has changed.
 
int NumberOfObservers () const
 Number of current observers.
 
virtual ~Observable ()
 Destructor.
 
- Public Member Functions inherited from mirtk::Object
virtual const char * NameOfClass () const =0
 Get name of class, which this object is an instance of.
 
bool Parameter (const ParameterList &)
 Set parameters from name/value pairs.
 
virtual ~Object ()
 Destructor.
 

Protected Member Functions

virtual double Evaluate ()
 Compute penalty for current transformation estimate.
 
virtual void EvaluateGradient (double *, double, double)
 Compute gradient of penalty term w.r.t transformation parameters.
 
 mirtkAttributeMacro (DisplacementImageType, TargetDisplacement)
 Target displacements.
 
 mirtkAttributeMacro (DisplacementImageType, CurrentDisplacement)
 
 mirtkAttributeMacro (GradientImageType, NonParametricGradient)
 Non-parametric gradient.
 
 mirtkPublicAggregateMacro (const class Transformation, TargetTransformation)
 Target transformation.
 
 mirtkPublicAggregateMacro (DisplacementImageType, ExternalDisplacement)
 
 mirtkPublicAttributeMacro (ImageAttributes, Domain)
 Finite regular grid over which to integrate error.
 
- Protected Member Functions inherited from mirtk::DataFidelity
 DataFidelity (const char *="", double=1.0)
 Constructor.
 
 DataFidelity (const DataFidelity &)
 Copy constructor.
 
DataFidelityoperator= (const DataFidelity &)
 Assignment operator.
 
virtual bool SetWithPrefix (const char *, const char *)
 Set parameter value from string.
 
- Protected Member Functions inherited from mirtk::EnergyTerm
 EnergyTerm (const char *="", double=1.0)
 Constructor.
 
 EnergyTerm (const EnergyTerm &)
 Copy constructor.
 
EnergyTermoperator= (const EnergyTerm &)
 Assignment operator.
 
virtual bool SetWithoutPrefix (const char *, const char *)
 Set parameter value from string.
 
- Protected Member Functions inherited from mirtk::Configurable
 Configurable (const char *="")
 Constructor.
 
 Configurable (const Configurable &)
 Copy constructor.
 
string DefaultPrefix () const
 Get default object name prefix (if any)
 
bool HasName () const
 Whether this object has an explicit name.
 
bool HasPrefix () const
 Whether this object has either an explicit name or default prefix.
 
template<class T >
bool InsertWithPrefix (ParameterList &, string, T) const
 Insert parameter into name/value list with object name prefix.
 
bool InsertWithPrefix (ParameterList &, const ParameterList &) const
 Insert parameters into name/value list with object name prefix.
 
Configurableoperator= (const Configurable &)
 Assignment operator.
 
string ParameterNameWithoutPrefix (const char *) const
 Get name of parameter without object name prefix.
 
string ParameterNameWithPrefix (const string &) const
 Get name of parameter with default object name prefix.
 
string ParameterNameWithPrefix (const char *) const
 Get name of parameter with default object name prefix.
 
- Protected Member Functions inherited from mirtk::Observable
 Observable ()
 Default constructor.
 
 Observable (const Observable &)
 Copy constructor.
 
Observableoperator= (const Observable &)
 Assignment operator.
 
- Protected Member Functions inherited from mirtk::Object
template<typename... Args>
void Throw (ErrorType err, const char *func, Args... args) const
 

Additional Inherited Members

- Static Public Member Functions inherited from mirtk::EnergyTerm
static FactoryTypeFactory ()
 Get global energy term factory instance.
 
static EnergyTermNew (EnergyMeasure, const char *="", double=1.0)
 Construct new energy term.
 
static EnergyTermTryNew (EnergyMeasure, const char *="", double=1.0)
 Construct new energy term or return nullptr if term not available.
 
- Static Public Member Functions inherited from mirtk::Object
static const char * NameOfType ()
 Get name of this class type.
 
- Static Protected Member Functions inherited from mirtk::Object
template<typename... Args>
static void ThrowStatic (ErrorType err, const char *cls, const char *func, Args... args)
 

Detailed Description

Constrains displacement of each target voxel to be close to another transformation

This constraint can be used to enforce some consistency of the optimized displacements with a given mean or pre-composed target displacement. The constraint may be relaxed for voxels with a stronger misalignment.

Definition at line 37 of file MeanSquaredDisplacementError.h.

Member Function Documentation

§ mirtkAttributeMacro()

mirtk::MeanSquaredDisplacementError::mirtkAttributeMacro ( DisplacementImageType  ,
CurrentDisplacement   
)
protected

Current displacements

This displacement field is used only when the transformation requires the caching of the entire dense displacements for efficienty reasons such as the scaling and squaring of a SV FFD. When an externally computed/updated displacement field is given, it is used instead.

§ mirtkPublicAggregateMacro()

mirtk::MeanSquaredDisplacementError::mirtkPublicAggregateMacro ( DisplacementImageType  ,
ExternalDisplacement   
)
protected

Pre-computed displacements which are updated by an external process

When this displacement field is given, it is used instead of the current transformation. The external process managing the optimization has to ensure that the displacement field is updated whenever the transformation changes.

§ Update()

virtual void mirtk::MeanSquaredDisplacementError::Update ( bool  gradient = true)
virtual

Update internal state after change of DoFs

Parameters
[in]gradientWhether to also update internal state for evaluation of energy gradient. If false, only the internal state required for the energy evaluation need to be updated.

Reimplemented from mirtk::EnergyTerm.


The documentation for this class was generated from the following file: