ANIMA  4.0
animaMCML2DistanceComputer.h
Go to the documentation of this file.
1 #pragma once
2 
4 #include <itkLightObject.h>
5 #include <itkVariableLengthVector.h>
6 
7 #include <vnl/vnl_math.h>
8 
9 #include <AnimaMCMBaseExport.h>
10 
11 namespace anima
12 {
13 
17 class ANIMAMCMBASE_EXPORT MCML2DistanceComputer : public itk::LightObject
18 {
19 public:
21  typedef itk::LightObject Superclass;
22  typedef itk::SmartPointer<Self> Pointer;
23  typedef itk::SmartPointer<const Self> ConstPointer;
24 
26  itkTypeMacro(MCML2DistanceComputer, itk::LightObject)
27 
28  itkNewMacro(Self)
29 
31  typedef MCMType::Vector3DType GradientType;
32  typedef MCMType::Pointer MCMPointer;
33 
34  void SetLowPassGaussianSigma(double val) {m_LowPassGaussianSigma = val;}
35  void SetForceApproximation(bool val) {m_ForceApproximation = val;}
36  void SetSquaredDistance(bool val) {m_SquaredDistance = val;}
37 
38  double ComputeDistance(const MCMPointer &firstModel, const MCMPointer &secondModel) const;
39 
40  void SetGradientStrengths(const std::vector <double> &val);
41  void SetSmallDelta(double val);
42  void SetBigDelta(double val);
43 
44  void SetGradientDirections(const std::vector <GradientType> &val);
45 
46 protected:
49 
50  void UpdateSphereWeights();
51  bool CheckTensorCompatibility(const MCMPointer &firstModel, const MCMPointer &secondModel) const;
52 
53  double ComputeTensorDistance(const MCMPointer &firstModel, const MCMPointer &secondModel) const;
54  double ComputeApproximateDistance(const MCMPointer &firstModel, const MCMPointer &secondModel) const;
55 
56 private:
57  double m_LowPassGaussianSigma;
58  bool m_ForceApproximation;
59  bool m_SquaredDistance;
60 
61  // Optional parameters for the case when compartments are not tensor compatible
62  double m_SmallDelta;
63  double m_BigDelta;
64  std::vector <double> m_GradientStrengths;
65  std::vector <GradientType> m_GradientDirections;
66 
67  // Parameters for numerical integration on non tensor compatible models
68  std::vector <double> m_SphereWeights;
69  std::vector <unsigned int> m_BValWeightsIndexes;
70 };
71 
72 } // end namespace anima
Computes a L2 distance between two MCM of any type.
MultiCompartmentModel: holds several diffusion compartments, ordered by type It also handles weights ...
itk::SmartPointer< const Self > ConstPointer