Medical Imaging Interaction Toolkit  2024.06.00
Medical Imaging Interaction Toolkit
mitk::MVConstrainedCostFunctionDecorator Class Reference

This class is used to add constraints to any multi valued model fit cost function. More...

#include <mitkMVConstrainedCostFunctionDecorator.h>

Inheritance diagram for mitk::MVConstrainedCostFunctionDecorator:
Collaboration diagram for mitk::MVConstrainedCostFunctionDecorator:

Public Types

typedef MVConstrainedCostFunctionDecorator Self
 
typedef mitk::MVModelFitCostFunction Superclass
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::SmartPointer< const SelfConstPointer
 
typedef Superclass::SignalType SignalType
 
typedef ConstraintCheckerBase::PenaltyValueType PenaltyValueType
 
- Public Types inherited from mitk::MVModelFitCostFunction
typedef MVModelFitCostFunction Self
 
typedef itk::MultipleValuedCostFunction Superclass
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::SmartPointer< const SelfConstPointer
 
typedef ModelFitCostFunctionInterface::SignalType SignalType
 
typedef Superclass::MeasureType MeasureType
 
typedef Superclass::DerivativeType DerivativeType
 
- Public Types inherited from mitk::ModelFitCostFunctionInterface
typedef ModelFitCostFunctionInterface Self
 
typedef itk::Array< double > SignalType
 

Public Member Functions

virtual void SetWrappedCostFunction (const MVModelFitCostFunction *_arg)
 
virtual const MVModelFitCostFunctionGetWrappedCostFunction ()
 
virtual void SetConstraintChecker (const ConstraintCheckerBase *_arg)
 
virtual const ConstraintCheckerBaseGetConstraintChecker ()
 
virtual void SetFailureThreshold (PenaltyValueType _arg)
 
virtual PenaltyValueType GetFailureThreshold () const
 
virtual void SetActivateFailureThreshold (bool _arg)
 
virtual bool GetActivateFailureThreshold () const
 
virtual unsigned int GetEvaluationCount () const
 
double GetPenaltyRatio () const
 
double GetFailureRatio () const
 
ParametersType::size_type GetFailedParameter () const
 
- Public Member Functions inherited from mitk::MVModelFitCostFunction
void SetSample (const SignalType &sampleSet) override
 
MeasureType GetValue (const ParametersType &parameter) const override
 
void GetDerivative (const ParametersType &parameters, DerivativeType &derivative) const override
 
unsigned int GetNumberOfValues (void) const override
 
unsigned int GetNumberOfParameters (void) const override
 
virtual void SetModel (const ModelBase *_arg)
 
virtual const ModelBaseGetModel ()
 
virtual void SetDerivativeStepLength (double _arg)
 
virtual double GetDerivativeStepLength () const
 
- Public Member Functions inherited from mitk::ModelFitCostFunctionInterface
virtual const ModelBaseGetModel () const =0
 

Static Public Member Functions

static Pointer New ()
 

Protected Member Functions

MeasureType CalcMeasure (const ParametersType &parameters, const SignalType &signal) const override
 
 MVConstrainedCostFunctionDecorator ()
 
 ~MVConstrainedCostFunctionDecorator () override
 
- Protected Member Functions inherited from mitk::MVModelFitCostFunction
 MVModelFitCostFunction ()
 
 ~MVModelFitCostFunction () override
 
- Protected Member Functions inherited from mitk::ModelFitCostFunctionInterface
 ModelFitCostFunctionInterface ()
 
virtual ~ModelFitCostFunctionInterface ()
 

Protected Attributes

ConstraintCheckerBase::ConstPointer m_ConstraintChecker
 
MVModelFitCostFunction::ConstPointer m_WrappedCostFunction
 
PenaltyValueType m_FailureThreshold
 
bool m_ActivateFailureThreshold
 
unsigned int m_EvaluationCount
 
unsigned int m_PenaltyCount
 
unsigned int m_FailureCount
 
ParametersType::size_type m_LastFailedParameter
 
- Protected Attributes inherited from mitk::MVModelFitCostFunction
SignalType m_Sample
 

Detailed Description

This class is used to add constraints to any multi valued model fit cost function.

MVConstrainedCostFunctionDecorator is used to extend a given cost function with the functionality to regard given constraints for the measure. To add this functionality to a cost function, instantiate the decorator, set the wrapped cost function (that will be extended) and set a constraint checker that defines the type of constraints.
The decorator has a failure threshold. An evaluation can always be accounted as a failure if the sum of penalties given by the checker is greater or equal to the threshold. If the evaluation is a failure the wrapped cost function will not be evaluated. Otherwise the penalty will be added to every measure of the cost function.

Definition at line 37 of file mitkMVConstrainedCostFunctionDecorator.h.

Member Typedef Documentation

◆ ConstPointer

◆ PenaltyValueType

◆ Pointer

◆ Self

◆ SignalType

◆ Superclass

Constructor & Destructor Documentation

◆ MVConstrainedCostFunctionDecorator()

mitk::MVConstrainedCostFunctionDecorator::MVConstrainedCostFunctionDecorator ( )
inlineprotected

Definition at line 81 of file mitkMVConstrainedCostFunctionDecorator.h.

◆ ~MVConstrainedCostFunctionDecorator()

mitk::MVConstrainedCostFunctionDecorator::~MVConstrainedCostFunctionDecorator ( )
inlineoverrideprotected

Definition at line 86 of file mitkMVConstrainedCostFunctionDecorator.h.

Member Function Documentation

◆ CalcMeasure()

MeasureType mitk::MVConstrainedCostFunctionDecorator::CalcMeasure ( const ParametersType &  parameters,
const SignalType signal 
) const
overrideprotectedvirtual

◆ GetActivateFailureThreshold()

virtual bool mitk::MVConstrainedCostFunctionDecorator::GetActivateFailureThreshold ( ) const
virtual

◆ GetConstraintChecker()

virtual const ConstraintCheckerBase* mitk::MVConstrainedCostFunctionDecorator::GetConstraintChecker ( )
virtual

◆ GetEvaluationCount()

virtual unsigned int mitk::MVConstrainedCostFunctionDecorator::GetEvaluationCount ( ) const
virtual

Returns the number of evaluations done by the cost function instance since creation.

◆ GetFailedParameter()

ParametersType::size_type mitk::MVConstrainedCostFunctionDecorator::GetFailedParameter ( ) const

Returns the index of the first (in terms of index position) failed parameter in the last failed evaluation.

◆ GetFailureRatio()

double mitk::MVConstrainedCostFunctionDecorator::GetFailureRatio ( ) const

Returns the ration between evaluations that where beyond the failure thershold and all evaluation since creation of the instance. 0.0 means no evaluation was a failure (but some may be penalized); 1.0 all evaluations were failures.

◆ GetFailureThreshold()

virtual PenaltyValueType mitk::MVConstrainedCostFunctionDecorator::GetFailureThreshold ( ) const
virtual

◆ GetPenaltyRatio()

double mitk::MVConstrainedCostFunctionDecorator::GetPenaltyRatio ( ) const

Returns the ration between evaluations that were penaltized and all evaluation since creation of the instance. 0.0 means no evaluation was penalized; 1.0 all evaluations were. (evaluations that hit the failure threshold count as penalized too.)

◆ GetWrappedCostFunction()

virtual const MVModelFitCostFunction* mitk::MVConstrainedCostFunctionDecorator::GetWrappedCostFunction ( )
virtual

◆ New()

static Pointer mitk::MVConstrainedCostFunctionDecorator::New ( )
static

◆ SetActivateFailureThreshold()

virtual void mitk::MVConstrainedCostFunctionDecorator::SetActivateFailureThreshold ( bool  _arg)
virtual

◆ SetConstraintChecker()

virtual void mitk::MVConstrainedCostFunctionDecorator::SetConstraintChecker ( const ConstraintCheckerBase _arg)
virtual

◆ SetFailureThreshold()

virtual void mitk::MVConstrainedCostFunctionDecorator::SetFailureThreshold ( PenaltyValueType  _arg)
virtual

◆ SetWrappedCostFunction()

virtual void mitk::MVConstrainedCostFunctionDecorator::SetWrappedCostFunction ( const MVModelFitCostFunction _arg)
virtual

Member Data Documentation

◆ m_ActivateFailureThreshold

bool mitk::MVConstrainedCostFunctionDecorator::m_ActivateFailureThreshold
protected

Definition at line 91 of file mitkMVConstrainedCostFunctionDecorator.h.

◆ m_ConstraintChecker

ConstraintCheckerBase::ConstPointer mitk::MVConstrainedCostFunctionDecorator::m_ConstraintChecker
protected

Definition at line 88 of file mitkMVConstrainedCostFunctionDecorator.h.

◆ m_EvaluationCount

unsigned int mitk::MVConstrainedCostFunctionDecorator::m_EvaluationCount
mutableprotected

Definition at line 92 of file mitkMVConstrainedCostFunctionDecorator.h.

◆ m_FailureCount

unsigned int mitk::MVConstrainedCostFunctionDecorator::m_FailureCount
mutableprotected

Definition at line 94 of file mitkMVConstrainedCostFunctionDecorator.h.

◆ m_FailureThreshold

PenaltyValueType mitk::MVConstrainedCostFunctionDecorator::m_FailureThreshold
protected

Definition at line 90 of file mitkMVConstrainedCostFunctionDecorator.h.

◆ m_LastFailedParameter

ParametersType::size_type mitk::MVConstrainedCostFunctionDecorator::m_LastFailedParameter
mutableprotected

Definition at line 95 of file mitkMVConstrainedCostFunctionDecorator.h.

◆ m_PenaltyCount

unsigned int mitk::MVConstrainedCostFunctionDecorator::m_PenaltyCount
mutableprotected

Definition at line 93 of file mitkMVConstrainedCostFunctionDecorator.h.

◆ m_WrappedCostFunction

MVModelFitCostFunction::ConstPointer mitk::MVConstrainedCostFunctionDecorator::m_WrappedCostFunction
protected

Definition at line 89 of file mitkMVConstrainedCostFunctionDecorator.h.


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