Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef __itkAdvancedNormalizedCorrelationImageToImageMetric_h
00016 #define __itkAdvancedNormalizedCorrelationImageToImageMetric_h
00017
00018 #include "itkAdvancedImageToImageMetric.h"
00019
00020
00021 namespace itk
00022 {
00082 template < class TFixedImage, class TMovingImage >
00083 class AdvancedNormalizedCorrelationImageToImageMetric :
00084 public AdvancedImageToImageMetric< TFixedImage, TMovingImage >
00085 {
00086 public:
00087
00089 typedef AdvancedNormalizedCorrelationImageToImageMetric Self;
00090 typedef AdvancedImageToImageMetric<
00091 TFixedImage, TMovingImage > Superclass;
00092 typedef SmartPointer<Self> Pointer;
00093 typedef SmartPointer<const Self> ConstPointer;
00094
00096 itkNewMacro( Self );
00097
00099 itkTypeMacro( AdvancedNormalizedCorrelationImageToImageMetric, AdvancedImageToImageMetric );
00100
00102 typedef typename
00103 Superclass::CoordinateRepresentationType CoordinateRepresentationType;
00104 typedef typename Superclass::MovingImageType MovingImageType;
00105 typedef typename Superclass::MovingImagePixelType MovingImagePixelType;
00106 typedef typename Superclass::MovingImageConstPointer MovingImageConstPointer;
00107 typedef typename Superclass::FixedImageType FixedImageType;
00108 typedef typename Superclass::FixedImageConstPointer FixedImageConstPointer;
00109 typedef typename Superclass::FixedImageRegionType FixedImageRegionType;
00110 typedef typename Superclass::TransformType TransformType;
00111 typedef typename Superclass::TransformPointer TransformPointer;
00112 typedef typename Superclass::InputPointType InputPointType;
00113 typedef typename Superclass::OutputPointType OutputPointType;
00114 typedef typename Superclass::TransformParametersType TransformParametersType;
00115 typedef typename Superclass::TransformJacobianType TransformJacobianType;
00116 typedef typename Superclass::InterpolatorType InterpolatorType;
00117 typedef typename Superclass::InterpolatorPointer InterpolatorPointer;
00118 typedef typename Superclass::RealType RealType;
00119 typedef typename Superclass::GradientPixelType GradientPixelType;
00120 typedef typename Superclass::GradientImageType GradientImageType;
00121 typedef typename Superclass::GradientImagePointer GradientImagePointer;
00122 typedef typename Superclass::GradientImageFilterType GradientImageFilterType;
00123 typedef typename Superclass::GradientImageFilterPointer GradientImageFilterPointer;
00124 typedef typename Superclass::FixedImageMaskType FixedImageMaskType;
00125 typedef typename Superclass::FixedImageMaskPointer FixedImageMaskPointer;
00126 typedef typename Superclass::MovingImageMaskType MovingImageMaskType;
00127 typedef typename Superclass::MovingImageMaskPointer MovingImageMaskPointer;
00128 typedef typename Superclass::MeasureType MeasureType;
00129 typedef typename Superclass::DerivativeType DerivativeType;
00130 typedef typename Superclass::ParametersType ParametersType;
00131 typedef typename Superclass::FixedImagePixelType FixedImagePixelType;
00132 typedef typename Superclass::MovingImageRegionType MovingImageRegionType;
00133 typedef typename Superclass::ImageSamplerType ImageSamplerType;
00134 typedef typename Superclass::ImageSamplerPointer ImageSamplerPointer;
00135 typedef typename Superclass::ImageSampleContainerType ImageSampleContainerType;
00136 typedef typename
00137 Superclass::ImageSampleContainerPointer ImageSampleContainerPointer;
00138 typedef typename Superclass::FixedImageLimiterType FixedImageLimiterType;
00139 typedef typename Superclass::MovingImageLimiterType MovingImageLimiterType;
00140 typedef typename
00141 Superclass::FixedImageLimiterOutputType FixedImageLimiterOutputType;
00142 typedef typename
00143 Superclass::MovingImageLimiterOutputType MovingImageLimiterOutputType;
00144 typedef typename
00145 Superclass::MovingImageDerivativeScalesType MovingImageDerivativeScalesType;
00146
00148 itkStaticConstMacro( FixedImageDimension, unsigned int,
00149 FixedImageType::ImageDimension );
00150
00152 itkStaticConstMacro( MovingImageDimension, unsigned int,
00153 MovingImageType::ImageDimension );
00154
00156 MeasureType GetValue( const TransformParametersType & parameters ) const;
00157
00159 void GetDerivative( const TransformParametersType & parameters,
00160 DerivativeType & Derivative ) const;
00161
00163 void GetValueAndDerivative( const TransformParametersType & parameters,
00164 MeasureType& Value, DerivativeType& Derivative ) const;
00165
00170 itkSetMacro( SubtractMean, bool );
00171 itkGetConstReferenceMacro( SubtractMean, bool );
00172 itkBooleanMacro( SubtractMean );
00173
00174 protected:
00175 AdvancedNormalizedCorrelationImageToImageMetric();
00176 virtual ~AdvancedNormalizedCorrelationImageToImageMetric() {};
00177 void PrintSelf( std::ostream& os, Indent indent ) const;
00178
00182 typedef typename Superclass::FixedImageIndexType FixedImageIndexType;
00183 typedef typename Superclass::FixedImageIndexValueType FixedImageIndexValueType;
00184 typedef typename Superclass::MovingImageIndexType MovingImageIndexType;
00185 typedef typename Superclass::FixedImagePointType FixedImagePointType;
00186 typedef typename Superclass::MovingImagePointType MovingImagePointType;
00187 typedef typename Superclass::MovingImageContinuousIndexType MovingImageContinuousIndexType;
00188 typedef typename Superclass::BSplineInterpolatorType BSplineInterpolatorType;
00189 typedef typename Superclass::CentralDifferenceGradientFilterType CentralDifferenceGradientFilterType;
00190 typedef typename Superclass::MovingImageDerivativeType MovingImageDerivativeType;
00191 typedef typename Superclass::NonZeroJacobianIndicesType NonZeroJacobianIndicesType;
00192
00196 void EvaluateTransformJacobianInnerProduct(
00197 const TransformJacobianType & jacobian,
00198 const MovingImageDerivativeType & movingImageDerivative,
00199 DerivativeType & imageJacobian) const;
00200
00203 void UpdateDerivativeTerms(
00204 const RealType fixedImageValue,
00205 const RealType movingImageValue,
00206 const DerivativeType & imageJacobian,
00207 const NonZeroJacobianIndicesType & nzji,
00208 DerivativeType & derivativeF,
00209 DerivativeType & derivativeM,
00210 DerivativeType & differential ) const;
00211
00212 private:
00213 AdvancedNormalizedCorrelationImageToImageMetric(const Self&);
00214 void operator=(const Self&);
00215
00216 bool m_SubtractMean;
00217
00218 };
00219
00220 }
00221
00222 #ifndef ITK_MANUAL_INSTANTIATION
00223 #include "itkAdvancedNormalizedCorrelationImageToImageMetric.txx"
00224 #endif
00225
00226 #endif // end #ifndef __itkAdvancedNormalizedCorrelationImageToImageMetric_h
00227