30 #ifndef __itkGradientDifferenceImageToImageMetric2_h
31 #define __itkGradientDifferenceImageToImageMetric2_h
35 #include "itkSobelOperator.h"
36 #include "itkNeighborhoodOperatorImageFilter.h"
38 #include "itkCastImageFilter.h"
39 #include "itkResampleImageFilter.h"
40 #include "itkOptimizer.h"
70 template <
class TFixedImage,
class TMovingImage >
91 #if defined(_MSC_VER) && (_MSC_VER == 1300)
94 typedef typename Superclass::RealType
RealType;
116 itkStaticConstMacro( FixedImageDimension,
unsigned int,
117 FixedImageType::ImageDimension );
118 itkStaticConstMacro( MovedImageDimension,
unsigned int,
119 MovingImageType::ImageDimension );
124 typedef itk::Image< FixedImagePixelType, itkGetStaticConstMacro( FixedImageDimension ) >
126 typedef itk::ResampleImageFilter< MovingImageType, TransformedMovingImageType >
131 typedef itk::Image< RealType, itkGetStaticConstMacro( FixedImageDimension ) >
133 typedef itk::CastImageFilter< FixedImageType, FixedGradientImageType >
137 typedef itk::Image< RealType, itkGetStaticConstMacro( MovedImageDimension ) >
139 typedef itk::CastImageFilter< TransformedMovingImageType, MovedGradientImageType >
155 virtual void Initialize(
void) throw ( ExceptionObject );
158 void WriteGradientImagesToFiles(
void) const;
162 itkGetConstReferenceMacro( Scales, ScalesType );
166 itkSetMacro( DerivativeDelta,
double );
167 itkGetConstReferenceMacro( DerivativeDelta,
double );
171 virtual ~GradientDifferenceImageToImageMetric() {};
172 void PrintSelf(std::ostream& os, Indent indent)
const;
175 void ComputeMovedGradientRange(
void )
const;
178 void ComputeVariance(
void )
const;
181 MeasureType ComputeMeasure(
const TransformParametersType ¶meters,
182 const double *subtractionFactor )
const;
184 typedef NeighborhoodOperatorImageFilter<
187 typedef NeighborhoodOperatorImageFilter<
192 void operator=(
const Self&);
212 itkGetStaticConstMacro(FixedImageDimension) >
213 m_FixedSobelOperators[FixedImageDimension];
215 typename FixedSobelFilter::Pointer m_FixedSobelFilters[itkGetStaticConstMacro
216 ( FixedImageDimension )];
225 itkGetStaticConstMacro(MovedImageDimension) >
226 m_MovedSobelOperators[MovedImageDimension];
228 typename MovedSobelFilter::Pointer m_MovedSobelFilters[itkGetStaticConstMacro
229 ( MovedImageDimension )];
242 #ifndef ITK_MANUAL_INSTANTIATION
243 #include "itkGradientDifferenceImageToImageMetric2.hxx"