ITK  5.0.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:
76  ITK_DISALLOW_COPY_AND_ASSIGN(KullbackLeiblerCompareHistogramImageToImageMetric);
77 
80  using Superclass =
84 
86  itkNewMacro(Self);
87 
91 
93  using RealType = typename Superclass::RealType;
94  using TransformType = typename Superclass::TransformType;
95  using TransformPointer = typename Superclass::TransformPointer;
97  using TransformParametersType = typename Superclass::TransformParametersType;
98  using TransformJacobianType = typename Superclass::TransformJacobianType;
99  using GradientPixelType = typename Superclass::GradientPixelType;
100 
101  using MeasureType = typename Superclass::MeasureType;
102  using DerivativeType = typename Superclass::DerivativeType;
103  using FixedImageType = typename Superclass::FixedImageType;
104  using MovingImageType = typename Superclass::MovingImageType;
105  using FixedImageConstPointer = typename Superclass::FixedImageConstPointer;
106  using MovingImageConstPointer = typename Superclass::MovingImageConstPointer;
107 
108  using HistogramType = typename Superclass::HistogramType;
109  using HistogramSizeType = typename Superclass::HistogramSizeType;
110  using HistogramMeasurementVectorType = typename Superclass::MeasurementVectorType;
111 
112  using HistogramFrequencyType = typename Superclass::HistogramFrequencyType;
113  using HistogramIteratorType = typename Superclass::HistogramIteratorType;
114  using HistogramPointerType = typename Superclass::HistogramPointerType;
115  using InterpolatorType = typename Superclass::InterpolatorType;
116  using InterpolatorPointer = typename Superclass::InterpolatorPointer;
117 
119  itkSetMacro(Epsilon, double);
120 
122  itkGetConstReferenceMacro(Epsilon, double);
123 
125  unsigned int GetNumberOfParameters() const override
126  { return this->GetTransform()->GetNumberOfParameters(); }
127 
131  void Initialize() override;
132 
133 protected:
138  void PrintSelf(std::ostream & os, Indent indent) const override;
140 
142  void FormTrainingHistogram();
143 
145  MeasureType EvaluateMeasure(HistogramType & histogram) const override;
146 
147  double m_Epsilon;
148 };
149 } // End namespace itk.
150 
151 #ifndef ITK_MANUAL_INSTANTIATION
152 #include "itkKullbackLeiblerCompareHistogramImageToImageMetric.hxx"
153 #endif
154 
155 #endif // itkKullbackLeiblerCompareHistogramImageToImageMetric_h
Array class with size defined at construction time.
Definition: itkArray.h:46
Computes the Kubler Lieblach(KL) metric between the histogram of the two images to be registered and ...
typename Superclass::TransformParametersType TransformParametersType
Light weight base class for most itk classes.
typename Superclass::GradientPixelType GradientPixelType
typename Superclass::HistogramSizeType HistogramSizeType
typename Superclass::MovingImageConstPointer MovingImageConstPointer
typename Superclass::TransformPointer TransformPointer
typename HistogramType::MeasurementVectorType HistogramMeasurementVectorType
typename TransformType::ConstPointer TransformConstPointer
typename Superclass::FixedImageConstPointer FixedImageConstPointer
typename Superclass::InterpolatorPointer InterpolatorPointer
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.
typename Superclass::InterpolatorType InterpolatorType
typename Superclass::TransformJacobianType TransformJacobianType