ITK  4.9.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 >
57  public HistogramImageToImageMetric< TFixedImage, TMovingImage >
58 {
59 public:
65 
69 
71  typedef typename Superclass::RealType RealType;
74  typedef typename TransformType::ConstPointer TransformConstPointer;
75 
79 
87 
93 
96 
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() throw ( ExceptionObject ) ITK_OVERRIDE;
138 
139 protected:
143  virtual ~CompareHistogramImageToImageMetric(){}
144  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
146 
148  void FormTrainingHistogram()
149  throw ( ExceptionObject );
150 
153  virtual MeasureType EvaluateMeasure(HistogramType & histogram) const ITK_OVERRIDE = 0;
154 
155 private:
156  // Purposely not implemented.
158  void operator=(Self const &); // Purposely not implemented.
159 
166 };
167 } // End namespace itk.
168 
169 #ifndef ITK_MANUAL_INSTANTIATION
170 #include "itkCompareHistogramImageToImageMetric.hxx"
171 #endif
172 
173 #endif // itkCompareHistogramImageToImageMetric_h
virtual MeasureType EvaluateMeasure(HistogramType &histogram) const override=0
Superclass::TransformPointer TransformPointer
HistogramImageToImageMetric< TFixedImage, TMovingImage > Superclass
void PrintSelf(std::ostream &os, Indent indent) const override
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
virtual NumberOfParametersType GetNumberOfParameters(void) const override
Definition: itkTransform.h:415
MovingImageType::ConstPointer MovingImageConstPointer
virtual const TransformType * GetTransform() const
Superclass::MeasurementVectorType MeasurementVectorType
Definition: itkHistogram.h:101
HistogramType::AbsoluteFrequencyType HistogramAbsoluteFrequencyType
Standard exception handling object.
Superclass::TransformParametersType TransformParametersType
InterpolatorType::Pointer InterpolatorPointer
Superclass::TransformParametersType TransformParametersType
class that walks through the elements of the histogram.
Definition: itkHistogram.h:427
InterpolateImageFunction< MovingImageType, CoordinateRepresentationType > InterpolatorType
Superclass::TransformJacobianType TransformJacobianType
Superclass::GradientPixelType GradientPixelType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
FixedImageType::ConstPointer FixedImageConstPointer
Compares Histograms between two images to be registered to a Training Histogram.
Computes similarity between two objects to be registered.
FixedImageType::RegionType FixedImageRegionType