ITK  6.0.0
Insight Toolkit
itkCompareHistogramImageToImageMetric.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 itkCompareHistogramImageToImageMetric_h
19#define itkCompareHistogramImageToImageMetric_h
20
22
23namespace itk
24{
55template <typename TFixedImage, typename TMovingImage>
56class ITK_TEMPLATE_EXPORT CompareHistogramImageToImageMetric
57 : public HistogramImageToImageMetric<TFixedImage, TMovingImage>
58{
59public:
60 ITK_DISALLOW_COPY_AND_MOVE(CompareHistogramImageToImageMetric);
61
67
69 itkOverrideGetNameOfClassMacro(CompareHistogramImageToImageMetric);
70
72 using typename Superclass::RealType;
73 using typename Superclass::TransformType;
74 using typename Superclass::TransformPointer;
76
77 using typename Superclass::TransformParametersType;
78 using typename Superclass::TransformJacobianType;
79 using typename Superclass::GradientPixelType;
80
81 using typename Superclass::MeasureType;
82 using typename Superclass::DerivativeType;
83 using typename Superclass::FixedImageType;
84 using typename Superclass::MovingImageType;
85 using typename Superclass::FixedImageConstPointer;
86 using typename Superclass::MovingImageConstPointer;
87
88 using typename Superclass::HistogramType;
89 using typename Superclass::HistogramSizeType;
93
96
97 using typename Superclass::InterpolatorType;
98 using typename Superclass::InterpolatorPointer;
99
100 using typename Superclass::FixedImageRegionType;
101
103 itkSetMacro(TrainingHistogram, HistogramPointerType);
104 itkGetConstReferenceMacro(TrainingHistogram, HistogramPointerType);
108 itkSetConstObjectMacro(TrainingFixedImage, FixedImageType);
109 itkGetConstObjectMacro(TrainingFixedImage, FixedImageType);
113 itkSetConstObjectMacro(TrainingMovingImage, MovingImageType);
114 itkGetConstObjectMacro(TrainingMovingImage, MovingImageType);
118 itkSetObjectMacro(TrainingTransform, TransformType);
119 itkGetModifiableObjectMacro(TrainingTransform, TransformType);
123 itkSetObjectMacro(TrainingInterpolator, InterpolatorType);
124 itkGetModifiableObjectMacro(TrainingInterpolator, InterpolatorType);
128 itkSetMacro(TrainingFixedImageRegion, FixedImageRegionType);
129 itkGetConstReferenceMacro(TrainingFixedImageRegion, FixedImageRegionType);
133 unsigned int
134 GetNumberOfParameters() const override
135 {
136 return this->GetTransform()->GetNumberOfParameters();
137 }
138
141 void
142 Initialize() override;
143
144protected:
149 void
150 PrintSelf(std::ostream & os, Indent indent) const override;
154 void
156
160 EvaluateMeasure(HistogramType & histogram) const override = 0;
161
162private:
163 FixedImageConstPointer m_TrainingFixedImage{};
164 MovingImageConstPointer m_TrainingMovingImage{};
165 TransformPointer m_TrainingTransform{};
166 InterpolatorPointer m_TrainingInterpolator{};
167 FixedImageRegionType m_TrainingFixedImageRegion{};
168 HistogramPointerType m_TrainingHistogram{};
169};
170
171} // end namespace itk
172
173#ifndef ITK_MANUAL_INSTANTIATION
174# include "itkCompareHistogramImageToImageMetric.hxx"
175#endif
176
177#endif // itkCompareHistogramImageToImageMetric_h
Compares Histograms between two images to be registered to a Training Histogram.
typename HistogramType::AbsoluteFrequencyType HistogramAbsoluteFrequencyType
MeasureType EvaluateMeasure(HistogramType &histogram) const override=0
typename TransformType::ConstPointer TransformConstPointer
typename HistogramType::MeasurementVectorType HistogramMeasurementVectorType
~CompareHistogramImageToImageMetric() override=default
void PrintSelf(std::ostream &os, Indent indent) const override
Computes similarity between two objects to be registered.
typename FixedImageType::ConstPointer FixedImageConstPointer
typename TransformType::Pointer TransformPointer
typename FixedImageType::RegionType FixedImageRegionType
typename MovingImageType::ConstPointer MovingImageConstPointer
typename InterpolatorType::Pointer InterpolatorPointer
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Base class for all image interpolators.
Light weight base class for most itk classes.
class that walks through the elements of the histogram.
Definition: itkHistogram.h:433
This class stores measurement vectors in the context of n-dimensional histogram.
Definition: itkHistogram.h:78
typename FrequencyContainerType::AbsoluteFrequencyType AbsoluteFrequencyType
Definition: itkHistogram.h:112
Transform points and vectors from an input space to an output space.
Definition: itkTransform.h:84
SmartPointer< const Self > ConstPointer
SmartPointer< Self > Pointer
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....