ANIMA  4.0
animaFastCorrelationImageToImageMetric.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 
8 namespace anima
9 {
10 template < class TFixedImage, class TMovingImage >
12 public itk::ImageToImageMetric< TFixedImage, TMovingImage>
13 {
14 public:
15 
18  typedef itk::ImageToImageMetric<TFixedImage, TMovingImage > Superclass;
19  typedef itk::SmartPointer<Self> Pointer;
20  typedef itk::SmartPointer<const Self> ConstPointer;
21 
23  itkNewMacro(Self);
24 
26  itkTypeMacro(FastCorrelationImageToImageMetric, Object);
27 
28 
30  typedef typename Superclass::RealType RealType;
31  typedef typename Superclass::TransformType TransformType;
32  typedef typename Superclass::TransformPointer TransformPointer;
33  typedef typename Superclass::TransformParametersType TransformParametersType;
34  typedef typename Superclass::TransformJacobianType TransformJacobianType;
35  typedef typename Superclass::GradientPixelType GradientPixelType;
36  typedef typename Superclass::OutputPointType OutputPointType;
37  typedef typename Superclass::InputPointType InputPointType;
38  typedef typename itk::ContinuousIndex <double,TFixedImage::ImageDimension> ContinuousIndexType;
39 
40  typedef typename Superclass::MeasureType MeasureType;
41  typedef typename Superclass::DerivativeType DerivativeType;
42  typedef typename Superclass::FixedImageType FixedImageType;
43  typedef typename Superclass::MovingImageType MovingImageType;
44  typedef typename Superclass::FixedImageConstPointer FixedImageConstPointer;
45  typedef typename Superclass::MovingImageConstPointer MovingImageConstPointer;
46 
47 
49  void GetDerivative(const TransformParametersType & parameters,
50  DerivativeType & Derivative) const ITK_OVERRIDE;
51 
53  MeasureType GetValue(const TransformParametersType & parameters) const ITK_OVERRIDE;
54 
56  void GetValueAndDerivative(const TransformParametersType & parameters,
57  MeasureType& Value, DerivativeType& Derivative) const ITK_OVERRIDE;
58 
59  void PreComputeFixedValues();
60  itkSetMacro(SquaredCorrelation, bool)
61  itkSetMacro(ScaleIntensities, bool)
62  itkSetMacro(DefaultBackgroundValue, double)
63 
64 protected:
67  void PrintSelf(std::ostream& os, itk::Indent indent) const ITK_OVERRIDE;
68 
69 private:
70  ITK_DISALLOW_COPY_AND_ASSIGN(FastCorrelationImageToImageMetric);
71 
72  RealType m_SumFixed;
73  RealType m_VarFixed;
74 
75  bool m_SquaredCorrelation;
76  bool m_ScaleIntensities;
77  double m_DefaultBackgroundValue;
78 
79  std::vector <InputPointType> m_FixedImagePoints;
80  std::vector <RealType> m_FixedImageValues;
81 };
82 
83 } // end of namespace anima
84 
void GetValueAndDerivative(const TransformParametersType &parameters, MeasureType &Value, DerivativeType &Derivative) const ITK_OVERRIDE
void GetDerivative(const TransformParametersType &parameters, DerivativeType &Derivative) const ITK_OVERRIDE
itk::ContinuousIndex< double, TFixedImage::ImageDimension > ContinuousIndexType
void PrintSelf(std::ostream &os, itk::Indent indent) const ITK_OVERRIDE
MeasureType GetValue(const TransformParametersType &parameters) const ITK_OVERRIDE
itk::ImageToImageMetric< TFixedImage, TMovingImage > Superclass