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

#include <NegJacobianConstraint.h>

Inheritance diagram for mirtk::NegJacobianConstraint:
Inheritance graph
Collaboration diagram for mirtk::NegJacobianConstraint:
Collaboration graph

Public Member Functions

virtual double DerivativeWrtJacobianDet (double det) const
 Evaluate derivative of penalty w.r.t. Jacobian determinant value.
 
 NegJacobianConstraint (const char *="", bool=true)
 Constructor.
 
virtual ParameterList Parameter () const
 Get parameter key/value as string map.
 
virtual double Penalty (double det) const
 Evaluate penalty at control point location given Jacobian determinant value.
 
virtual ~NegJacobianConstraint ()
 Destructor.
 
- Public Member Functions inherited from mirtk::JacobianConstraint
virtual void Initialize ()
 Initialize energy term once input and parameters have been set.
 
 mirtkPublicAttributeMacro (SubDomainEnum, SubDomain)
 Sub-domain on which to evaluate penalty.
 
 mirtkPublicAttributeMacro (bool, WithRespectToWorld)
 
 mirtkPublicAttributeMacro (bool, UseLatticeSpacing)
 Whether to use control point spacing when derivatives are computed w.r.t. world coordinates.
 
 mirtkPublicAttributeMacro (bool, Symmetric)
 Whether to apply symmetric penalty in case of SVFFD model (default: true)
 
 mirtkReadOnlyAttributeMacro (bool, ConstrainParameterization)
 
virtual void Update (bool=true)
 Update internal state upon change of input.
 
virtual void WriteDataSets (const char *, const char *, bool=true) const
 Write Jacobian determinant.
 
virtual void WriteGradient (const char *, const char *) const
 Write gradient of penalty term.
 
virtual ~JacobianConstraint ()
 Destructor.
 
- Public Member Functions inherited from mirtk::TransformationConstraint
virtual ~TransformationConstraint ()
 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)
 
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 ~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 bool SetWithoutPrefix (const char *, const char *)
 Set parameter value from string.
 
virtual bool SetWithPrefix (const char *, const char *)
 Set parameter value from string.
 
- Protected Member Functions inherited from mirtk::JacobianConstraint
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.
 
 JacobianConstraint (const char *, bool=false)
 Constructor.
 
- Protected Member Functions inherited from mirtk::TransformationConstraint
const FreeFormTransformationFFD () const
 Get transformation as free-form deformation or NULL if it is none.
 
const MultiLevelTransformationMFFD () const
 Get transformation as multi-level transformation or NULL if it is none.
 
TransformationConstraintoperator= (const TransformationConstraint &)
 Assignment operator.
 
template<class TransformationType >
const TransformationTypeTransformationAs () const
 Get transformation as specific type or NULL if dynamic cast fails.
 
 TransformationConstraint (const char *="", double=1.0)
 Constructor.
 
 TransformationConstraint (const TransformationConstraint &)
 Copy constructor.
 
void WriteFFDGradient (const char *, const FreeFormTransformation *, const double *) const
 Write gradient of penalty term w.r.t. control point parameters.
 
- Protected Member Functions inherited from mirtk::EnergyTerm
 EnergyTerm (const char *="", double=1.0)
 Constructor.
 
 EnergyTerm (const EnergyTerm &)
 Copy constructor.
 
EnergyTermoperator= (const EnergyTerm &)
 Assignment operator.
 
- 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

- Public Types inherited from mirtk::JacobianConstraint
enum  SubDomainEnum { SD_Image, SD_Lattice, SD_SubDiv, SD_Shifted }
 Enumeration of target image sub-domains on which to evaluate penalty. More...
 
- Public Types inherited from mirtk::EnergyTerm
typedef ObjectFactory< enum EnergyMeasure, EnergyTermFactoryType
 Type of energy term factory.
 
- Static Public Member Functions inherited from mirtk::TransformationConstraint
static TransformationConstraintNew (ConstraintMeasure, const char *="", double=1.0)
 Instantiate new transformation constraint of given kind.
 
- 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)
 
- Protected Attributes inherited from mirtk::JacobianConstraint
Matrix_AdjJacobian
 Adjugate of Jacobian at each control point.
 
double * _DetJacobian
 Determinant of Jacobian at each control point.
 
Array< Matrix_MatL2W
 Sub-domain lattice coordinates to world.
 
Array< Matrix_MatW2L
 World to sub-domain lattice coordinates.
 
int _NumJacobian
 Number of allocated Jacobian matrices.
 
Array< ImageAttributes_SubDomains
 Discrete sub-domain over which to integrate penalty.
 

Detailed Description

Penalize small and negative Jacobian determinant values of parameterization

This constraint prevents folding of the transformation parameterization, i.e., either of the control point displacements or velocities. It preserves topology in case of a classic FFD model and is in this case identical to the TopologyPreservationConstraint. For the SVFFD model, it penalizes small and negative Jacobian determinant values of the velocity field, not the displacement field generated by this stationary velocity field.

This Jacobian based transformation constraint is based on the original IRTK implementation, but not identical. When the Jacobian determinant value is smaller than a small value, _Epsilon, the penalty function is a linear function instead, which is a continuation of the penalty function used for determinant values in the range _Epsilon < det(J) < _Gamma. The slope of this linear function corresponds to the derivative of the penalty at _Epsilon. The problem with the IRTK implementation is that the penalty decreases again for negative values before increasing slowly quadratically. It is further undefined for zero determinant values. This is because the penalty function adopted from Edwards et al. (1998) is only defined for positive values.

Edwards et al. (1998). A three-component deformation model for image-guided surgery. Medical Image Analysis, 2(4), 355–367. https://doi.org/10.1016/S1361-8415(98)80016-9

Rueckert et al. (2006). Diffeomorphic registration using B-splines. MICCAI, 702–709.

Definition at line 56 of file NegJacobianConstraint.h.


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