ITK  4.13.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:
65 
69 
71  typedef typename Superclass::RealType RealType;
72  typedef typename Superclass::TransformType TransformType;
73  typedef typename Superclass::TransformPointer TransformPointer;
74  typedef typename TransformType::ConstPointer TransformConstPointer;
75 
76  typedef typename Superclass::TransformParametersType TransformParametersType;
77  typedef typename Superclass::TransformJacobianType TransformJacobianType;
78  typedef typename Superclass::GradientPixelType GradientPixelType;
79 
80  typedef typename Superclass::MeasureType MeasureType;
81  typedef typename Superclass::DerivativeType DerivativeType;
82  typedef typename Superclass::FixedImageType FixedImageType;
83  typedef typename Superclass::MovingImageType MovingImageType;
84  typedef typename Superclass::FixedImageConstPointer FixedImageConstPointer;
85  typedef typename Superclass::MovingImageConstPointer
87 
89  typedef typename Superclass::HistogramSizeType HistogramSizeType;
93 
96 
97  typedef typename Superclass::InterpolatorType InterpolatorType;
98  typedef typename Superclass::InterpolatorPointer InterpolatorPointer;
99 
100  typedef 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(void) const ITK_OVERRIDE
133  { return this->GetTransform()->GetNumberOfParameters(); }
134 
137  void Initialize() ITK_OVERRIDE;
138 
139 protected:
143  virtual ~CompareHistogramImageToImageMetric() ITK_OVERRIDE {}
144  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
146 
148  void FormTrainingHistogram();
149 
152  virtual MeasureType EvaluateMeasure(HistogramType & histogram) const ITK_OVERRIDE = 0;
153 
154 private:
155  // Purposely not implemented.
157  void operator=(Self const &); // Purposely not implemented.
158 
165 };
166 } // End namespace itk.
167 
168 #ifndef ITK_MANUAL_INSTANTIATION
169 #include "itkCompareHistogramImageToImageMetric.hxx"
170 #endif
171 
172 #endif // itkCompareHistogramImageToImageMetric_h
HistogramImageToImageMetric< TFixedImage, TMovingImage > Superclass
Superclass::MovingImageConstPointer MovingImageConstPointer
This class stores measurement vectors in the context of n-dimensional histogram.
Definition: itkHistogram.h:77
HistogramType::MeasurementVectorType HistogramMeasurementVectorType
FrequencyContainerType::AbsoluteFrequencyType AbsoluteFrequencyType
Definition: itkHistogram.h:112
Superclass::MeasurementVectorType MeasurementVectorType
Definition: itkHistogram.h:101
HistogramType::AbsoluteFrequencyType HistogramAbsoluteFrequencyType
Superclass::TransformParametersType TransformParametersType
class that walks through the elements of the histogram.
Definition: itkHistogram.h:428
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.