ANIMA  4.0
animaTensorGeneralizedCorrelationImageToImageMetric.h
Go to the documentation of this file.
1 #pragma once
2 
4 #include <animaBaseTensorTools.h>
5 
6 #include <itkVectorImage.h>
7 #include <itkCovariantVector.h>
8 #include <itkPoint.h>
9 
10 namespace anima
11 {
12 template < class TFixedImagePixelType, class TMovingImagePixelType, unsigned int ImageDimension >
14 public anima::BaseOrientedModelImageToImageMetric< itk::VectorImage < TFixedImagePixelType, ImageDimension >, itk::VectorImage < TMovingImagePixelType, ImageDimension > >
15 {
16 public:
17 
19  typedef itk::VectorImage < TFixedImagePixelType, ImageDimension > TFixedImage;
20  typedef itk::VectorImage < TMovingImagePixelType, ImageDimension > TMovingImage;
21 
24  typedef itk::SmartPointer<Self> Pointer;
25  typedef itk::SmartPointer<const Self> ConstPointer;
26 
28  itkNewMacro(Self)
29 
30 
32 
34  typedef typename TFixedImage::PixelType PixelType;
35  typedef vnl_matrix <double> CovarianceType;
36 
37  typedef typename Superclass::TransformType TransformType;
38  typedef typename Superclass::TransformPointer TransformPointer;
39  typedef typename Superclass::TransformParametersType TransformParametersType;
40  typedef typename Superclass::OutputPointType OutputPointType;
41  typedef typename Superclass::InputPointType InputPointType;
42  typedef typename itk::ContinuousIndex <double, ImageDimension> ContinuousIndexType;
43 
45 
46  typedef typename Superclass::MeasureType MeasureType;
47  typedef typename Superclass::FixedImageType FixedImageType;
48  typedef typename Superclass::MovingImageType MovingImageType;
49  typedef typename Superclass::FixedImageConstPointer FixedImageConstPointer;
50  typedef typename Superclass::MovingImageConstPointer MovingImageConstPointer;
51 
54 
56  MeasureType GetValue(const TransformParametersType & parameters) const ITK_OVERRIDE;
57 
58  void PreComputeFixedValues();
59 
60  itkSetMacro(OrientationPenalty, bool)
61  itkSetMacro(VarianceThreshold, double)
62 
63 protected:
64  TensorGeneralizedCorrelationImageToImageMetric();
65  virtual ~TensorGeneralizedCorrelationImageToImageMetric() {}
66  void PrintSelf(std::ostream& os, itk::Indent indent) const ITK_OVERRIDE;
67 
68 private:
69  TensorGeneralizedCorrelationImageToImageMetric(const Self&); //purposely not implemented
70  void operator=(const Self&); //purposely not implemented
71 
72  bool m_OrientationPenalty;
73 
74  double m_VarianceThreshold;
75 
76  PixelType m_FixedMean;
77  CovarianceType m_FixedHalfInvCovarianceMatrix;
78 
79  std::vector <InputPointType> m_FixedImagePoints;
80  std::vector <PixelType> m_FixedImageValues;
81 
82  LECalculatorPointer m_leCalculator;
83 };
84 
85 } // end namespace anima
86 
itk::VectorImage< TMovingImagePixelType, ImageDimension > TMovingImage
MeasureType GetValue(const TransformParametersType &parameters) const ITK_OVERRIDE
void PrintSelf(std::ostream &os, itk::Indent indent) const ITK_OVERRIDE
anima::BaseOrientedModelImageToImageMetric< TFixedImage, TMovingImage > Superclass