NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
itkSSDImageToImageMetric.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 itkSSDImageToImageMetric_h
16 #define itkSSDImageToImageMetric_h
17 
19 
20 namespace itk
21 {
28 template < class TFixedImage, class TMovingImage >
29 class ITK_EXPORT SSDImageToImageMetric :
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 ~SSDImageToImageMetric() {};
53 
57  void ResetCostFunction() { this->m_SSD = 0; }
58 
63  FixedImagePixelType fixedValue,
64  MovingImagePixelType movingValue)
65  {
66  this->m_SSD += ((fixedValue - movingValue) * (fixedValue - movingValue));
67  }
68 
72  MeasureType FinalizeCostFunction()
73  {
74  return this->m_SSD;
75  }
76 
77 private:
78  SSDImageToImageMetric(const Self&); // purposefully not implemented
79  void operator=(const Self&); // purposefully not implemented
80 
82  double m_SSD;
83 };
84 
85 } // end namespace itk
86 
87 #endif
88 
89 
90 
SSDImageToImageMetric()
Definition: itkSSDImageToImageMetric.h:51
Abstract base class, implementing TemplateMethod [2] for similarity measures.
Definition: itkSimilarityMeasure.h:56
SimilarityMeasure< TFixedImage, TMovingImage > Superclass
Definition: itkSSDImageToImageMetric.h:36
SmartPointer< Self > Pointer
Definition: itkSSDImageToImageMetric.h:37
MeasureType FinalizeCostFunction()
Definition: itkSSDImageToImageMetric.h:72
Definition: niftkITKAffineResampleImage.cxx:74
Superclass::MeasureType MeasureType
Definition: itkSSDImageToImageMetric.h:41
Implements Sums of Squared Difference similarity measure.
Definition: itkSSDImageToImageMetric.h:29
Superclass::FixedImageType::PixelType FixedImagePixelType
Definition: itkSSDImageToImageMetric.h:39
float PixelType
Definition: niftkBreastDCEandADC.cxx:88
AbstractBase class, just to implement the finite difference gradient method.
Definition: itkFiniteDifferenceGradientSimilarityMeasure.h:32
SSDImageToImageMetric Self
Definition: itkSSDImageToImageMetric.h:35
void ResetCostFunction()
Definition: itkSSDImageToImageMetric.h:57
Superclass::MovingImageType::PixelType MovingImagePixelType
Definition: itkSSDImageToImageMetric.h:40
SmartPointer< const Self > ConstPointer
Definition: itkSSDImageToImageMetric.h:38
virtual ~SSDImageToImageMetric()
Definition: itkSSDImageToImageMetric.h:52
Superclass::MeasureType MeasureType
Definition: itkSimilarityMeasure.h:80
void AggregateCostFunctionPair(FixedImagePixelType fixedValue, MovingImagePixelType movingValue)
Definition: itkSSDImageToImageMetric.h:62