FREE::ConstrainedMetricInterface Class Reference
[Setup optimization metric]

This class is used to add constraints to a metric. More...

#include <freConstrainedMetricInterface.h>

Inheritance diagram for FREE::ConstrainedMetricInterface:

Inheritance graph
FREE::ConstrainedAccuracySOMetric\< VImageDimension \>FREE::ConstrainedImageClassificationSOMetric\< VImageDimension \>FREE::ConstrainedImageDifferenceSOMetric\< VImageDimension \>
[legend]
Collaboration diagram for FREE::ConstrainedMetricInterface:

Collaboration graph
FREE::SetupParameterConstraintsFREE::SmartCollectionBase\< FREE::SetupParameterConstraint \>FREE::CollectionBase\< TElement, itk::SmartPointer\< TElement \> \>
[legend]

List of all members.

Public Member Functions

virtual const char * GetNameOfClass () const
void ResetConstraints ()
void AddConstraint (const SetupParameterConstraint &constraint, double dBarrierSize)
void SetMaxConstraintPenalty (double dPenalty)
double GetMaxConstraintPenalty ()
virtual unsigned int GetNumberOfConstrainedValues (void) const
void SetFailureThreshold (double dThreshold)
double GetFailureThreshold ()

Protected Types

typedef
SetupOptimizationMetric::ParametersType 
CnstrParametersType
typedef
SetupOptimizationMetric::DecomposedMeasureType 
CnstrDecomposedMeasureType

Protected Member Functions

 ConstrainedMetricInterface ()
bool ComputeConstraintPenalties (const CnstrParametersType &parameters, CnstrDecomposedMeasureType &penalties) const
double ComputeConstraintPenalty (const unsigned int iConstraintID, const CnstrParametersType &parameters) const

Protected Attributes

SetupParameterConstraints m_Constraints
std::vector< double > m_BarrierSizes
double m_MaxConstraintPenalty
double m_FailureThreshold


Detailed Description

This class is used to add constraints to a metric.

ConstrainedMetricInterface is used to extend a given metric with the functionality to regard given constraints for the objective value. To add this functionality to a metric, the metric has to be derived with ConstrainedMetricInterface as one of the base classes (e.g. see ConstrainedAccuracySetupOptimizationMetric) and ComputeConstraintPenalties should be used when computing the measurement.
The basic objectiv function can be modified by additional constraints, which can be handled as barrier functions.
Equality constraints will result 0 as long as the constraint is met. Otherwise they will result MaxConstraintPenalty.
Inequality constraints will be transformed to an inequality greater or equal zero (c(x)>= 0). The BarrierSize indicates the size of the region in front of the border of the legal value range. The barrier function is modelled by log(c(x)/BarrierSize). Example:
The given constraint is 500<= param_1. Its barriersize is 50, so the barrier region is between 500 and 550.
The constraint will be transformed in 0 <= param_1 - 500. The barrier function will 0 for any param_1 > 550 and min(-log((param_1 - 500)/50), MaxConstraintPenalty) for any other value of param_1.
A constrained metric can also have a failure threshold. An evaluation can always be accounted as a failure if the sum of computed constrained penalties is greater or equal to the threshold. If the evaluation is a failure the return of ComputeConstraintPenalties is false. Metrics implementing this interface can in this case skip the real evaluation. A threshold of 0 or less indicates that the metric should not care about the failure threshold.

Definition at line 66 of file freConstrainedMetricInterface.h.


Member Typedef Documentation

typedef SetupOptimizationMetric::ParametersType FREE::ConstrainedMetricInterface::CnstrParametersType [protected]

Standard class typedefs.

Definition at line 84 of file freConstrainedMetricInterface.h.

typedef SetupOptimizationMetric::DecomposedMeasureType FREE::ConstrainedMetricInterface::CnstrDecomposedMeasureType [protected]

Definition at line 89 of file freConstrainedMetricInterface.h.


Constructor & Destructor Documentation

FREE::ConstrainedMetricInterface::ConstrainedMetricInterface (  )  [protected]

Definition at line 167 of file freConstrainedMetricInterface.cxx.

References m_FailureThreshold, m_MaxConstraintPenalty, and ResetConstraints().

Here is the call graph for this function:

FREE::ConstrainedMetricInterface::ResetConstraintsFREE::CollectionBase::Reset


Member Function Documentation

virtual const char* FREE::ConstrainedMetricInterface::GetNameOfClass (  )  const [inline, virtual]

Reimplemented in FREE::ConstrainedAccuracySOMetric< VImageDimension >, FREE::ConstrainedImageClassificationSOMetric< VImageDimension >, and FREE::ConstrainedImageDifferenceSOMetric< VImageDimension >.

Definition at line 69 of file freConstrainedMetricInterface.h.

void FREE::ConstrainedMetricInterface::ResetConstraints (  ) 

Resets the list of constraints.

Definition at line 33 of file freConstrainedMetricInterface.cxx.

References m_BarrierSizes, m_Constraints, and FREE::CollectionBase< TElement, TStorageType >::Reset().

Referenced by FREE::ConstrainedAccuracySOMetric< VImageDimension >::ConstrainedAccuracySOMetric(), FREE::ConstrainedImageClassificationSOMetric< VImageDimension >::ConstrainedImageClassificationSOMetric(), FREE::ConstrainedImageDifferenceSOMetric< VImageDimension >::ConstrainedImageDifferenceSOMetric(), and ConstrainedMetricInterface().

Here is the call graph for this function:

FREE::CollectionBase::Reset

void FREE::ConstrainedMetricInterface::AddConstraint ( const SetupParameterConstraint constraint,
double  dBarrierSize 
)

Adds a constraint to the metric.

Definition at line 42 of file freConstrainedMetricInterface.cxx.

References FREE::SmartCollectionBase< TElement >::AddElement(), m_BarrierSizes, and m_Constraints.

Referenced by FREE::ConstrainedImageDifferenceSOMetricControllerBase< FREE::ConstrainedImageDifferenceSOMetric< 2 > >::ActualizeMainComponent(), FREE::ConstrainedImageClassificationSOMetricControllerBase< FREE::ConstrainedImageClassificationSOMetric< 2 > >::ActualizeMainComponent(), and FREE::ConstrainedAccuracySOMetricControllerBase< FREE::ConstrainedAccuracySOMetric< 3 > >::ActualizeMainComponent().

Here is the call graph for this function:

FREE::SmartCollectionBase::AddElement

void FREE::ConstrainedMetricInterface::SetMaxConstraintPenalty ( double  dPenalty  )  [inline]

Definition at line 78 of file freConstrainedMetricInterface.h.

Referenced by FREE::ConstrainedImageDifferenceSOMetricControllerBase< FREE::ConstrainedImageDifferenceSOMetric< 2 > >::ActualizeMainComponent(), FREE::ConstrainedImageClassificationSOMetricControllerBase< FREE::ConstrainedImageClassificationSOMetric< 2 > >::ActualizeMainComponent(), and FREE::ConstrainedAccuracySOMetricControllerBase< FREE::ConstrainedAccuracySOMetric< 3 > >::ActualizeMainComponent().

double FREE::ConstrainedMetricInterface::GetMaxConstraintPenalty (  )  [inline]

Definition at line 79 of file freConstrainedMetricInterface.h.

virtual unsigned int FREE::ConstrainedMetricInterface::GetNumberOfConstrainedValues ( void   )  const [inline, virtual]

Definition at line 81 of file freConstrainedMetricInterface.h.

void FREE::ConstrainedMetricInterface::SetFailureThreshold ( double  dThreshold  )  [inline]

Definition at line 83 of file freConstrainedMetricInterface.h.

Referenced by FREE::ConstrainedImageDifferenceSOMetricControllerBase< FREE::ConstrainedImageDifferenceSOMetric< 2 > >::ActualizeMainComponent(), FREE::ConstrainedImageClassificationSOMetricControllerBase< FREE::ConstrainedImageClassificationSOMetric< 2 > >::ActualizeMainComponent(), and FREE::ConstrainedAccuracySOMetricControllerBase< FREE::ConstrainedAccuracySOMetric< 3 > >::ActualizeMainComponent().

double FREE::ConstrainedMetricInterface::GetFailureThreshold (  )  [inline]

Definition at line 84 of file freConstrainedMetricInterface.h.

bool FREE::ConstrainedMetricInterface::ComputeConstraintPenalties ( const CnstrParametersType parameters,
CnstrDecomposedMeasureType penalties 
) const [protected]

This function computes the penalties by calling ComputeConstraintPenalty for each parameter. The computed penalties will be inserted in the passed parameter penalties.

Parameters:
[in] parameters Parameter values that should be used for computation.
[out] penalties The computed penalties in the same order like the parameters.
Returns:
Returns true if the sum of penalties is below the failure threshold. If the failure threshold is set to less or equal to 0 the return is always true.

Definition at line 51 of file freConstrainedMetricInterface.cxx.

References ComputeConstraintPenalty(), m_Constraints, m_FailureThreshold, and FREE::CollectionBase< TElement, TStorageType >::Size().

Referenced by FREE::ConstrainedImageDifferenceSOMetric< VImageDimension >::ComputeDecomposedValue(), FREE::ConstrainedImageClassificationSOMetric< VImageDimension >::ComputeDecomposedValue(), and FREE::ConstrainedAccuracySOMetric< VImageDimension >::ComputeDecomposedValue().

Here is the call graph for this function:

FREE::ConstrainedMetricInterface::ComputeConstraintPenaltyFREE::CollectionBase::SizeFREE::SetupParameterConstraint::GetConstraintTermFREE::SetupParameterConstraint::GetDestinationIDFREE::SmartCollectionBase::GetElementFREE::SetupParameterConstraint::GetRelationTypeFREE::LogExceptionFREE::Convert::ToStrFREE::LogFileController::AddDirectEntryFREE::LogFileController::AddEntryFREE::LogFileController::StartLogFREE::LogFileController::StopLogFREE::ActTimeStampToStrFREE::LogFileController::OpenLogFileFREE::LogFileController::CloseLogFile

double FREE::ConstrainedMetricInterface::ComputeConstraintPenalty ( const unsigned int  iConstraintID,
const CnstrParametersType parameters 
) const [protected]

Definition at line 72 of file freConstrainedMetricInterface.cxx.

References catchAllNPassMacro, GetClassLocationMacro, FREE::SetupParameterConstraint::GetConstraintTerm(), FREE::SetupParameterConstraint::GetDestinationID(), FREE::SmartCollectionBase< TElement >::GetElement(), FREE::SetupParameterConstraint::GetRelationType(), FREE::LogException(), m_Constraints, m_MaxConstraintPenalty, FREE::SetupParameterConstraint::RTEqual, FREE::SetupParameterConstraint::RTGreaterOrEqual, throwExceptionMacro, and FREE::Convert::ToStr().

Referenced by ComputeConstraintPenalties().

Here is the call graph for this function:

FREE::SetupParameterConstraint::GetConstraintTermFREE::SetupParameterConstraint::GetDestinationIDFREE::SmartCollectionBase::GetElementFREE::SetupParameterConstraint::GetRelationTypeFREE::LogExceptionFREE::Convert::ToStrFREE::LogFileController::AddDirectEntryFREE::LogFileController::AddEntryFREE::LogFileController::StartLogFREE::LogFileController::StopLogFREE::ActTimeStampToStrFREE::LogFileController::OpenLogFileFREE::LogFileController::CloseLogFile


Member Data Documentation

SetupParameterConstraints FREE::ConstrainedMetricInterface::m_Constraints [protected]

Definition at line 104 of file freConstrainedMetricInterface.h.

Referenced by AddConstraint(), ComputeConstraintPenalties(), ComputeConstraintPenalty(), and ResetConstraints().

std::vector<double> FREE::ConstrainedMetricInterface::m_BarrierSizes [protected]

Definition at line 105 of file freConstrainedMetricInterface.h.

Referenced by AddConstraint(), and ResetConstraints().

double FREE::ConstrainedMetricInterface::m_MaxConstraintPenalty [protected]

Definition at line 107 of file freConstrainedMetricInterface.h.

Referenced by ComputeConstraintPenalty(), FREE::ConstrainedAccuracySOMetric< VImageDimension >::ConstrainedAccuracySOMetric(), FREE::ConstrainedImageClassificationSOMetric< VImageDimension >::ConstrainedImageClassificationSOMetric(), FREE::ConstrainedImageDifferenceSOMetric< VImageDimension >::ConstrainedImageDifferenceSOMetric(), and ConstrainedMetricInterface().

double FREE::ConstrainedMetricInterface::m_FailureThreshold [protected]

Definition at line 108 of file freConstrainedMetricInterface.h.

Referenced by ComputeConstraintPenalties(), and ConstrainedMetricInterface().


The documentation for this class was generated from the following files:
Generated at Sat Oct 13 18:17:48 2007 for f.r.e.e. - Flexible Registration and Evaluation Engine by doxygen 1.5.3 written by Dimitri van Heesch, © 1997-2000