ITK  4.6.0
Insight Segmentation and Registration Toolkit
itkHistogramImageToImageMetric.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 __itkHistogramImageToImageMetric_h
19 #define __itkHistogramImageToImageMetric_h
20 
21 #include "itkHistogram.h"
22 #include "itkImageToImageMetric.h"
23 
24 namespace itk
25 {
38 template< typename TFixedImage, typename TMovingImage >
40  public ImageToImageMetric< TFixedImage, TMovingImage >
41 {
42 public:
48 
51 
53  typedef typename Superclass::RealType RealType;
64  typedef typename Superclass::FixedImageType::PixelType FixedImagePixelType;
66  typedef typename Superclass::MovingImageType::PixelType MovingImagePixelType;
67  typedef typename Superclass::FixedImageConstPointer
71 
76 
80 
82  void Initialize()
83  throw ( ExceptionObject );
84 
87  void SetTransform(TransformType *transform);
88 
91  itkSetMacro(HistogramSize, HistogramSizeType);
92 
94  itkGetConstReferenceMacro(HistogramSize, HistogramSizeType);
95 
98  itkSetMacro(UpperBoundIncreaseFactor, double);
99  itkGetConstMacro(UpperBoundIncreaseFactor, double);
101 
103  itkSetMacro(PaddingValue, FixedImagePixelType);
104 
106  itkGetConstReferenceMacro(PaddingValue, FixedImagePixelType);
107 
111  itkGetConstReferenceMacro(Histogram, HistogramPointer);
112 
116  itkSetMacro(UsePaddingValue, bool);
117  itkGetConstMacro(UsePaddingValue, bool);
119 
121  itkSetMacro(DerivativeStepLength, double);
122 
124  itkGetConstMacro(DerivativeStepLength, double);
125 
127  typedef Array< double > ScalesType;
128 
130  itkSetMacro(DerivativeStepLengthScales, ScalesType);
131 
133  itkGetConstReferenceMacro(DerivativeStepLengthScales, ScalesType);
134 
136  MeasureType GetValue(const TransformParametersType & parameters) const;
137 
139  void GetDerivative(const TransformParametersType & parameters,
140  DerivativeType & derivative) const;
141 
143  void GetValueAndDerivative(const TransformParametersType & parameters,
144  MeasureType & Value,
145  DerivativeType & Derivative) const;
146 
150  void SetLowerBound(const MeasurementVectorType & bound);
151 
153  const MeasurementVectorType & GetLowerBound() const;
154 
158  void SetUpperBound(const MeasurementVectorType & bound);
159 
161  const MeasurementVectorType & GetUpperBound() const;
162 
163 protected:
167  virtual ~HistogramImageToImageMetric() {}
168 
171 
174 
177 
180 
184 
188 
191  void ComputeHistogram(const TransformParametersType & parameters,
192  HistogramType & histogram) const;
193 
196  void ComputeHistogram(const TransformParametersType & parameters,
197  unsigned int parameter,
198  double step,
199  HistogramType & histogram) const;
200 
202  void CopyHistogram(HistogramType & target, HistogramType & source) const;
203 
206  virtual MeasureType EvaluateMeasure(HistogramType & histogram) const = 0;
207 
209  void PrintSelf(std::ostream & os, Indent indent) const;
210 
211 private:
212  HistogramImageToImageMetric(const Self &); //purposely not implemented
213  void operator=(const Self &); //purposely not implemented
214 
217 
222 
225 
228 
232 };
233 } // end namespace itk
234 
235 #ifndef ITK_MANUAL_INSTANTIATION
236 #include "itkHistogramImageToImageMetric.hxx"
237 #endif
238 
239 #endif // __itkHistogramImageToImageMetric_h
Array class with size defined at construction time.
Definition: itkArray.h:50
Superclass::TransformPointer TransformPointer
TransformType::OutputPointType OutputPointType
Light weight base class for most itk classes.
void SetTransform(TransformType *transform)
void GetValueAndDerivative(const TransformParametersType &parameters, MeasureType &Value, DerivativeType &Derivative) const
TransformType::InputPointType InputPointType
void SetLowerBound(const MeasurementVectorType &bound)
Superclass::FixedImageType::PixelType FixedImagePixelType
This class stores measurement vectors in the context of n-dimensional histogram.
Definition: itkHistogram.h:77
void ComputeHistogram(const TransformParametersType &parameters, HistogramType &histogram) const
NumericTraits< MovingImagePixelType >::RealType RealType
Superclass::DerivativeType DerivativeType
MovingImageType::ConstPointer MovingImageConstPointer
void SetUpperBound(const MeasurementVectorType &bound)
MeasureType GetValue(const TransformParametersType &parameters) const
void CopyHistogram(HistogramType &target, HistogramType &source) const
void GetDerivative(const TransformParametersType &parameters, DerivativeType &derivative) const
Superclass::FixedImageConstPointer FixedImageConstPointerType
Superclass::MeasurementVectorType MeasurementVectorType
Definition: itkHistogram.h:101
void PrintSelf(std::ostream &os, Indent indent) const
const MeasurementVectorType & GetUpperBound() const
Statistics::Histogram< double > HistogramType
Standard exception handling object.
HistogramType::MeasurementVectorType MeasurementVectorType
virtual MeasureType EvaluateMeasure(HistogramType &histogram) const =0
Superclass::TransformParametersType TransformParametersType
TransformType::JacobianType TransformJacobianType
Superclass::TransformJacobianType TransformJacobianType
Superclass::GradientPixelType GradientPixelType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
FixedImageType::ConstPointer FixedImageConstPointer
const MeasurementVectorType & GetLowerBound() const
Computes similarity between two objects to be registered.
Superclass::MeasureType MeasureType
CovariantVector< RealType, itkGetStaticConstMacro(MovingImageDimension) > GradientPixelType
Transform< CoordinateRepresentationType, itkGetStaticConstMacro(MovingImageDimension), itkGetStaticConstMacro(FixedImageDimension) > TransformType
Computes similarity between regions of two images.
TransformType::ParametersType TransformParametersType
Superclass::MovingImageType::PixelType MovingImagePixelType
Superclass::MovingImageConstPointer MovingImageConstPointerType
ImageToImageMetric< TFixedImage, TMovingImage > Superclass