ANIMA  4.0
animaMultiT2EPGRelaxometryCostFunction.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 
13 class ANIMARELAXOMETRY_EXPORT MultiT2EPGRelaxometryCostFunction :
14 public itk::SingleValuedCostFunction
15 {
16 public:
19  typedef itk::SingleValuedCostFunction Superclass;
20  typedef itk::SmartPointer<Self> Pointer;
21  typedef itk::SmartPointer<const Self> ConstPointer;
22 
23  itkNewMacro(Self);
24 
26  itkTypeMacro(MultiT2EPGRelaxometryCostFunction, Superclass);
27 
28  typedef Superclass::MeasureType MeasureType;
29  typedef Superclass::DerivativeType DerivativeType;
30  typedef Superclass::ParametersType ParametersType;
31  typedef std::vector < std::complex <double> > ComplexVectorType;
32  typedef std::vector <ComplexVectorType> MatrixType;
33 
34  virtual MeasureType GetValue(const ParametersType & parameters) const ITK_OVERRIDE;
35  virtual void GetDerivative(const ParametersType & parameters, DerivativeType & derivative) const ITK_OVERRIDE {} // No derivative
36 
37  itkSetMacro(EchoSpacing, double)
38  itkSetMacro(ExcitationFlipAngle, double)
39 
40  void SetT2RelaxometrySignals(ParametersType &relaxoSignals) {m_T2RelaxometrySignals = relaxoSignals;}
41  void SetT2FlipAngles(std::vector <double> & flipAngles) {m_T2FlipAngles = flipAngles;}
42 
43  itkSetMacro(T1Value, double)
44  itkSetMacro(M0Value, double)
45 
46  void SetT2Values(std::vector <double> &values) {m_T2Values = values;}
47  void SetT2Weights(ParametersType &weights) {m_T2Weights = weights;}
48 
49  unsigned int GetNumberOfParameters() const ITK_OVERRIDE
50  {
51  return 1;
52  }
53 
54 protected:
56  {
57  m_T1Value = 1;
58  m_M0Value = 1;
59 
60  m_EchoSpacing = 1;
61  }
62 
64 
65 private:
66  MultiT2EPGRelaxometryCostFunction(const Self&); //purposely not implemented
67  void operator=(const Self&); //purposely not implemented
68 
69  double m_EchoSpacing;
70  ParametersType m_T2RelaxometrySignals;
71 
72  double m_ExcitationFlipAngle;
73  std::vector <double> m_T2FlipAngles;
74 
75  std::vector <double> m_T2Values;
76  ParametersType m_T2Weights;
77 
78  double m_T1Value, m_M0Value;
79 };
80 
81 } // end namespace anima
STL namespace.
void SetT2FlipAngles(std::vector< double > &flipAngles)
Cost function for estimating B1 from T2 relaxometry acquisition, following a multi-T2 EPG decay model...
virtual void GetDerivative(const ParametersType &parameters, DerivativeType &derivative) const ITK_OVERRIDE