ITK  5.2.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  * 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 itkCompareHistogramImageToImageMetric_h
19 #define itkCompareHistogramImageToImageMetric_h
20 
22 
23 namespace itk
24 {
55 template <typename TFixedImage, typename TMovingImage>
56 class ITK_TEMPLATE_EXPORT CompareHistogramImageToImageMetric
57  : public HistogramImageToImageMetric<TFixedImage, TMovingImage>
58 {
59 public:
60  ITK_DISALLOW_COPY_AND_MOVE(CompareHistogramImageToImageMetric);
61 
67 
70 
72  using RealType = typename Superclass::RealType;
73  using TransformType = typename Superclass::TransformType;
75  using TransformConstPointer = typename TransformType::ConstPointer;
76 
77  using TransformParametersType = typename Superclass::TransformParametersType;
78  using TransformJacobianType = typename Superclass::TransformJacobianType;
79  using GradientPixelType = typename Superclass::GradientPixelType;
80 
81  using MeasureType = typename Superclass::MeasureType;
82  using DerivativeType = typename Superclass::DerivativeType;
83  using FixedImageType = typename Superclass::FixedImageType;
84  using MovingImageType = typename Superclass::MovingImageType;
85  using FixedImageConstPointer = typename Superclass::FixedImageConstPointer;
86  using MovingImageConstPointer = typename Superclass::MovingImageConstPointer;
87 
88  using HistogramType = typename Superclass::HistogramType;
89  using HistogramSizeType = typename Superclass::HistogramSizeType;
90  using HistogramMeasurementVectorType = typename HistogramType::MeasurementVectorType;
91  using HistogramAbsoluteFrequencyType = typename HistogramType::AbsoluteFrequencyType;
93 
94  using HistogramIteratorType = typename HistogramType::Iterator;
95  using HistogramPointerType = typename HistogramType::Pointer;
96 
97  using InterpolatorType = typename Superclass::InterpolatorType;
98  using InterpolatorPointer = typename Superclass::InterpolatorPointer;
99 
100  using FixedImageRegionType = typename Superclass::FixedImageRegionType;
101 
103  itkSetMacro(TrainingHistogram, HistogramPointerType);
104  itkGetConstReferenceMacro(TrainingHistogram, HistogramPointerType);
106 
108  itkSetConstObjectMacro(TrainingFixedImage, FixedImageType);
109 
111  itkSetConstObjectMacro(TrainingMovingImage, MovingImageType);
112  itkGetConstObjectMacro(TrainingMovingImage, MovingImageType);
114 
116  itkSetObjectMacro(TrainingTransform, TransformType);
117  itkGetModifiableObjectMacro(TrainingTransform, TransformType);
119 
121  itkSetObjectMacro(TrainingInterpolator, InterpolatorType);
122  itkGetModifiableObjectMacro(TrainingInterpolator, InterpolatorType);
124 
126  itkSetMacro(TrainingFixedImageRegion, FixedImageRegionType);
127  itkGetConstReferenceMacro(TrainingFixedImageRegion, FixedImageRegionType);
129 
131  unsigned int
132  GetNumberOfParameters() const override
133  {
134  return this->GetTransform()->GetNumberOfParameters();
135  }
136 
139  void
140  Initialize() override;
141 
142 protected:
146  ~CompareHistogramImageToImageMetric() override = default;
147  void
148  PrintSelf(std::ostream & os, Indent indent) const override;
150 
152  void
153  FormTrainingHistogram();
154 
157  MeasureType
158  EvaluateMeasure(HistogramType & histogram) const override = 0;
159 
160 private:
167 };
168 } // End namespace itk.
169 
170 #ifndef ITK_MANUAL_INSTANTIATION
171 # include "itkCompareHistogramImageToImageMetric.hxx"
172 #endif
173 
174 #endif // itkCompareHistogramImageToImageMetric_h
itk::CompareHistogramImageToImageMetric::MovingImageType
typename Superclass::MovingImageType MovingImageType
Definition: itkCompareHistogramImageToImageMetric.h:84
itk::SingleValuedCostFunction::MeasureType
double MeasureType
Definition: itkSingleValuedCostFunction.h:50
itk::CompareHistogramImageToImageMetric::m_TrainingFixedImageRegion
FixedImageRegionType m_TrainingFixedImageRegion
Definition: itkCompareHistogramImageToImageMetric.h:165
itk::CompareHistogramImageToImageMetric::m_TrainingHistogram
HistogramPointerType m_TrainingHistogram
Definition: itkCompareHistogramImageToImageMetric.h:166
itk::CompareHistogramImageToImageMetric::HistogramMeasurementVectorType
typename HistogramType::MeasurementVectorType HistogramMeasurementVectorType
Definition: itkCompareHistogramImageToImageMetric.h:90
itk::CompareHistogramImageToImageMetric::FixedImageType
typename Superclass::FixedImageType FixedImageType
Definition: itkCompareHistogramImageToImageMetric.h:83
itk::CompareHistogramImageToImageMetric::TransformConstPointer
typename TransformType::ConstPointer TransformConstPointer
Definition: itkCompareHistogramImageToImageMetric.h:75
itk::CompareHistogramImageToImageMetric::HistogramType
typename Superclass::HistogramType HistogramType
Definition: itkCompareHistogramImageToImageMetric.h:88
itk::CompareHistogramImageToImageMetric::FixedImageRegionType
typename Superclass::FixedImageRegionType FixedImageRegionType
Definition: itkCompareHistogramImageToImageMetric.h:100
itk::CompareHistogramImageToImageMetric::FixedImageConstPointer
typename Superclass::FixedImageConstPointer FixedImageConstPointer
Definition: itkCompareHistogramImageToImageMetric.h:85
itk::CompareHistogramImageToImageMetric::TransformParametersType
typename Superclass::TransformParametersType TransformParametersType
Definition: itkCompareHistogramImageToImageMetric.h:77
itk::CompareHistogramImageToImageMetric::RealType
typename Superclass::RealType RealType
Definition: itkCompareHistogramImageToImageMetric.h:72
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::CompareHistogramImageToImageMetric::m_TrainingTransform
TransformPointer m_TrainingTransform
Definition: itkCompareHistogramImageToImageMetric.h:163
itk::CompareHistogramImageToImageMetric::m_TrainingFixedImage
FixedImageConstPointer m_TrainingFixedImage
Definition: itkCompareHistogramImageToImageMetric.h:161
itk::CompareHistogramImageToImageMetric::TransformJacobianType
typename Superclass::TransformJacobianType TransformJacobianType
Definition: itkCompareHistogramImageToImageMetric.h:78
itk::CompareHistogramImageToImageMetric::HistogramIteratorType
typename HistogramType::Iterator HistogramIteratorType
Definition: itkCompareHistogramImageToImageMetric.h:94
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::CompareHistogramImageToImageMetric::GradientPixelType
typename Superclass::GradientPixelType GradientPixelType
Definition: itkCompareHistogramImageToImageMetric.h:79
itk::CompareHistogramImageToImageMetric::TransformType
typename Superclass::TransformType TransformType
Definition: itkCompareHistogramImageToImageMetric.h:73
itk::CompareHistogramImageToImageMetric::GetNumberOfParameters
unsigned int GetNumberOfParameters() const override
Definition: itkCompareHistogramImageToImageMetric.h:132
itk::CompareHistogramImageToImageMetric::InterpolatorType
typename Superclass::InterpolatorType InterpolatorType
Definition: itkCompareHistogramImageToImageMetric.h:97
itk::CompareHistogramImageToImageMetric::HistogramFrequencyType
HistogramAbsoluteFrequencyType HistogramFrequencyType
Definition: itkCompareHistogramImageToImageMetric.h:92
itkHistogramImageToImageMetric.h
itk::HistogramImageToImageMetric::TransformPointer
typename Superclass::TransformPointer TransformPointer
Definition: itkHistogramImageToImageMetric.h:56
itk::CompareHistogramImageToImageMetric::HistogramAbsoluteFrequencyType
typename HistogramType::AbsoluteFrequencyType HistogramAbsoluteFrequencyType
Definition: itkCompareHistogramImageToImageMetric.h:91
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::Array
Array class with size defined at construction time.
Definition: itkArray.h:47
itk::CompareHistogramImageToImageMetric::InterpolatorPointer
typename Superclass::InterpolatorPointer InterpolatorPointer
Definition: itkCompareHistogramImageToImageMetric.h:98
itk::CompareHistogramImageToImageMetric::m_TrainingInterpolator
InterpolatorPointer m_TrainingInterpolator
Definition: itkCompareHistogramImageToImageMetric.h:164
itk::CompareHistogramImageToImageMetric::HistogramSizeType
typename Superclass::HistogramSizeType HistogramSizeType
Definition: itkCompareHistogramImageToImageMetric.h:89
itk::CompareHistogramImageToImageMetric::TransformPointer
typename Superclass::TransformPointer TransformPointer
Definition: itkCompareHistogramImageToImageMetric.h:74
itk::CompareHistogramImageToImageMetric::HistogramPointerType
typename HistogramType::Pointer HistogramPointerType
Definition: itkCompareHistogramImageToImageMetric.h:95
itk::CompareHistogramImageToImageMetric::m_TrainingMovingImage
MovingImageConstPointer m_TrainingMovingImage
Definition: itkCompareHistogramImageToImageMetric.h:162
itk::CompareHistogramImageToImageMetric::MovingImageConstPointer
typename Superclass::MovingImageConstPointer MovingImageConstPointer
Definition: itkCompareHistogramImageToImageMetric.h:86
itk::CompareHistogramImageToImageMetric
Compares Histograms between two images to be registered to a Training Histogram.
Definition: itkCompareHistogramImageToImageMetric.h:56
itk::HistogramImageToImageMetric
Computes similarity between two objects to be registered.
Definition: itkHistogramImageToImageMetric.h:39