ANIMA  4.0
animaFastMeanSquaresImageToImageMetric.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "itkImageToImageMetric.h"
4 #include "itkCovariantVector.h"
5 #include "itkPoint.h"
6 
7 namespace anima
8 {
9 template < class TFixedImage, class TMovingImage >
11  public itk::ImageToImageMetric< TFixedImage, TMovingImage>
12 {
13 public:
14 
17  typedef itk::ImageToImageMetric<TFixedImage, TMovingImage > Superclass;
18  typedef itk::SmartPointer<Self> Pointer;
19  typedef itk::SmartPointer<const Self> ConstPointer;
20 
22  itkNewMacro(Self);
23 
25  itkTypeMacro(FastMeanSquaresImageToImageMetric, itk::ImageToImageMetric);
26 
27 
29  typedef typename Superclass::RealType RealType;
30  typedef typename Superclass::TransformType TransformType;
31  typedef typename Superclass::TransformPointer TransformPointer;
32  typedef typename Superclass::TransformParametersType TransformParametersType;
33  typedef typename Superclass::TransformJacobianType TransformJacobianType;
34  typedef typename Superclass::GradientPixelType GradientPixelType;
35  typedef typename Superclass::OutputPointType OutputPointType;
36  typedef typename Superclass::InputPointType InputPointType;
37  typedef typename itk::ContinuousIndex <double,TFixedImage::ImageDimension> ContinuousIndexType;
38 
39  typedef typename Superclass::MeasureType MeasureType;
40  typedef typename Superclass::DerivativeType DerivativeType;
41  typedef typename Superclass::FixedImageType FixedImageType;
42  typedef typename Superclass::MovingImageType MovingImageType;
43  typedef typename Superclass::FixedImageConstPointer FixedImageConstPointer;
44  typedef typename Superclass::MovingImageConstPointer MovingImageConstPointer;
45 
46 
48  void GetDerivative(const TransformParametersType & parameters,
49  DerivativeType & Derivative) const ITK_OVERRIDE;
50 
52  MeasureType GetValue(const TransformParametersType & parameters) const ITK_OVERRIDE;
53 
55  void GetValueAndDerivative(const TransformParametersType & parameters,
56  MeasureType& Value, DerivativeType& Derivative) const ITK_OVERRIDE;
57 
58  itkSetMacro(ScaleIntensities, bool)
59  itkSetMacro(DefaultBackgroundValue, double)
60 
61  void PreComputeFixedValues();
62 
63 protected:
66 
67 private:
68  FastMeanSquaresImageToImageMetric(const Self&); //purposely not implemented
69  void operator=(const Self&); //purposely not implemented
70 
71  bool m_ScaleIntensities;
72  double m_DefaultBackgroundValue;
73 
74  std::vector <InputPointType> m_FixedImagePoints;
75  std::vector <RealType> m_FixedImageValues;
76 };
77 
78 } // end namespace anima
79 
void GetDerivative(const TransformParametersType &parameters, DerivativeType &Derivative) const ITK_OVERRIDE
MeasureType GetValue(const TransformParametersType &parameters) const ITK_OVERRIDE
itk::ImageToImageMetric< TFixedImage, TMovingImage > Superclass
void GetValueAndDerivative(const TransformParametersType &parameters, MeasureType &Value, DerivativeType &Derivative) const ITK_OVERRIDE
itk::ContinuousIndex< double, TFixedImage::ImageDimension > ContinuousIndexType