ANIMA  4.0
animaMCMMeanSquaresImageToImageMetric.h
Go to the documentation of this file.
1 #pragma once
2 
5 #include <animaMCMImage.h>
7 
8 namespace anima
9 {
10 
11 template < class TFixedImagePixelType, class TMovingImagePixelType, unsigned int ImageDimension >
13 public BaseOrientedModelImageToImageMetric< anima::MCMImage < TFixedImagePixelType, ImageDimension >, anima::MCMImage < TMovingImagePixelType, ImageDimension > >
14 {
15 public:
19 
22  typedef itk::SmartPointer<Self> Pointer;
23  typedef itk::SmartPointer<const Self> ConstPointer;
24 
28 
30  itkNewMacro(Self)
31 
32 
34 
35 
36  typedef typename TFixedImage::PixelType PixelType;
37 
38  typedef typename Superclass::TransformType TransformType;
39  typedef typename Superclass::TransformPointer TransformPointer;
40  typedef typename Superclass::TransformParametersType TransformParametersType;
41  typedef typename Superclass::OutputPointType OutputPointType;
42  typedef typename Superclass::InputPointType InputPointType;
43  typedef typename itk::ContinuousIndex <double, ImageDimension> ContinuousIndexType;
44 
46 
47  typedef typename Superclass::MeasureType MeasureType;
48  typedef typename Superclass::FixedImageType FixedImageType;
49  typedef typename Superclass::MovingImageType MovingImageType;
50  typedef typename Superclass::FixedImageConstPointer FixedImageConstPointer;
51  typedef typename Superclass::MovingImageConstPointer MovingImageConstPointer;
52 
54 
56  MeasureType GetValue(const TransformParametersType & parameters) const ITK_OVERRIDE;
57 
58  void SetSmallDelta(double val) {m_L2DistanceComputer->SetSmallDelta(val);}
59  void SetBigDelta(double val) {m_L2DistanceComputer->SetBigDelta(val);}
60  void SetGradientStrengths(std::vector <double> &val) {m_L2DistanceComputer->SetGradientStrengths(val);}
61  void SetGradientDirections(std::vector <GradientType> &val) {m_L2DistanceComputer->SetGradientDirections(val);}
62 
63  void SetForceApproximation(bool val) {m_L2DistanceComputer->SetForceApproximation(val);}
64  void SetLowPassGaussianSigma(double val) {m_L2DistanceComputer->SetLowPassGaussianSigma(val);}
65 
66  void PreComputeFixedValues();
67 
68 protected:
71 
72  bool isZero(PixelType &vector) const;
73 
74 private:
75  MCMMeanSquaresImageToImageMetric(const Self&); //purposely not implemented
76  void operator=(const Self&); //purposely not implemented
77 
78  std::vector <InputPointType> m_FixedImagePoints;
79  std::vector <MCModelPointer> m_FixedImageValues;
80 
81  MCML2DistanceComputerPointer m_L2DistanceComputer;
82 
83  MCModelPointer m_ZeroDiffusionModel;
84  PixelType m_ZeroDiffusionVector;
85 };
86 
87 } // end namespace anima
88 
MeasureType GetValue(const TransformParametersType &parameters) const ITK_OVERRIDE
anima::MCMImage< TMovingImagePixelType, ImageDimension > TMovingImage
Computes a L2 distance between two MCM of any type.
void SetGradientDirections(std::vector< GradientType > &val)
anima::MCMImage< TFixedImagePixelType, ImageDimension > TFixedImage
Superclass::MovingImageConstPointer MovingImageConstPointer
Superclass::TransformParametersType TransformParametersType
BaseCompartment::Vector3DType Vector3DType
MultiCompartmentModel: holds several diffusion compartments, ordered by type It also handles weights ...
BaseOrientedModelImageToImageMetric< TFixedImage, TMovingImage > Superclass
itk::ContinuousIndex< double, ImageDimension > ContinuousIndexType
Superclass::CoordinateRepresentationType CoordinateRepresentationType
anima::MCML2DistanceComputer::Pointer MCML2DistanceComputerPointer