NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
itkSADImageToImageMetric.h
Go to the documentation of this file.
1 /*=============================================================================
2 
3  NifTK: A software platform for medical image computing.
4 
5  Copyright (c) University College London (UCL). All rights reserved.
6 
7  This software is distributed WITHOUT ANY WARRANTY; without even
8  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
9  PURPOSE.
10 
11  See LICENSE.txt in the top level directory for details.
12 
13 =============================================================================*/
14 
15 #ifndef itkSADImageToImageMetric_h
16 #define itkSADImageToImageMetric_h
17 
19 
20 namespace itk
21 {
28 template < class TFixedImage, class TMovingImage>
29 class ITK_EXPORT SADImageToImageMetric :
30  public FiniteDifferenceGradientSimilarityMeasure< TFixedImage, TMovingImage>
31 {
32 public:
33 
37  typedef SmartPointer<Self> Pointer;
38  typedef SmartPointer<const Self> ConstPointer;
42 
44  itkNewMacro(Self);
45 
48 
49 protected:
50 
52  virtual ~SADImageToImageMetric() {};
53 
57  void ResetCostFunction() { this->m_SAD = 0; }
58 
63  FixedImagePixelType fixedValue,
64  MovingImagePixelType movingValue)
65  {
66  this->m_SAD += fabs((double)(fixedValue - movingValue));
67  }
68 
72  MeasureType FinalizeCostFunction()
73  {
74  return this->m_SAD;
75  }
76 
77 private:
78  SADImageToImageMetric(const Self&); // purposefully not implemented
79  void operator=(const Self&); // purposefully not implemented
80 
82  double m_SAD;
83 };
84 
85 } // end namespace itk
86 
87 #endif
88 
89 
90 
Superclass::MovingImageType::PixelType MovingImagePixelType
Definition: itkSADImageToImageMetric.h:40
Abstract base class, implementing TemplateMethod [2] for similarity measures.
Definition: itkSimilarityMeasure.h:56
MeasureType FinalizeCostFunction()
Definition: itkSADImageToImageMetric.h:72
SADImageToImageMetric Self
Definition: itkSADImageToImageMetric.h:35
void ResetCostFunction()
Definition: itkSADImageToImageMetric.h:57
Superclass::FixedImageType::PixelType FixedImagePixelType
Definition: itkSADImageToImageMetric.h:39
virtual ~SADImageToImageMetric()
Definition: itkSADImageToImageMetric.h:52
Definition: niftkITKAffineResampleImage.cxx:74
Superclass::MeasureType MeasureType
Definition: itkSADImageToImageMetric.h:41
Implements Sums of Absolute Differences similarity measure.
Definition: itkSADImageToImageMetric.h:29
SmartPointer< Self > Pointer
Definition: itkSADImageToImageMetric.h:37
float PixelType
Definition: niftkBreastDCEandADC.cxx:88
SADImageToImageMetric()
Definition: itkSADImageToImageMetric.h:51
AbstractBase class, just to implement the finite difference gradient method.
Definition: itkFiniteDifferenceGradientSimilarityMeasure.h:32
Superclass::MeasureType MeasureType
Definition: itkSimilarityMeasure.h:80
SmartPointer< const Self > ConstPointer
Definition: itkSADImageToImageMetric.h:38
SimilarityMeasure< TFixedImage, TMovingImage > Superclass
Definition: itkSADImageToImageMetric.h:36
void AggregateCostFunctionPair(FixedImagePixelType fixedValue, MovingImagePixelType movingValue)
Definition: itkSADImageToImageMetric.h:62