Medical Imaging Interaction Toolkit  2024.06.00
Medical Imaging Interaction Toolkit
mitkMVConstrainedCostFunctionDecorator.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef mitkMVConstrainedCostFunctionDecorator_h
14 #define mitkMVConstrainedCostFunctionDecorator_h
15 
18 
19 #include "MitkModelFitExports.h"
20 
21 namespace mitk
22 {
23 
38 {
39 public:
40 
45 
46  itkNewMacro(Self);
47 
50 
51  itkSetConstObjectMacro(WrappedCostFunction, MVModelFitCostFunction);
52  itkGetConstObjectMacro(WrappedCostFunction, MVModelFitCostFunction);
53 
54  itkSetConstObjectMacro(ConstraintChecker, ConstraintCheckerBase);
55  itkGetConstObjectMacro(ConstraintChecker, ConstraintCheckerBase);
56 
57  itkSetMacro(FailureThreshold, PenaltyValueType);
58  itkGetConstMacro(FailureThreshold, PenaltyValueType);
59  itkSetMacro(ActivateFailureThreshold, bool);
60  itkGetConstMacro(ActivateFailureThreshold, bool);
61 
64  itkGetConstMacro(EvaluationCount, unsigned int);
65 
69  double GetPenaltyRatio() const;
73  double GetFailureRatio() const;
74 
76  ParametersType::size_type GetFailedParameter() const;
77 protected:
78 
79  MeasureType CalcMeasure(const ParametersType &parameters, const SignalType& signal) const override;
80 
81  MVConstrainedCostFunctionDecorator() : m_FailureThreshold(1e15), m_ActivateFailureThreshold(true),
82  m_EvaluationCount(0), m_PenaltyCount(0), m_FailureCount(0), m_LastFailedParameter(-1)
83  {
84  }
85 
87 
92  mutable unsigned int m_EvaluationCount;
93  mutable unsigned int m_PenaltyCount;
94  mutable unsigned int m_FailureCount;
95  mutable ParametersType::size_type m_LastFailedParameter;
96 };
97 
98 }
99 
100 #endif
mitk::MVConstrainedCostFunctionDecorator::Superclass
mitk::MVModelFitCostFunction Superclass
Definition: mitkMVConstrainedCostFunctionDecorator.h:42
mitkMVModelFitCostFunction.h
mitk::MVConstrainedCostFunctionDecorator::m_FailureThreshold
PenaltyValueType m_FailureThreshold
Definition: mitkMVConstrainedCostFunctionDecorator.h:90
mitk::MVConstrainedCostFunctionDecorator::m_EvaluationCount
unsigned int m_EvaluationCount
Definition: mitkMVConstrainedCostFunctionDecorator.h:92
mitk::ModelFitCostFunctionInterface::SignalType
itk::Array< double > SignalType
Definition: mitkModelFitCostFunctionInterface.h:30
mitk::MVConstrainedCostFunctionDecorator::MVConstrainedCostFunctionDecorator
MVConstrainedCostFunctionDecorator()
Definition: mitkMVConstrainedCostFunctionDecorator.h:81
mitk::ModelFitCostFunctionInterface
Definition: mitkModelFitCostFunctionInterface.h:24
mitk::MVModelFitCostFunction
Definition: mitkMVModelFitCostFunction.h:30
mitk::ConstraintCheckerBase::PenaltyValueType
Superclass::PenaltyValueType PenaltyValueType
Definition: mitkConstraintCheckerBase.h:40
MitkModelFitExports.h
mitkConstraintCheckerBase.h
mitk::MVConstrainedCostFunctionDecorator
This class is used to add constraints to any multi valued model fit cost function.
Definition: mitkMVConstrainedCostFunctionDecorator.h:37
mitk::ConstraintCheckerBase
This class is the base class for constraint checker.
Definition: mitkConstraintCheckerBase.h:31
itk::SmartPointer< Self >
mitk::MVConstrainedCostFunctionDecorator::m_FailureCount
unsigned int m_FailureCount
Definition: mitkMVConstrainedCostFunctionDecorator.h:94
mitk::MVConstrainedCostFunctionDecorator::~MVConstrainedCostFunctionDecorator
~MVConstrainedCostFunctionDecorator() override
Definition: mitkMVConstrainedCostFunctionDecorator.h:86
MITKMODELFIT_EXPORT
#define MITKMODELFIT_EXPORT
Definition: MitkModelFitExports.h:15
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::MVConstrainedCostFunctionDecorator::m_LastFailedParameter
ParametersType::size_type m_LastFailedParameter
Definition: mitkMVConstrainedCostFunctionDecorator.h:95
mitk::MVConstrainedCostFunctionDecorator::m_PenaltyCount
unsigned int m_PenaltyCount
Definition: mitkMVConstrainedCostFunctionDecorator.h:93
mitk::MVModelFitCostFunction::MeasureType
Superclass::MeasureType MeasureType
Definition: mitkMVModelFitCostFunction.h:40
mitk::MVConstrainedCostFunctionDecorator::SignalType
Superclass::SignalType SignalType
Definition: mitkMVConstrainedCostFunctionDecorator.h:46
mitk::MVConstrainedCostFunctionDecorator::Self
MVConstrainedCostFunctionDecorator Self
Definition: mitkMVConstrainedCostFunctionDecorator.h:41
mitk::MVConstrainedCostFunctionDecorator::Pointer
itk::SmartPointer< Self > Pointer
Definition: mitkMVConstrainedCostFunctionDecorator.h:43
mitk::MVConstrainedCostFunctionDecorator::PenaltyValueType
ConstraintCheckerBase::PenaltyValueType PenaltyValueType
Definition: mitkMVConstrainedCostFunctionDecorator.h:49
mitk::MVModelFitCostFunction::SignalType
ModelFitCostFunctionInterface::SignalType SignalType
Definition: mitkMVModelFitCostFunction.h:39
mitk::MVConstrainedCostFunctionDecorator::m_ActivateFailureThreshold
bool m_ActivateFailureThreshold
Definition: mitkMVConstrainedCostFunctionDecorator.h:91
mitk::MVConstrainedCostFunctionDecorator::m_ConstraintChecker
ConstraintCheckerBase::ConstPointer m_ConstraintChecker
Definition: mitkMVConstrainedCostFunctionDecorator.h:88
mitk::MVConstrainedCostFunctionDecorator::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: mitkMVConstrainedCostFunctionDecorator.h:44
mitk::MVConstrainedCostFunctionDecorator::m_WrappedCostFunction
MVModelFitCostFunction::ConstPointer m_WrappedCostFunction
Definition: mitkMVConstrainedCostFunctionDecorator.h:89