ANIMA  4.0
animaStaniszCompartment.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <animaBaseCompartment.h>
4 #include <AnimaMCMExport.h>
5 
6 namespace anima
7 {
8 
9 class ANIMAMCM_EXPORT StaniszCompartment : public BaseCompartment
10 {
11 public:
12  // Useful typedefs
16  typedef itk::SmartPointer<Self> Pointer;
17  typedef itk::SmartPointer<const Self> ConstPointer;
21 
22  // New macro
23  itkNewMacro(Self)
24 
25 
26  itkTypeMacro(StaniszCompartment, BaseCompartment)
27 
28  DiffusionModelCompartmentType GetCompartmentType() ITK_OVERRIDE {return Stanisz;}
29 
30  virtual double GetFourierTransformedDiffusionProfile(double smallDelta, double bigDelta, double gradientStrength, const Vector3DType &gradient) ITK_OVERRIDE;
31  virtual ListType &GetSignalAttenuationJacobian(double smallDelta, double bigDelta, double gradientStrength, const Vector3DType &gradient) ITK_OVERRIDE;
32  virtual double GetLogDiffusionProfile(const Vector3DType &sample) ITK_OVERRIDE;
33 
34  virtual void SetParametersFromVector(const ListType &params) ITK_OVERRIDE;
35  virtual ListType &GetParametersAsVector() ITK_OVERRIDE;
36 
37  virtual ListType &GetParameterLowerBounds() ITK_OVERRIDE;
38  virtual ListType &GetParameterUpperBounds() ITK_OVERRIDE;
39 
40  // Set constraints
41  void SetEstimateAxialDiffusivity(bool arg);
42  void SetEstimateTissueRadius(bool arg);
43  void SetCompartmentVector(ModelOutputVectorType &compartmentVector) ITK_OVERRIDE;
44 
45  unsigned int GetCompartmentSize() ITK_OVERRIDE;
46  unsigned int GetNumberOfParameters() ITK_OVERRIDE;
47  ModelOutputVectorType &GetCompartmentVector() ITK_OVERRIDE;
48 
49  void SetTissueRadius(double num) ITK_OVERRIDE;
50  void SetAxialDiffusivity(double num) ITK_OVERRIDE;
51 
52  bool GetTensorCompatible() ITK_OVERRIDE {return false;}
53  double GetApparentFractionalAnisotropy() ITK_OVERRIDE;
54 
55 protected:
56  StaniszCompartment() : Superclass()
57  {
58  m_EstimateAxialDiffusivity = true;
59  m_EstimateTissueRadius = true;
60  m_ChangedConstraints = true;
61 
62  m_FirstSummation = 0.0;
63  m_SecondSummation = 0.0;
64  m_ThirdSummation = 0.0;
65  m_FourthSummation = 0.0;
66 
67  m_CurrentSmallDelta = 0.0;
68  m_CurrentBigDelta = 0.0;
69  m_CurrentGradientStrength = 0.0;
70 
71  m_ModifiedParameters = true;
72  }
73 
74  virtual ~StaniszCompartment() {}
75 
76  void UpdateSignals(double smallDelta, double bigDelta, double gradientStrength);
77 
78 private:
79  bool m_EstimateAxialDiffusivity, m_EstimateTissueRadius;
80  bool m_ChangedConstraints;
81  unsigned int m_NumberOfParameters;
82 
83  double m_FirstSummation;
84  double m_SecondSummation;
85  double m_ThirdSummation;
86  double m_FourthSummation;
87 
88  double m_CurrentSmallDelta;
89  double m_CurrentBigDelta;
90  double m_CurrentGradientStrength;
91 
92  bool m_ModifiedParameters;
93 
94  const unsigned int m_MaximumNumberOfSumElements = 2000;
95 };
96 
97 } //end namespace anima
std::vector< double > ListType
itk::SmartPointer< const Self > ConstPointer
itk::VariableLengthVector< double > ModelOutputVectorType
itk::Matrix< double, 3, 3 > Matrix3DType
vnl_vector_fixed< double, 3 > Vector3DType
Superclass::Matrix3DType Matrix3DType
Superclass::ModelOutputVectorType ModelOutputVectorType
DiffusionModelCompartmentType
itk::SmartPointer< Self > Pointer
Superclass::Vector3DType Vector3DType
bool GetTensorCompatible() ITK_OVERRIDE
itk::SmartPointer< Self > Pointer