ANIMA  4.0
animaT2RelaxometryCostFunction.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 T2RelaxometryCostFunction :
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(T2RelaxometryCostFunction, 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 
35  void SetT2RelaxometrySignals(std::vector <double> & relaxoSignals) {m_T2RelaxometrySignals = relaxoSignals;}
36 
37  itkSetMacro(T1Value, double)
38  itkSetMacro(T2Value, double)
39  itkSetMacro(TRValue, double)
40  itkGetMacro(M0Value, double)
41 
42  unsigned int GetNumberOfParameters() const ITK_OVERRIDE
43  {
44  // T2
45  return 1;
46  }
47 
48 protected:
50  {
51  m_T1Value = 1;
52  m_T2Value = 1;
53  m_M0Value = 1;
54  m_TRValue = 5000;
55 
56  m_T2EchoSpacing = 1;
57  }
58 
60 
61 private:
62  T2RelaxometryCostFunction(const Self&); //purposely not implemented
63  void operator=(const Self&); //purposely not implemented
64 
65  double m_T2EchoSpacing;
66  std::vector <double> m_T2RelaxometrySignals;
67 
68  double m_TRValue;
69  mutable double m_T1Value, m_T2Value, m_M0Value;
70 };
71 
72 } // end namespace anima
std::vector< ComplexVectorType > MatrixType
STL namespace.
itk::SmartPointer< const Self > ConstPointer
std::vector< std::complex< double > > ComplexVectorType