NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
itkNMIImageToImageMetric.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 itkNMIImageToImageMetric_h
16 #define itkNMIImageToImageMetric_h
17 
19 
20 namespace itk
21 {
28 template < class TFixedImage, class TMovingImage >
29 class ITK_EXPORT NMIImageToImageMetric :
30  public HistogramSimilarityMeasure< TFixedImage, TMovingImage>
31 {
32 public:
33 
37  typedef SmartPointer<Self> Pointer;
38  typedef SmartPointer<const Self> ConstPointer;
42 
44  itkNewMacro(Self);
45 
48 
50  bool ShouldBeMaximized() { return true; };
51 
52 protected:
53 
55  virtual ~NMIImageToImageMetric() {};
56  void PrintSelf(std::ostream& os, Indent indent) const {Superclass::PrintSelf(os,indent);};
57 
63  MeasureType FinalizeCostFunction()
64  {
65  //printf("Matt: Filled histogram has %f in total\n", this->m_Histogram->GetTotalFrequency());
66  return (this->EntropyFixed() + this->EntropyMoving()) / this->JointEntropy();
67  }
68 
69 private:
70  NMIImageToImageMetric(const Self&); // purposefully not implemented
71  void operator=(const Self&); // purposefully not implemented
72 };
73 
74 } // end namespace itk
75 
76 #endif
77 
78 
79 
Implements Normalised Mutual Information of a histogram for a similarity measure. ...
Definition: itkNMIImageToImageMetric.h:29
Computes similarity between two objects to be registered using Histogram.
Definition: itkHistogramSimilarityMeasure.h:33
Superclass::MeasureType MeasureType
Definition: itkNMIImageToImageMetric.h:41
NMIImageToImageMetric()
Definition: itkNMIImageToImageMetric.h:54
Superclass::MovingImageType::PixelType MovingImagePixelType
Definition: itkNMIImageToImageMetric.h:40
Definition: niftkITKAffineResampleImage.cxx:74
bool ShouldBeMaximized()
Definition: itkNMIImageToImageMetric.h:50
NMIImageToImageMetric Self
Definition: itkNMIImageToImageMetric.h:35
HistogramSimilarityMeasure< TFixedImage, TMovingImage > Superclass
Definition: itkNMIImageToImageMetric.h:36
float PixelType
Definition: niftkBreastDCEandADC.cxx:88
void PrintSelf(std::ostream &os, Indent indent) const
Definition: itkNMIImageToImageMetric.h:56
virtual ~NMIImageToImageMetric()
Definition: itkNMIImageToImageMetric.h:55
SmartPointer< Self > Pointer
Definition: itkNMIImageToImageMetric.h:37
Superclass::MeasureType MeasureType
Definition: itkSimilarityMeasure.h:80
MeasureType FinalizeCostFunction()
Definition: itkNMIImageToImageMetric.h:63
SmartPointer< const Self > ConstPointer
Definition: itkNMIImageToImageMetric.h:38
Superclass::FixedImageType::PixelType FixedImagePixelType
Definition: itkNMIImageToImageMetric.h:39