20 #ifndef MIRTK_JacobianConstraint_H 21 #define MIRTK_JacobianConstraint_H 23 #include "mirtk/TransformationConstraint.h" 25 #include "mirtk/Matrix.h" 26 #include "mirtk/GenericImage.h" 32 class FreeFormTransformation;
125 virtual void Update(
bool =
true);
130 virtual double Penalty(
double det)
const = 0;
151 virtual void WriteDataSets(
const char *,
const char *,
bool =
true)
const;
154 virtual void WriteGradient(
const char *,
const char *)
const;
172 default: str =
"Unknown";
break;
182 if (lstr ==
"image" || lstr ==
"target" || lstr ==
"imagelattice") {
184 }
else if (lstr ==
"lattice" || lstr ==
"ffd" || lstr ==
"ffdlattice" || lstr ==
"cp" || lstr ==
"cps" || lstr ==
"controlpoints") {
186 }
else if (lstr ==
"shifted" || lstr ==
"betweencontrolpoints") {
188 }
else if (lstr ==
"subdiv" || lstr ==
"subdivided" || lstr ==
"subdividedlattice") {
199 #endif // MIRTK_JacobianConstraint_H virtual void WriteGradient(const char *, const char *) const
Write gradient of penalty term.
Array< Matrix > _MatL2W
Sub-domain lattice coordinates to world.
Evaluate penalty at subdivided control point lattice.
Evaluate penalty in-between control points.
int _NumJacobian
Number of allocated Jacobian matrices.
Array< ImageAttributes > _SubDomains
Discrete sub-domain over which to integrate penalty.
Matrix * _AdjJacobian
Adjugate of Jacobian at each control point.
virtual double Evaluate()
Compute penalty for current transformation estimate.
Array< Pair< string, string > > ParameterList
Ordered list of parameter name/value pairs.
virtual ~JacobianConstraint()
Destructor.
virtual void Initialize()
Initialize energy term once input and parameters have been set.
mirtkPublicAttributeMacro(SubDomainEnum, SubDomain)
Sub-domain on which to evaluate penalty.
mirtkReadOnlyAttributeMacro(bool, ConstrainParameterization)
string ToLower(const string &)
Convert string to lowercase letters.
virtual void Update(bool=true)
Update internal state upon change of input.
JacobianConstraint(const char *, bool=false)
Constructor.
virtual ParameterList Parameter() const
Get parameter key/value as string map.
virtual void EvaluateGradient(double *, double, double)
Compute gradient of penalty term w.r.t transformation parameters.
virtual void WriteDataSets(const char *, const char *, bool=true) const
Write Jacobian determinant.
SubDomainEnum
Enumeration of target image sub-domains on which to evaluate penalty.
Evaluate penalty at control points.
string ToString(const EnergyMeasure &value, int w, char c, bool left)
Convert energy measure enumeration value to string.
bool FromString(const char *str, EnergyMeasure &value)
Convert energy measure string to enumeration value.
double * _DetJacobian
Determinant of Jacobian at each control point.
virtual double DerivativeWrtJacobianDet(double det) const =0
Evaluate penalty at image voxels.
virtual bool SetWithoutPrefix(const char *, const char *)
Set parameter value from string.
Array< Matrix > _MatW2L
World to sub-domain lattice coordinates.
virtual double Penalty(double det) const =0