ANIMA  4.0
animaMCMMultipleValuedCostFunction.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <itkMultipleValuedCostFunction.h>
4 #include <animaBaseMCMCost.h>
5 #include <AnimaMCMBaseExport.h>
6 
7 namespace anima
8 {
9 
10 class ANIMAMCMBASE_EXPORT MCMMultipleValuedCostFunction : public itk::MultipleValuedCostFunction
11 {
12 public:
15  typedef itk::MultipleValuedCostFunction Superclass;
16  typedef itk::SmartPointer<Self> Pointer;
17  typedef itk::SmartPointer<const Self> ConstPointer;
18 
19  itkNewMacro(Self)
20 
21 
22  itkTypeMacro(MCMMultipleValuedCostFunction, itk::MultipleValuedCostFunction)
23 
24  typedef Superclass::MeasureType MeasureType;
25  typedef Superclass::DerivativeType DerivativeType;
26  typedef Superclass::ParametersType ParametersType;
27 
29  typedef InternalCostType::Pointer InternalCostPointer;
30 
31  itkSetMacro(InternalCost, InternalCostPointer)
32  itkGetConstReferenceMacro(InternalCost, InternalCostPointer)
33 
34  virtual MeasureType GetValue(const ParametersType &parameters) const ITK_OVERRIDE;
35  virtual void GetDerivative(const ParametersType &parameters, DerivativeType &derivative) const ITK_OVERRIDE;
36 
37  double GetSigmaSquare();
38 
39  InternalCostType::MCMPointer &GetMCMStructure() {return m_InternalCost->GetMCMStructure();}
40 
41  unsigned int GetNumberOfParameters() const ITK_OVERRIDE;
42  unsigned int GetNumberOfValues() const ITK_OVERRIDE;
43 
44 protected:
46  {
47  m_InternalCost = ITK_NULLPTR;
48  }
49 
50  virtual ~MCMMultipleValuedCostFunction() ITK_OVERRIDE {}
51 
52 private:
53  MCMMultipleValuedCostFunction(const Self&); //purposely not implemented
54  void operator=(const Self&); //purposely not implemented
55 
56  mutable InternalCostPointer m_InternalCost;
57 };
58 
59 } // end namespace anima
MCMPointer & GetMCMStructure()
Base cost function class to handle maximum likelihood estimation.