ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkKullbackLeiblerCompareHistogramImageToImageMetric.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef itkKullbackLeiblerCompareHistogramImageToImageMetric_h
19 #define itkKullbackLeiblerCompareHistogramImageToImageMetric_h
20 
22 
23 namespace itk
24 {
71 template< typename TFixedImage, typename TMovingImage >
73  public CompareHistogramImageToImageMetric< TFixedImage, TMovingImage >
74 {
75 public:
82 
84  itkNewMacro(Self);
85 
89 
91  typedef typename Superclass::RealType RealType;
92  typedef typename Superclass::TransformType TransformType;
93  typedef typename Superclass::TransformPointer TransformPointer;
95  typedef typename Superclass::TransformParametersType TransformParametersType;
96  typedef typename Superclass::TransformJacobianType TransformJacobianType;
97  typedef typename Superclass::GradientPixelType GradientPixelType;
98 
99  typedef typename Superclass::MeasureType MeasureType;
100  typedef typename Superclass::DerivativeType DerivativeType;
101  typedef typename Superclass::FixedImageType FixedImageType;
102  typedef typename Superclass::MovingImageType MovingImageType;
103  typedef typename Superclass::FixedImageConstPointer FixedImageConstPointer;
104  typedef typename Superclass::MovingImageConstPointer
106 
107  typedef typename Superclass::HistogramType HistogramType;
108  typedef typename Superclass::HistogramSizeType HistogramSizeType;
109  typedef typename Superclass::MeasurementVectorType
111 
112  typedef typename Superclass::HistogramFrequencyType HistogramFrequencyType;
113  typedef typename Superclass::HistogramIteratorType HistogramIteratorType;
114  typedef typename Superclass::HistogramPointerType HistogramPointerType;
115  typedef typename Superclass::InterpolatorType InterpolatorType;
116  typedef typename Superclass::InterpolatorPointer InterpolatorPointer;
117 
119  itkSetMacro(Epsilon, double);
120 
122  itkGetConstReferenceMacro(Epsilon, double);
123 
125  unsigned int GetNumberOfParameters(void) const ITK_OVERRIDE
126  { return this->GetTransform()->GetNumberOfParameters(); }
127 
131  void Initialize() ITK_OVERRIDE;
132 
133 protected:
137  virtual ~KullbackLeiblerCompareHistogramImageToImageMetric() ITK_OVERRIDE {}
138  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
140 
142  void FormTrainingHistogram();
143 
145  virtual MeasureType EvaluateMeasure(HistogramType & histogram) const ITK_OVERRIDE;
146 
147  double m_Epsilon;
148 
149 private:
150  // Purposely not implemented.
152  void operator=(Self const &); // Purposely not implemented.
153 };
154 } // End namespace itk.
155 
156 #ifndef ITK_MANUAL_INSTANTIATION
157 #include "itkKullbackLeiblerCompareHistogramImageToImageMetric.hxx"
158 #endif
159 
160 #endif // itkKullbackLeiblerCompareHistogramImageToImageMetric_h
Computes the Kubler Lieblach(KL) metric between the histogram of the two images to be registered and ...
Light weight base class for most itk classes.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Compares Histograms between two images to be registered to a Training Histogram.
Computes similarity between two objects to be registered.
CompareHistogramImageToImageMetric< TFixedImage, TMovingImage > Superclass