ITK  4.6.0
Insight Segmentation and Registration Toolkit
itkGradientDifferenceImageToImageMetric.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 __itkGradientDifferenceImageToImageMetric_h
19 #define __itkGradientDifferenceImageToImageMetric_h
20 
21 #include "itkImageToImageMetric.h"
22 
23 #include "itkSobelOperator.h"
25 #include "itkPoint.h"
26 #include "itkCastImageFilter.h"
27 #include "itkResampleImageFilter.h"
28 
29 namespace itk
30 {
57 template< typename TFixedImage, typename TMovingImage >
59  public ImageToImageMetric< TFixedImage, TMovingImage >
60 {
61 public:
62 
66 
69 
71  itkNewMacro(Self);
72 
75 
77  typedef typename Superclass::RealType RealType;
82 
89 
90  typedef typename TFixedImage::PixelType FixedImagePixelType;
91  typedef typename TMovingImage::PixelType MovedImagePixelType;
92 
93  itkStaticConstMacro(FixedImageDimension, unsigned int, TFixedImage::ImageDimension);
96  itkGetStaticConstMacro(FixedImageDimension) >
98 
101 
105 
108 
110 
113  itkStaticConstMacro(MovedImageDimension, unsigned int, MovingImageType::ImageDimension);
114 
116 
119 
121 
123  void GetDerivative(const TransformParametersType & parameters,
124  DerivativeType & derivative) const;
125 
127  MeasureType GetValue(const TransformParametersType & parameters) const;
128 
130  void GetValueAndDerivative(const TransformParametersType & parameters,
131  MeasureType & Value, DerivativeType & derivative) const;
132 
135  virtual void Initialize(void)
136  throw ( ExceptionObject );
137 
139  void WriteGradientImagesToFiles(void) const;
140 
143  itkSetMacro(DerivativeDelta, double);
144  itkGetConstReferenceMacro(DerivativeDelta, double);
146 
147 protected:
149  virtual ~GradientDifferenceImageToImageMetric() {}
150  void PrintSelf(std::ostream & os, Indent indent) const;
151 
153  void ComputeMovedGradientRange(void) const;
154 
156  void ComputeVariance(void) const;
157 
160  const double *subtractionFactor) const;
161 
164 
167 
168 private:
169  GradientDifferenceImageToImageMetric(const Self &); //purposely not
170  // implemented
171  void operator=(const Self &); //purposely not
172 
173  // implemented
174 
177 
181 
185 
188 
191 
193  itkGetStaticConstMacro(FixedImageDimension) >
195 
197 
200 
203 
205  itkGetStaticConstMacro(MovedImageDimension) >
207 
209 
211 };
212 } // end namespace itk
213 
214 #ifndef ITK_MANUAL_INSTANTIATION
215 #include "itkGradientDifferenceImageToImageMetric.hxx"
216 #endif
217 
218 #endif
Array class with size defined at construction time.
Definition: itkArray.h:50
MeasureType ComputeMeasure(const TransformParametersType &parameters, const double *subtractionFactor) const
A function object that determines a neighborhood of values at an image boundary according to a Neuman...
Light weight base class for most itk classes.
NeighborhoodOperatorImageFilter< FixedGradientImageType, FixedGradientImageType > FixedSobelFilter
ImageToImageMetric< TFixedImage, TMovingImage > Superclass
Resample an image via a coordinate transform.
FixedGradientPixelType m_MinFixedGradient[FixedImageDimension]
TransformType::Pointer TransformPointer
NumericTraits< MovingImagePixelType >::RealType RealType
Superclass::DerivativeType DerivativeType
MovingImageType::ConstPointer MovingImageConstPointer
MovedGradientPixelType m_Variance[FixedImageDimension]
FixedSobelFilter::Pointer m_FixedSobelFilters[itkGetStaticConstMacro(FixedImageDimension)]
void PrintSelf(std::ostream &os, Indent indent) const
TPixel PixelType
Definition: itkImage.h:89
itk::Image< RealType, itkGetStaticConstMacro(MovedImageDimension) > MovedGradientImageType
void GetDerivative(const TransformParametersType &parameters, DerivativeType &derivative) const
MovedSobelFilter::Pointer m_MovedSobelFilters[itkGetStaticConstMacro(MovedImageDimension)]
A NeighborhoodOperator for performing a directional Sobel edge-detection operation at a pixel locatio...
FixedGradientPixelType m_MaxFixedGradient[FixedImageDimension]
itk::Image< RealType, itkGetStaticConstMacro(FixedImageDimension) > FixedGradientImageType
NeighborhoodOperatorImageFilter< MovedGradientImageType, MovedGradientImageType > MovedSobelFilter
SobelOperator< FixedGradientPixelType, itkGetStaticConstMacro(FixedImageDimension) > m_FixedSobelOperators[FixedImageDimension]
itk::ResampleImageFilter< MovingImageType, TransformedMovingImageType > TransformMovingImageFilterType
Standard exception handling object.
MovedGradientPixelType m_MinMovedGradient[MovedImageDimension]
SobelOperator< MovedGradientPixelType, itkGetStaticConstMacro(MovedImageDimension) > m_MovedSobelOperators[MovedImageDimension]
ZeroFluxNeumannBoundaryCondition< FixedGradientImageType > m_FixedBoundCond
TransformMovingImageFilterType::Pointer m_TransformMovingImageFilter
TransformType::JacobianType TransformJacobianType
Computes similarity between two objects to be registered.
itk::CastImageFilter< TransformedMovingImageType, MovedGradientImageType > CastMovedImageFilterType
itk::Image< FixedImagePixelType, itkGetStaticConstMacro(FixedImageDimension) > TransformedMovingImageType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
void GetValueAndDerivative(const TransformParametersType &parameters, MeasureType &Value, DerivativeType &derivative) const
FixedImageType::ConstPointer FixedImageConstPointer
Superclass::MeasureType MeasureType
Applies a single NeighborhoodOperator to an image region.
MovedGradientPixelType m_MaxMovedGradient[MovedImageDimension]
Transform< CoordinateRepresentationType, itkGetStaticConstMacro(MovingImageDimension), itkGetStaticConstMacro(FixedImageDimension) > TransformType
Computes similarity between regions of two images.
itk::CastImageFilter< FixedImageType, FixedGradientImageType > CastFixedImageFilterType
TransformType::ParametersType TransformParametersType
Templated n-dimensional image class.
Definition: itkImage.h:75
ZeroFluxNeumannBoundaryCondition< MovedGradientImageType > m_MovedBoundCond
Casts input pixels to output pixel type.
MeasureType GetValue(const TransformParametersType &parameters) const