NifTK
16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
|
Abstract base class to provide functionality for adding arbitrary constraints, and also arbitrary ways of evaluating a derivative, both via Template Method pattern [2]. More...
Public Types | |
typedef ImageToImageMetricWithConstraint | Self |
typedef ImageToImageMetric < TFixedImage, TMovingImage > | Superclass |
typedef SmartPointer< Self > | Pointer |
typedef SmartPointer< const Self > | ConstPointer |
typedef itk::Constraint | ConstraintType |
typedef ConstraintType::Pointer | ConstraintPointer |
typedef MetricDerivativeBridge < TFixedImage, TMovingImage > | MetricDerivativeBridgeType |
typedef MetricDerivativeBridgeType::Pointer | MetricDerivativePointer |
typedef Superclass::MeasureType | MeasureType |
typedef Superclass::DerivativeType | DerivativeType |
typedef Superclass::ParametersType | TransformParametersType |
Public Member Functions | |
virtual const char * | GetClassName () const |
virtual void | SetDerivativeBridge (MetricDerivativeBridgeType *_arg) |
virtual MetricDerivativeBridgeType * | GetDerivativeBridge () |
virtual void | SetConstraint (ConstraintType *_arg) |
virtual ConstraintType * | GetConstraint () |
virtual void | SetWeightingFactor (double _arg) |
virtual double | GetWeightingFactor () |
virtual void | SetUseConstraintGradient (bool _arg) |
virtual bool | GetUseConstraintGradient () const |
virtual void | SetPrintOutMetricEvaluation (bool _arg) |
virtual bool | GetPrintOutMetricEvaluation () |
virtual MeasureType | GetValue (const TransformParametersType ¶meters) const |
virtual void | GetConstraintDerivative (const TransformParametersType ¶meters, DerivativeType &derivative) const |
virtual void | GetDerivative (const TransformParametersType ¶meters, DerivativeType &derivative) const |
virtual void | GetValueAndDerivative (const TransformParametersType ¶meters, MeasureType &Value, DerivativeType &derivative) const |
Protected Member Functions | |
ImageToImageMetricWithConstraint () | |
virtual | ~ImageToImageMetricWithConstraint () |
void | PrintSelf (std::ostream &os, Indent indent) const |
virtual MeasureType | GetSimilarity (const TransformParametersType ¶meters) const =0 |
virtual void | GetCostFunctionDerivative (const TransformParametersType ¶meters, DerivativeType &derivative) const =0 |
Protected Attributes | |
MetricDerivativePointer | m_DerivativeBridge |
ConstraintPointer | m_Constraint |
double | m_WeightingFactor |
bool | m_UseConstraintGradient |
bool | m_PrintOutMetricEvaluation |
Abstract base class to provide functionality for adding arbitrary constraints, and also arbitrary ways of evaluating a derivative, both via Template Method pattern [2].
We also provide a boolean to turn the gradient of the constraint off/on, as this could be expensive, and also, an independent debugging parameter. When you evaluate the similarity measure, do you want to print out the result for debugging purposes? i.e. like:
"GetValue():Actual metric value x = similarity * (1-weighting) + constraintg * (weighting)"
This may be ok for Fluid,FFD or normal affine registration where you evaluate the similarity measure once per iteration, or once + NDOF*2 if you include the finite difference derivative. But its completely useless for block matching, where you may evaluate the similarity measure (albeit on a small block) many thousands of times per iteration. So, we can't turn this feature off/on based on logging, or else you would need different logging every time you ran a block matching. We can't turn this feature off/on using the base class, or global debug flag. So, ive added a boolean m_PrintOutMetricEvaluation, which defaults to true.
typedef SmartPointer<const Self> itk::ImageToImageMetricWithConstraint< TFixedImage, TMovingImage >::ConstPointer |
typedef ConstraintType::Pointer itk::ImageToImageMetricWithConstraint< TFixedImage, TMovingImage >::ConstraintPointer |
typedef itk::Constraint itk::ImageToImageMetricWithConstraint< TFixedImage, TMovingImage >::ConstraintType |
This class enables a global constraint to be added.
typedef Superclass::DerivativeType itk::ImageToImageMetricWithConstraint< TFixedImage, TMovingImage >::DerivativeType |
typedef Superclass::MeasureType itk::ImageToImageMetricWithConstraint< TFixedImage, TMovingImage >::MeasureType |
For parameters and derivatives.
typedef MetricDerivativeBridge<TFixedImage, TMovingImage> itk::ImageToImageMetricWithConstraint< TFixedImage, TMovingImage >::MetricDerivativeBridgeType |
This class enables a derivative bridge to be added.
typedef MetricDerivativeBridgeType::Pointer itk::ImageToImageMetricWithConstraint< TFixedImage, TMovingImage >::MetricDerivativePointer |
typedef SmartPointer<Self> itk::ImageToImageMetricWithConstraint< TFixedImage, TMovingImage >::Pointer |
typedef ImageToImageMetricWithConstraint itk::ImageToImageMetricWithConstraint< TFixedImage, TMovingImage >::Self |
Standard class typedefs.
typedef ImageToImageMetric<TFixedImage, TMovingImage > itk::ImageToImageMetricWithConstraint< TFixedImage, TMovingImage >::Superclass |
typedef Superclass::ParametersType itk::ImageToImageMetricWithConstraint< TFixedImage, TMovingImage >::TransformParametersType |
|
protected |
|
inlineprotectedvirtual |
|
virtual |
Run-time type information (and related methods).
Reimplemented in itk::SimilarityMeasure< TFixedImage, TMovingImage >, itk::CRImageToImageMetric< TFixedImage, TMovingImage >, itk::PIUImageToImageMetric< TFixedImage, TMovingImage >, itk::MSDImageToImageMetric< TFixedImage, TMovingImage >, itk::RIUImageToImageMetric< TFixedImage, TMovingImage >, itk::JacobianGradientSimilarityMeasure< TFixedImage, TMovingImage >, itk::JEImageToImageMetric< TFixedImage, TMovingImage >, itk::MIImageToImageMetric< TFixedImage, TMovingImage >, itk::NCCImageToImageMetric< TFixedImage, TMovingImage >, itk::NMIImageToImageMetric< TFixedImage, TMovingImage >, itk::SADImageToImageMetric< TFixedImage, TMovingImage >, itk::SSDImageToImageMetric< TFixedImage, TMovingImage >, itk::HistogramSimilarityMeasure< TFixedImage, TMovingImage >, and itk::FiniteDifferenceGradientSimilarityMeasure< TFixedImage, TMovingImage >.
|
virtual |
|
virtual |
Takes the supplied parameters array, and a derivative array, calculate the derivative of the constraint, and ADDS it to the supplied array.
|
protectedpure virtual |
Derived classes must implement this to calculate the derivative of the cost function.
Implemented in itk::JacobianGradientSimilarityMeasure< TFixedImage, TMovingImage >.
|
virtual |
Get the derivatives of the cost function, which can include the derivative of the constraint if UseConstraintGradient is true.
Note that this method is provided here in this base class, so that potentially any registration method could use this mechanism. However, if you look at the itkFFDGradientDescentOptimizer, you will notice that the BSpline stuff doesnt call this GetDerivative. i.e. the registration is not driven by a regular optimizer that calls GetValueAndDerivative.
|
virtual |
|
virtual |
|
protectedpure virtual |
Derived classes must implement this to calculate the similarity measure.
Implemented in itk::SimilarityMeasure< TFixedImage, TMovingImage >.
|
virtual |
|
virtual |
Get the value of the cost function, which will include the weighted constraint.
|
virtual |
Simply calls GetValue and then GetDerivative, both of which could be virtual/overriden.
|
virtual |
|
protected |
|
virtual |
Set/Get an optional constraint.
|
virtual |
Methods to Set/Get an optional derivative bridge.
|
virtual |
Turn on/off the printing out of the metric evaluation. Default on.
|
virtual |
Turn the derivative of constraint on or off, as this could be very expensive.
|
virtual |
Set the weighting factor.
|
protected |
A pointer to a constraint. This can be anything that returns a simple number.
|
protected |
A pointer to a MetricDerivativeBrige which can be used to delegate to potentially anything that can evaluate the derivative of the cost function.
|
protected |
Print out the metric evaluation. Default true.
|
protected |
Turn derivative of constraint on or off. Default off.
|
protected |
The weighting between the constraint and the cost function. Default 0.01 (99% cost function).