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