Medical Imaging Interaction Toolkit  2021.10.99-9c07a326
Medical Imaging Interaction Toolkit
mitkMVModelFitCostFunction.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 MV_MODELFITCOSTFUNCTION_H
14 #define MV_MODELFITCOSTFUNCTION_H
15 
16 #include <itkMultipleValuedCostFunction.h>
17 #include <itkMacro.h>
18 
20 
21 #include "MitkModelFitExports.h"
22 
23 namespace mitk
24 {
25 
30 class MITKMODELFIT_EXPORT MVModelFitCostFunction : public itk::MultipleValuedCostFunction, public ModelFitCostFunctionInterface
31 {
32 public:
33 
35  typedef itk::MultipleValuedCostFunction Superclass;
38 
40  typedef Superclass::MeasureType MeasureType;
41  typedef Superclass::DerivativeType DerivativeType;
42 
43  void SetSample(const SignalType &sampleSet) override;
44 
45  MeasureType GetValue(const ParametersType& parameter) const override;
46  void GetDerivative (const ParametersType &parameters, DerivativeType &derivative) const override;
47 
48  unsigned int GetNumberOfValues (void) const override;
49  unsigned int GetNumberOfParameters (void) const override;
50 
51  itkSetConstObjectMacro(Model, ModelBase);
52  itkGetConstObjectMacro(Model, ModelBase);
53 
54  itkSetMacro(DerivativeStepLength, double);
55  itkGetConstMacro(DerivativeStepLength, double);
56 
57 protected:
58 
59  virtual MeasureType CalcMeasure(const ParametersType &parameters, const SignalType& signal) const = 0;
60 
61  MVModelFitCostFunction() : m_DerivativeStepLength(1e-5)
62  {
63  }
64 
66 
67  SignalType m_Sample;
68 
69 private:
71 
73  double m_DerivativeStepLength;
74 };
75 
76 }
77 
78 #endif // MVModelFitCostFunction_H
itk::SmartPointer< const Self > ConstPointer
Base class for (dynamic) models. A model can be used to calculate its signal given the discrete time ...
Definition: mitkModelBase.h:47
ModelFitCostFunctionInterface::SignalType SignalType
Superclass::DerivativeType DerivativeType
DataCollection - Class to facilitate loading/accessing structured data.
#define MITKMODELFIT_EXPORT
itk::MultipleValuedCostFunction Superclass