ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkCompareHistogramImageToImageMetric.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 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_ASSIGN(CompareHistogramImageToImageMetric);
61 
67 
71 
73  using RealType = typename Superclass::RealType;
74  using TransformType = typename Superclass::TransformType;
76  using TransformConstPointer = typename TransformType::ConstPointer;
77 
78  using TransformParametersType = typename Superclass::TransformParametersType;
79  using TransformJacobianType = typename Superclass::TransformJacobianType;
80  using GradientPixelType = typename Superclass::GradientPixelType;
81 
82  using MeasureType = typename Superclass::MeasureType;
83  using DerivativeType = typename Superclass::DerivativeType;
84  using FixedImageType = typename Superclass::FixedImageType;
85  using MovingImageType = typename Superclass::MovingImageType;
86  using FixedImageConstPointer = typename Superclass::FixedImageConstPointer;
87  using MovingImageConstPointer = typename Superclass::MovingImageConstPointer;
88 
89  using HistogramType = typename Superclass::HistogramType;
90  using HistogramSizeType = typename Superclass::HistogramSizeType;
91  using HistogramMeasurementVectorType = typename HistogramType::MeasurementVectorType;
92  using HistogramAbsoluteFrequencyType = typename HistogramType::AbsoluteFrequencyType;
94 
95  using HistogramIteratorType = typename HistogramType::Iterator;
96  using HistogramPointerType = typename HistogramType::Pointer;
97 
98  using InterpolatorType = typename Superclass::InterpolatorType;
99  using InterpolatorPointer = typename Superclass::InterpolatorPointer;
100 
101  using FixedImageRegionType = typename Superclass::FixedImageRegionType;
102 
104  itkSetMacro(TrainingHistogram, HistogramPointerType);
105  itkGetConstReferenceMacro(TrainingHistogram, HistogramPointerType);
107 
109  itkSetConstObjectMacro(TrainingFixedImage, FixedImageType);
110 
112  itkSetConstObjectMacro(TrainingMovingImage, MovingImageType);
113  itkGetConstObjectMacro(TrainingMovingImage, MovingImageType);
115 
117  itkSetObjectMacro(TrainingTransform, TransformType);
118  itkGetModifiableObjectMacro(TrainingTransform, TransformType);
120 
122  itkSetObjectMacro(TrainingInterpolator, InterpolatorType);
123  itkGetModifiableObjectMacro(TrainingInterpolator, InterpolatorType);
125 
127  itkSetMacro(TrainingFixedImageRegion, FixedImageRegionType);
128  itkGetConstReferenceMacro(TrainingFixedImageRegion, FixedImageRegionType);
130 
132  unsigned int GetNumberOfParameters() const override
133  { return this->GetTransform()->GetNumberOfParameters(); }
134 
137  void Initialize() override;
138 
139 protected:
143  ~CompareHistogramImageToImageMetric() override = default;
144  void PrintSelf(std::ostream & os, Indent indent) const override;
146 
148  void FormTrainingHistogram();
149 
152  MeasureType EvaluateMeasure(HistogramType & histogram) const override = 0;
153 
154 private:
161 };
162 } // End namespace itk.
163 
164 #ifndef ITK_MANUAL_INSTANTIATION
165 #include "itkCompareHistogramImageToImageMetric.hxx"
166 #endif
167 
168 #endif // itkCompareHistogramImageToImageMetric_h
Array class with size defined at construction time.
Definition: itkArray.h:46
typename Superclass::FixedImageRegionType FixedImageRegionType
typename Superclass::TransformParametersType TransformParametersType
Light weight base class for most itk classes.
typename HistogramType::AbsoluteFrequencyType HistogramAbsoluteFrequencyType
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
typename Superclass::TransformPointer TransformPointer
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