Medical Imaging Interaction Toolkit  2026.06.00
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 mitkSVModelFitCostFunction_h
14 #define mitkSVModelFitCostFunction_h
15 
16 #include <itkSingleValuedCostFunction.h>
17 #include <itkMacro.h>
18 
20 
21 #include <MitkModelFitExports.h>
22 
23 namespace mitk
24 {
25 
36 class MITKMODELFIT_EXPORT SVModelFitCostFunction : public itk::SingleValuedCostFunction, public ModelFitCostFunctionInterface
37 {
38 public:
39 
41  typedef itk::SingleValuedCostFunction Superclass;
44 
46  typedef Superclass::MeasureType MeasureType;
47  typedef Superclass::DerivativeType DerivativeType;
48 
53  void SetSample(const SignalType &sampleSet) override;
54 
60  MeasureType GetValue(const ParametersType& parameter) const override;
61 
67  void GetDerivative (const ParametersType &parameters, DerivativeType &derivative) const override;
68 
73  unsigned int GetNumberOfParameters (void) const override;
74 
77 
78  itkSetMacro(DerivativeStepLength, double);
79  itkGetConstMacro(DerivativeStepLength, double);
80 
81 protected:
82 
83  virtual MeasureType CalcMeasure(const ParametersType &parameters, const SignalType& signal) const = 0;
84 
85  SVModelFitCostFunction(): m_DerivativeStepLength(1e-5)
86  {
87  }
88 
90 
92 
93 private:
95 
97  double m_DerivativeStepLength;
98 };
99 
100 }
101 
102 #endif
#define MITKMODELFIT_EXPORT
Base class for (dynamic) models.
Definition: mitkModelBase.h:56
Interface class that is implemented by all cost functions used in model fitting.
itk::Array< double > SignalType
Type representing the observed signal values.
Base class for all model fit cost functions that return a single scalar cost value.
mitkOverrideGetConstObjectMacro(Model, ModelBase)
Superclass::DerivativeType DerivativeType
mitkOverrideSetConstObjectMacro(Model, ModelBase)
virtual MeasureType CalcMeasure(const ParametersType &parameters, const SignalType &signal) const =0
itk::SingleValuedCostFunction Superclass
unsigned int GetNumberOfParameters(void) const override
Returns the number of model parameters.
MeasureType GetValue(const ParametersType &parameter) const override
Computes the scalar cost value for the given parameters.
itk::SmartPointer< const Self > ConstPointer
ModelFitCostFunctionInterface::SignalType SignalType
void SetSample(const SignalType &sampleSet) override
Sets the observed sample signal.
void GetDerivative(const ParametersType &parameters, DerivativeType &derivative) const override
Computes the derivative of the cost function numerically via finite differences.
Find image slices visible on a given plane.