ANIMA  4.0
animaODFMaximaCostFunction.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <vector>
4 #include <itkSingleValuedCostFunction.h>
5 #include "AnimaSHToolsExport.h"
6 
7 namespace anima
8 {
9 
10 class ANIMASHTOOLS_EXPORT ODFMaximaCostFunction :
11 public itk::SingleValuedCostFunction
12 {
13 public:
16  typedef SingleValuedCostFunction Superclass;
17  typedef itk::SmartPointer<Self> Pointer;
18  typedef itk::SmartPointer<const Self> ConstPointer;
19 
20  itkNewMacro(Self);
21 
23  itkTypeMacro(ODFMaximaCostFunction, SingleValuedCostFunction);
24 
25  typedef Superclass::MeasureType MeasureType;
26  typedef Superclass::DerivativeType DerivativeType;
27  typedef Superclass::ParametersType ParametersType;
28 
29  virtual MeasureType GetValue(const ParametersType & parameters) const ITK_OVERRIDE;
30  virtual void GetDerivative(const ParametersType & parameters, DerivativeType & derivative) const ITK_OVERRIDE;
31 
32  void SetBasisParameters(const std::vector <double> &basisPars) {m_BasisParameters = basisPars;}
33  void SetODFSHOrder(unsigned int num) {m_ODFSHOrder = num;}
34 
35  virtual unsigned int GetNumberOfParameters() const ITK_OVERRIDE
36  {
37  return 2;
38  }
39 
40 protected:
42  {
43  m_ODFSHOrder = 4;
44  }
45 
47 
48 private:
49  ODFMaximaCostFunction(const Self&); //purposely not implemented
50  void operator=(const Self&); //purposely not implemented
51 
52  std::vector <double> m_BasisParameters;
53  unsigned int m_ODFSHOrder;
54 };
55 
56 } // end of namespace anima
57 
58 
virtual unsigned int GetNumberOfParameters() const ITK_OVERRIDE
itk::SmartPointer< const Self > ConstPointer
void SetBasisParameters(const std::vector< double > &basisPars)
Superclass::DerivativeType DerivativeType
Superclass::ParametersType ParametersType