ITK  6.0.0
Insight Toolkit
itkKullbackLeiblerCompareHistogramImageToImageMetric.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
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  * https://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_MOVE(KullbackLeiblerCompareHistogramImageToImageMetric);
77 
83 
85  itkNewMacro(Self);
86 
88  itkOverrideGetNameOfClassMacro(KullbackLeiblerCompareHistogramImageToImageMetric);
89 
91  using typename Superclass::RealType;
92  using typename Superclass::TransformType;
93  using typename Superclass::TransformPointer;
95  using typename Superclass::TransformParametersType;
96  using typename Superclass::TransformJacobianType;
97  using typename Superclass::GradientPixelType;
98 
99  using typename Superclass::MeasureType;
100  using typename Superclass::DerivativeType;
101  using typename Superclass::FixedImageType;
102  using typename Superclass::MovingImageType;
103  using typename Superclass::FixedImageConstPointer;
104  using typename Superclass::MovingImageConstPointer;
105 
106  using typename Superclass::HistogramType;
107  using typename Superclass::HistogramSizeType;
108  using HistogramMeasurementVectorType = typename Superclass::MeasurementVectorType;
109 
110  using typename Superclass::HistogramFrequencyType;
111  using typename Superclass::HistogramIteratorType;
112  using typename Superclass::HistogramPointerType;
113  using typename Superclass::InterpolatorType;
114  using typename Superclass::InterpolatorPointer;
115 
117  itkSetMacro(Epsilon, double);
118 
120  itkGetConstReferenceMacro(Epsilon, double);
121 
123  unsigned int
124  GetNumberOfParameters() const override
125  {
126  return this->GetTransform()->GetNumberOfParameters();
127  }
128 
132  void
133  Initialize() override;
134 
135 protected:
140  void
141  PrintSelf(std::ostream & os, Indent indent) const override;
145  void
146  FormTrainingHistogram();
147 
149  MeasureType
150  EvaluateMeasure(HistogramType & histogram) const override;
151 
152  double m_Epsilon{};
153 };
154 } // End namespace itk.
155 
156 #ifndef ITK_MANUAL_INSTANTIATION
157 # include "itkKullbackLeiblerCompareHistogramImageToImageMetric.hxx"
158 #endif
159 
160 #endif // itkKullbackLeiblerCompareHistogramImageToImageMetric_h
ConstPointer
SmartPointer< const Self > ConstPointer
Definition: itkAddImageFilter.h:94
itk::CompareHistogramImageToImageMetric::HistogramMeasurementVectorType
typename HistogramType::MeasurementVectorType HistogramMeasurementVectorType
Definition: itkCompareHistogramImageToImageMetric.h:90
itk::CompareHistogramImageToImageMetric::TransformConstPointer
typename TransformType::ConstPointer TransformConstPointer
Definition: itkCompareHistogramImageToImageMetric.h:75
itk::KullbackLeiblerCompareHistogramImageToImageMetric
Computes the Kubler Lieblach(KL) metric between the histogram of the two images to be registered and ...
Definition: itkKullbackLeiblerCompareHistogramImageToImageMetric.h:72
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::KullbackLeiblerCompareHistogramImageToImageMetric::GetNumberOfParameters
unsigned int GetNumberOfParameters() const override
Definition: itkKullbackLeiblerCompareHistogramImageToImageMetric.h:124
itkCompareHistogramImageToImageMetric.h
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::CompareHistogramImageToImageMetric
Compares Histograms between two images to be registered to a Training Histogram.
Definition: itkCompareHistogramImageToImageMetric.h:56