ANIMA  4.0
animaT2EPGRelaxometryCostFunction.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <itkSingleValuedCostFunction.h>
4 #include "AnimaRelaxometryExport.h"
5 
6 namespace anima
7 {
8 
9 class ANIMARELAXOMETRY_EXPORT T2EPGRelaxometryCostFunction :
10 public itk::SingleValuedCostFunction
11 {
12 public:
15  typedef itk::SingleValuedCostFunction Superclass;
16  typedef itk::SmartPointer<Self> Pointer;
17  typedef itk::SmartPointer<const Self> ConstPointer;
18 
19  itkNewMacro(Self)
20 
21 
22  itkTypeMacro(T2EPGRelaxometryCostFunction, Superclass)
23 
24  typedef Superclass::MeasureType MeasureType;
25  typedef Superclass::DerivativeType DerivativeType;
26  typedef Superclass::ParametersType ParametersType;
27  typedef std::vector < std::complex <double> > ComplexVectorType;
28  typedef std::vector <ComplexVectorType> MatrixType;
29 
30  virtual MeasureType GetValue(const ParametersType & parameters) const ITK_OVERRIDE;
31  virtual void GetDerivative(const ParametersType & parameters, DerivativeType & derivative) const ITK_OVERRIDE {} // No derivative
32 
33  itkSetMacro(T2EchoSpacing, double)
34  itkSetMacro(T2ExcitationFlipAngle, double)
35 
36  void SetT2RelaxometrySignals(std::vector <double> & relaxoSignals) {m_T2RelaxometrySignals = relaxoSignals;}
37  void SetT2FlipAngles(std::vector <double> & flipAngles) {m_T2FlipAngles = flipAngles;}
38 
39  itkSetMacro(T1Value, double)
40  itkSetMacro(T2Value, double)
41  itkSetMacro(B1Value, double)
42  itkGetMacro(M0Value, double)
43 
44  unsigned int GetNumberOfParameters() const ITK_OVERRIDE
45  {
46  // T2, B1
47  return 2;
48  }
49 
50 protected:
52  {
53  m_T1Value = 1;
54  m_T2Value = 1;
55  m_B1Value = 1;
56  m_M0Value = 1;
57 
58  m_T2EchoSpacing = 1;
59  }
60 
62 
63 private:
64  T2EPGRelaxometryCostFunction(const Self&); //purposely not implemented
65  void operator=(const Self&); //purposely not implemented
66 
67  double m_T2EchoSpacing;
68  std::vector <double> m_T2RelaxometrySignals;
69 
70  double m_T2ExcitationFlipAngle;
71  std::vector <double> m_T2FlipAngles;
72 
73  mutable double m_T1Value, m_T2Value, m_B1Value, m_M0Value;
74 };
75 
76 } // end namespace anima
STL namespace.
std::vector< std::complex< double > > ComplexVectorType
void SetT2FlipAngles(std::vector< double > &flipAngles)