Medical Imaging Interaction Toolkit  2025.12.02
Medical Imaging Interaction Toolkit
mitkLevenbergMarquardtModelFitFunctor.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 mitkLevenbergMarquardtModelFitFunctor_h
14 #define mitkLevenbergMarquardtModelFitFunctor_h
15 
16 #include <itkObject.h>
17 #include <itkLevenbergMarquardtOptimizer.h>
18 
19 #include "mitkModelBase.h"
22 
23 #include "MitkModelFitExports.h"
24 
25 namespace mitk
26 {
27 
29  {
30  public:
35 
36  itkNewMacro(Self);
38 
41 
42  itkSetMacro(Epsilon, double);
43  itkSetMacro(GradientTolerance, double);
44  itkSetMacro(ValueTolerance, double);
45  itkSetMacro(DerivativeStepLength, double);
46  itkSetMacro(Iterations, unsigned int);
47  itkSetMacro(Scales, ::itk::LevenbergMarquardtOptimizer::ScalesType);
48 
49  itkGetMacro(Epsilon, double);
50  itkGetMacro(GradientTolerance, double);
51  itkGetMacro(ValueTolerance, double);
52  itkGetMacro(DerivativeStepLength, double);
53  itkGetMacro(Iterations, unsigned int);
54  itkGetMacro(Scales, ::itk::LevenbergMarquardtOptimizer::ScalesType);
55 
56  itkSetConstObjectMacro(ConstraintChecker, ConstraintCheckerBase);
57  itkGetConstObjectMacro(ConstraintChecker, ConstraintCheckerBase);
58  itkSetMacro(ActivateFailureThreshold, bool);
59  itkGetConstMacro(ActivateFailureThreshold, bool);
60 
62 
63  protected:
64 
67 
69 
71 
72  ParametersType DoModelFit(const SignalType& value, const ModelBase* model,
73  const ModelBase::ParametersType& initialParameters,
74  DebugParameterMapType& debugParameters) const override;
75 
76  OutputPixelArrayType GetCriteria(const ModelBase* model, const ParametersType& parameters,
77  const SignalType& sample) const override;
78 
81  const ModelBase* model) const;
82 
84 
85  private:
86  double m_Epsilon;
87  double m_GradientTolerance;
88  double m_ValueTolerance;
89  unsigned int m_Iterations;
90  double m_DerivativeStepLength;
91  ::itk::LevenbergMarquardtOptimizer::ScalesType m_Scales;
92 
95  ConstraintCheckerBase::ConstPointer m_ConstraintChecker;
98  bool m_ActivateFailureThreshold;
99  };
100 
101 }
102 
103 
104 #endif
#define MITKMODELFIT_EXPORT
This class is the base class for constraint checker.
ParametersType DoModelFit(const SignalType &value, const ModelBase *model, const ModelBase::ParametersType &initialParameters, DebugParameterMapType &debugParameters) const override
virtual MVModelFitCostFunction::Pointer GenerateCostFunction(const SignalType &value, const ModelBase *model) const
ParameterNamesType DefineDebugParameterNames() const override
OutputPixelArrayType GetCriteria(const ModelBase *model, const ParametersType &parameters, const SignalType &sample) const override
ParameterNamesType GetCriterionNames() const override
Base class for (dynamic) models. A model can be used to calculate its signal given the discrete time ...
Definition: mitkModelBase.h:48
ModelTraitsInterface::ParametersType ParametersType
Definition: mitkModelBase.h:59
ModelFitCostFunctionInterface::SignalType SignalType
std::map< std::string, ParameterImagePixelType > DebugParameterMapType
std::vector< ParameterImagePixelType > InputPixelArrayType
ModelBase::ParametersType ParametersType
ModelBase::ParameterNamesType ParameterNamesType
std::vector< ParameterImagePixelType > OutputPixelArrayType
Find image slices visible on a given plane.