ITK  4.3.0
Insight Segmentation and Registration Toolkit
itkKullbackLeiblerCompareHistogramImageToImageMetric.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 __itkKullbackLeiblerCompareHistogramImageToImageMetric_h
19 #define __itkKullbackLeiblerCompareHistogramImageToImageMetric_h
20 
22 
23 namespace itk
24 {
71 template< class TFixedImage, class TMovingImage >
73  public CompareHistogramImageToImageMetric< TFixedImage, TMovingImage >
74 {
75 public:
82 
84  itkNewMacro(Self);
85 
89 
91  typedef typename Superclass::RealType RealType;
92  typedef typename Superclass::TransformType TransformType;
93  typedef typename Superclass::TransformPointer TransformPointer;
95  typedef typename Superclass::TransformParametersType TransformParametersType;
96  typedef typename Superclass::TransformJacobianType TransformJacobianType;
97  typedef typename Superclass::GradientPixelType GradientPixelType;
98 
99  typedef typename Superclass::MeasureType MeasureType;
100  typedef typename Superclass::DerivativeType DerivativeType;
101  typedef typename Superclass::FixedImageType FixedImageType;
102  typedef typename Superclass::MovingImageType MovingImageType;
103  typedef typename Superclass::FixedImageConstPointer FixedImageConstPointer;
104  typedef typename Superclass::MovingImageConstPointer
106 
107  typedef typename Superclass::HistogramType HistogramType;
108  typedef typename Superclass::HistogramSizeType HistogramSizeType;
109  typedef typename Superclass::MeasurementVectorType
111 
112  typedef typename Superclass::HistogramFrequencyType HistogramFrequencyType;
113  typedef typename Superclass::HistogramIteratorType HistogramIteratorType;
114  typedef typename Superclass::HistogramPointerType HistogramPointerType;
115  typedef typename Superclass::InterpolatorType InterpolatorType;
116  typedef typename Superclass::InterpolatorPointer InterpolatorPointer;
117 
119  itkSetMacro(Epsilon, double);
120 
122  itkGetConstReferenceMacro(Epsilon, double);
123 
125  unsigned int GetNumberOfParameters(void) const
126  { return this->GetTransform()->GetNumberOfParameters(); }
127 
131  void Initialize()
132  throw ( ExceptionObject );
133 
134 protected:
138  virtual ~KullbackLeiblerCompareHistogramImageToImageMetric(){}
139  void PrintSelf(std::ostream & os, Indent indent) const;
141 
143  void FormTrainingHistogram()
144  throw ( ExceptionObject );
145 
147  virtual MeasureType EvaluateMeasure(HistogramType & histogram) const;
148 
149  double m_Epsilon;
150 
151 private:
152  // Purposely not implemented.
154  void operator=(Self const &); // Purposely not implemented.
155 };
156 } // End namespace itk.
157 
158 #ifndef ITK_MANUAL_INSTANTIATION
159 #include "itkKullbackLeiblerCompareHistogramImageToImageMetric.hxx"
160 #endif
161 
162 #endif // __itkKullbackLeiblerCompareHistogramImageToImageMetric_h
163