Medical Imaging Interaction Toolkit  2021.10.99-9c07a326
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 LEVENBERGMARQUARDTMODELFITFUNCTOR_H
14 #define LEVENBERGMARQUARDTMODELFITFUNCTOR_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 
61  ParameterNamesType GetCriterionNames() const override;
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 
80  virtual MVModelFitCostFunction::Pointer GenerateCostFunction(const SignalType& value,
81  const ModelBase* model) const;
82 
83  ParameterNamesType DefineDebugParameterNames() const override;
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 // MODEL_FIT_FUNCTOR_BASE_H
Base class for (dynamic) models. A model can be used to calculate its signal given the discrete time ...
Definition: mitkModelBase.h:47
ModelTraitsInterface::ParametersType ParametersType
Definition: mitkModelBase.h:59
std::vector< ParameterImagePixelType > InputPixelArrayType
double Epsilon
Definition: mitkEpsilon.h:20
std::map< std::string, ParameterImagePixelType > DebugParameterMapType
DataCollection - Class to facilitate loading/accessing structured data.
ModelBase::ParameterNamesType ParameterNamesType
#define MITKMODELFIT_EXPORT
ModelFitCostFunctionInterface::SignalType SignalType
ModelBase::ParametersType ParametersType
std::vector< ParameterImagePixelType > OutputPixelArrayType
This class is the base class for constraint checker.