ITK  4.0.0
Insight Segmentation and Registration Toolkit
itkImageToImageMetricv4.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 #ifndef __itkImageToImageMetricv4_h
00019 #define __itkImageToImageMetricv4_h
00020 
00021 #include "itkCovariantVector.h"
00022 #include "itkImageFunction.h"
00023 #include "itkObjectToObjectMetric.h"
00024 #include "itkInterpolateImageFunction.h"
00025 #include "itkSpatialObject.h"
00026 #include "itkResampleImageFilter.h"
00027 #include "itkThreadedIndexedContainerPartitioner.h"
00028 #include "itkThreadedImageRegionPartitioner.h"
00029 #include "itkImageToImageFilter.h"
00030 #include "itkImageToImageMetricv4GetValueAndDerivativeThreader.h"
00031 #include "itkGradientRecursiveGaussianImageFilter.h"
00032 #include "itkPointSet.h"
00033 
00034 namespace itk
00035 {
00185 template<class TFixedImage,class TMovingImage,class TVirtualImage = TFixedImage>
00186 class ITK_EXPORT ImageToImageMetricv4 : public ObjectToObjectMetric
00187 {
00188 public:
00189 
00191   typedef ImageToImageMetricv4       Self;
00192   typedef ObjectToObjectMetric       Superclass;
00193   typedef SmartPointer<Self>         Pointer;
00194   typedef SmartPointer<const Self>   ConstPointer;
00195 
00197   itkTypeMacro(ImageToImageMetricv4, ObjectToObjectMetric);
00198 
00200   typedef typename Superclass::InternalComputationValueType
00201                                                   InternalComputationValueType;
00202 
00204   typedef typename Superclass::CoordinateRepresentationType
00205                                                   CoordinateRepresentationType;
00206 
00208   typedef typename Superclass::ParametersType       ParametersType;
00209   typedef typename Superclass::ParametersValueType  ParametersValueType;
00210 
00212   typedef typename Superclass::GradientSourceType GradientSourceType;
00213 
00215   typedef TFixedImage                             FixedImageType;
00216   typedef typename FixedImageType::PixelType      FixedImagePixelType;
00217   typedef typename FixedImageType::Pointer        FixedImagePointer;
00218   typedef typename FixedImageType::ConstPointer   FixedImageConstPointer;
00219   typedef typename FixedImageType::PointType      FixedImagePointType;
00220   typedef typename FixedImageType::IndexType      FixedImageIndexType;
00221   typedef TMovingImage                            MovingImageType;
00222   typedef typename MovingImageType::PixelType     MovingImagePixelType;
00223   typedef typename MovingImageType::Pointer       MovingImagePointer;
00224   typedef typename MovingImageType::ConstPointer  MovingImageConstPointer;
00225   typedef typename MovingImageType::PointType     MovingImagePointType;
00226   typedef typename MovingImageType::RegionType    MovingImageRegionType;
00227   typedef typename MovingImageType::IndexType     MovingImageIndexType;
00228 
00230   typedef TVirtualImage                             VirtualImageType;
00231   typedef typename VirtualImageType::PixelType      VirtualImagePixelType;
00232   typedef typename VirtualImageType::Pointer        VirtualImagePointer;
00233   typedef typename VirtualImageType::RegionType     VirtualRegionType;
00234   typedef typename VirtualRegionType::SizeType      VirtualSizeType;
00235   typedef typename VirtualImageType::SpacingType    VirtualSpacingType;
00236   typedef typename VirtualImageType::PointType      VirtualOriginType;
00237   typedef typename VirtualImageType::PointType      VirtualPointType;
00238   typedef typename VirtualImageType::DirectionType  VirtualDirectionType;
00239   typedef typename VirtualImageType::SizeType       VirtualRadiusType;
00240   typedef typename VirtualImageType::IndexType      VirtualIndexType;
00241 
00242   /* Image dimension accessors */
00243   typedef unsigned int   ImageDimensionType;
00244   itkStaticConstMacro(FixedImageDimension, ImageDimensionType,
00245       ::itk::GetImageDimension<FixedImageType>::ImageDimension);
00246   itkStaticConstMacro(MovingImageDimension, ImageDimensionType,
00247       ::itk::GetImageDimension<MovingImageType>::ImageDimension);
00248   itkStaticConstMacro(VirtualImageDimension, ImageDimensionType,
00249       ::itk::GetImageDimension<VirtualImageType>::ImageDimension);
00250 
00252   typedef Transform<CoordinateRepresentationType,
00253     itkGetStaticConstMacro( MovingImageDimension ),
00254     itkGetStaticConstMacro( VirtualImageDimension )> MovingTransformType;
00255 
00256   typedef Transform<CoordinateRepresentationType,
00257     itkGetStaticConstMacro( FixedImageDimension ),
00258     itkGetStaticConstMacro( VirtualImageDimension )> FixedTransformType;
00259 
00260   typedef typename FixedTransformType::Pointer         FixedTransformPointer;
00261   typedef typename FixedTransformType::InputPointType  FixedInputPointType;
00262   typedef typename FixedTransformType::OutputPointType FixedOutputPointType;
00263   typedef typename FixedTransformType::ParametersType
00264                                                 FixedTransformParametersType;
00265 
00266   typedef typename MovingTransformType::Pointer         MovingTransformPointer;
00267   typedef typename MovingTransformType::InputPointType  MovingInputPointType;
00268   typedef typename MovingTransformType::OutputPointType MovingOutputPointType;
00269   typedef typename MovingTransformType::ParametersType
00270                                                 MovingTransformParametersType;
00271 
00273   typedef typename FixedTransformType::JacobianType     JacobianType;
00274   typedef typename FixedTransformType::JacobianType     FixedTransformJacobianType;
00275   typedef typename MovingTransformType::JacobianType    MovingTransformJacobianType;
00276 
00279   typedef SpatialObject< itkGetStaticConstMacro(FixedImageDimension) >
00280                                                        FixedImageMaskType;
00281   typedef typename FixedImageMaskType::Pointer         FixedImageMaskPointer;
00282   typedef typename FixedImageMaskType::ConstPointer
00283                                                   FixedImageMaskConstPointer;
00284 
00287   typedef SpatialObject< itkGetStaticConstMacro(MovingImageDimension) >
00288                                                         MovingImageMaskType;
00289   typedef typename MovingImageMaskType::Pointer         MovingImageMaskPointer;
00290   typedef typename MovingImageMaskType::ConstPointer
00291                                                    MovingImageMaskConstPointer;
00292 
00294   typedef PointSet<typename FixedImageType::PixelType,
00295                    itkGetStaticConstMacro(FixedImageDimension)>
00296                                                      FixedSampledPointSetType;
00297   typedef typename FixedSampledPointSetType::Pointer FixedSampledPointSetPointer;
00298   typedef typename FixedSampledPointSetType::ConstPointer FixedSampledPointSetConstPointer;
00299 
00300   typedef PointSet<typename VirtualImageType::PixelType,
00301                    itkGetStaticConstMacro(VirtualImageDimension)>
00302                                                      VirtualSampledPointSetType;
00303 
00304   typedef typename VirtualSampledPointSetType::Pointer VirtualSampledPointSetPointer;
00305 
00307   typedef InterpolateImageFunction< FixedImageType,
00308                                     CoordinateRepresentationType >
00309                                                       FixedInterpolatorType;
00310   typedef InterpolateImageFunction< MovingImageType,
00311                                     CoordinateRepresentationType >
00312                                                       MovingInterpolatorType;
00313   typedef typename FixedInterpolatorType::Pointer     FixedInterpolatorPointer;
00314   typedef typename MovingInterpolatorType::Pointer    MovingInterpolatorPointer;
00315 
00317   typedef   CovariantVector< CoordinateRepresentationType,
00318                              itkGetStaticConstMacro(FixedImageDimension) >
00319                                                       FixedImageGradientType;
00320   typedef   CovariantVector< CoordinateRepresentationType,
00321                              itkGetStaticConstMacro(MovingImageDimension) >
00322                                                       MovingImageGradientType;
00324 
00325   typedef   CovariantVector< CoordinateRepresentationType,
00326                              itkGetStaticConstMacro(VirtualImageDimension) >
00327                                                       VirtualImageGradientType;
00328 
00330   typedef typename NumericTraits< FixedImagePixelType >::RealType
00331                                                     FixedRealType;
00332   typedef CovariantVector< FixedRealType,
00333                            itkGetStaticConstMacro(FixedImageDimension) >
00334                                                     FixedGradientPixelType;
00335   typedef Image< FixedGradientPixelType,
00336                  itkGetStaticConstMacro(FixedImageDimension) >
00337                                                 FixedImageGradientImageType;
00338   typedef typename FixedImageGradientImageType::Pointer
00339                                                 FixedImageGradientImagePointer;
00341 
00342   typedef ImageToImageFilter< FixedImageType, FixedImageGradientImageType >
00343                                                  FixedImageGradientFilterType;
00344 
00345   typedef typename NumericTraits< MovingImagePixelType >::RealType
00346                                                  MovingRealType;
00347   typedef CovariantVector< MovingRealType,
00348                            itkGetStaticConstMacro(MovingImageDimension) >
00349                                                  MovingGradientPixelType;
00350   typedef Image< MovingGradientPixelType,
00351                  itkGetStaticConstMacro(MovingImageDimension) >
00352                                                     MovingImageGradientImageType;
00353   typedef typename MovingImageGradientImageType::Pointer MovingImageGradientImagePointer;
00354 
00355   typedef ImageToImageFilter< MovingImageType, MovingImageGradientImageType >
00356                                                  MovingImageGradientFilterType;
00357   typedef typename FixedImageGradientFilterType::Pointer
00358                                               FixedImageGradientFilterPointer;
00359   typedef typename MovingImageGradientFilterType::Pointer
00360                                               MovingImageGradientFilterPointer;
00361 
00363   typedef GradientRecursiveGaussianImageFilter< FixedImageType,
00364                                                 FixedImageGradientImageType >
00365                                                   DefaultFixedImageGradientFilter;
00366   typedef GradientRecursiveGaussianImageFilter< MovingImageType,
00367                                                 MovingImageGradientImageType >
00368                                                   DefaultMovingImageGradientFilter;
00369 
00372   typedef ImageFunction<FixedImageType,
00373                         CovariantVector<double,
00374                                   itkGetStaticConstMacro( FixedImageDimension )>,
00375                         CoordinateRepresentationType>
00376                                             FixedImageGradientCalculatorType;
00377   typedef ImageFunction<MovingImageType,
00378                         CovariantVector<double,
00379                                   itkGetStaticConstMacro( MovingImageDimension )>,
00380                         CoordinateRepresentationType>
00381                                             MovingImageGradientCalculatorType;
00383 
00384   typedef typename FixedImageGradientCalculatorType::Pointer
00385                                             FixedImageGradientCalculatorPointer;
00386   typedef typename MovingImageGradientCalculatorType::Pointer
00387                                             MovingImageGradientCalculatorPointer;
00388 
00390   typedef ResampleImageFilter< MovingImageType,
00391                                VirtualImageType,
00392                                MovingRealType >
00393                                              MovingWarpResampleImageFilterType;
00394   typedef typename MovingWarpResampleImageFilterType::Pointer
00395                                           MovingWarpResampleImageFilterPointer;
00396   typedef ResampleImageFilter< FixedImageType,
00397                                VirtualImageType,
00398                                FixedRealType >
00399                                              FixedWarpResampleImageFilterType;
00400   typedef typename FixedWarpResampleImageFilterType::Pointer
00401                                           FixedWarpResampleImageFilterPointer;
00402 
00404   typedef typename Superclass::MeasureType    MeasureType;
00405 
00407   typedef typename Superclass::DerivativeType DerivativeType;
00408   typedef typename DerivativeType::ValueType  DerivativeValueType;
00409 
00410   /* Set/get images */
00412   itkSetConstObjectMacro(FixedImage, FixedImageType);
00413 
00415   itkGetConstObjectMacro(FixedImage, FixedImageType);
00416 
00418   itkSetConstObjectMacro(MovingImage, MovingImageType);
00419 
00421   itkGetConstObjectMacro(MovingImage, MovingImageType);
00422 
00438   void CreateVirtualDomainImage( VirtualSpacingType & spacing,
00439                                     VirtualOriginType & origin,
00440                                     VirtualDirectionType & direction,
00441                                     VirtualRegionType & region );
00442 
00448   void SetVirtualDomainImage( VirtualImageType * virtualImage);
00449 
00451   itkGetConstObjectMacro(VirtualDomainImage, VirtualImageType);
00452 
00455   const VirtualSpacingType    GetVirtualDomainSpacing( void ) const;
00456   const VirtualOriginType     GetVirtualDomainOrigin( void ) const;
00457   const VirtualDirectionType  GetVirtualDomainDirection( void ) const;
00458   const VirtualRegionType     GetVirtualDomainRegion( void ) const;
00460 
00462   itkSetObjectMacro(FixedTransform, FixedTransformType);
00463 
00465   itkGetConstObjectMacro(FixedTransform, FixedTransformType);
00466 
00468   itkSetObjectMacro(MovingTransform, MovingTransformType);
00469 
00471   itkGetConstObjectMacro(MovingTransform, MovingTransformType);
00472 
00475   void SetTransform( MovingTransformType* transform );
00476 
00478   const MovingTransformType * GetTransform();
00479 
00481   itkSetObjectMacro(FixedInterpolator, FixedInterpolatorType);
00482 
00484   itkGetConstObjectMacro(FixedInterpolator, FixedInterpolatorType);
00485 
00487   itkSetObjectMacro(MovingInterpolator, MovingInterpolatorType);
00488 
00490   itkGetConstObjectMacro(MovingInterpolator, MovingInterpolatorType);
00491 
00493   itkSetObjectMacro(MovingImageMask, MovingImageMaskType);
00494   itkSetConstObjectMacro(MovingImageMask, MovingImageMaskType);
00495   itkGetConstObjectMacro(MovingImageMask, MovingImageMaskType);
00497 
00499   itkSetObjectMacro(FixedImageMask, FixedImageMaskType);
00500   itkSetConstObjectMacro(FixedImageMask, FixedImageMaskType);
00501   itkGetConstObjectMacro(FixedImageMask, FixedImageMaskType);
00503 
00505   itkSetObjectMacro(FixedSampledPointSet, FixedSampledPointSetType);
00506   itkSetConstObjectMacro(FixedSampledPointSet, FixedSampledPointSetType);
00507   itkGetConstObjectMacro(FixedSampledPointSet, FixedSampledPointSetType);
00509 
00511   itkSetMacro(UseFixedSampledPointSet, bool);
00512   itkGetConstReferenceMacro(UseFixedSampledPointSet, bool);
00513   itkBooleanMacro(UseFixedSampledPointSet);
00515 
00517   itkGetConstObjectMacro(VirtualSampledPointSet, VirtualSampledPointSetType);
00518 
00520   itkSetObjectMacro( FixedImageGradientFilter, FixedImageGradientFilterType );
00521   itkGetObjectMacro( FixedImageGradientFilter, FixedImageGradientFilterType );
00522   itkSetObjectMacro( MovingImageGradientFilter, MovingImageGradientFilterType );
00523   itkGetObjectMacro( MovingImageGradientFilter, MovingImageGradientFilterType );
00525 
00527   itkSetObjectMacro( FixedImageGradientCalculator, FixedImageGradientCalculatorType);
00528   itkGetObjectMacro( FixedImageGradientCalculator, FixedImageGradientCalculatorType);
00529   itkSetObjectMacro( MovingImageGradientCalculator, MovingImageGradientCalculatorType);
00530   itkGetObjectMacro( MovingImageGradientCalculator, MovingImageGradientCalculatorType);
00532 
00535   itkSetMacro(UseFixedImageGradientFilter, bool);
00536   itkGetConstReferenceMacro(UseFixedImageGradientFilter, bool);
00537   itkBooleanMacro(UseFixedImageGradientFilter);
00539 
00541   itkSetMacro(UseMovingImageGradientFilter, bool);
00542   itkGetConstReferenceMacro(UseMovingImageGradientFilter, bool);
00543   itkBooleanMacro(UseMovingImageGradientFilter);
00545 
00547   itkSetMacro(DoFixedImagePreWarp, bool);
00548   itkGetConstReferenceMacro(DoFixedImagePreWarp, bool);
00549   itkBooleanMacro(DoFixedImagePreWarp);
00551 
00553   itkSetMacro(DoMovingImagePreWarp, bool);
00554   itkGetConstReferenceMacro(DoMovingImagePreWarp, bool);
00555   itkBooleanMacro(DoMovingImagePreWarp);
00557 
00559   itkGetConstObjectMacro( MovingWarpedImage, MovingImageType );
00560   itkGetConstObjectMacro( FixedWarpedImage, FixedImageType );
00562 
00565   ThreadIdType GetNumberOfThreadsUsed() const;
00566 
00570   void SetMaximumNumberOfThreads( const ThreadIdType threads );
00571   ThreadIdType GetMaximumNumberOfThreads() const;
00573 
00575   itkGetConstObjectMacro(FixedImageGradientImage, FixedImageGradientImageType);
00576 
00578   itkGetConstObjectMacro(MovingImageGradientImage, MovingImageGradientImageType);
00579 
00581   itkGetConstMacro( NumberOfValidPoints, SizeValueType );
00582 
00587   itkSetMacro( FloatingPointCorrectionResolution, DerivativeValueType );
00588   itkGetConstMacro( FloatingPointCorrectionResolution, DerivativeValueType );
00590 
00593   typedef typename Superclass::NumberOfParametersType   NumberOfParametersType;
00594 
00602   virtual NumberOfParametersType GetNumberOfParameters() const;
00603 
00605   virtual const ParametersType & GetParameters() const;
00606 
00613   virtual void UpdateTransformParameters( DerivativeType & derivative,
00614                                           ParametersValueType factor = NumericTraits< ParametersValueType >::One );
00615 
00617   virtual NumberOfParametersType GetNumberOfLocalParameters() const;
00618 
00620   virtual bool HasLocalSupport() const;
00621 
00622   /* Initialize the metric before calling GetValue or GetDerivative.
00623    * Derived classes must call this Superclass version if they override
00624    * this to perform their own initialization.
00625    * \note This is meant to be called once for a particular metric setup.
00626    * That is, when used in registration, this method would be called once
00627    * before entering the registration loop, during which GetValue or
00628    * GetDerivative will be called repeatedly. It must be called again if
00629    * metric settings are changed before beginning a new registration. */
00630   virtual void Initialize(void) throw ( itk::ExceptionObject );
00631 
00632   /* Computes an offset for accessing parameter data from a virtual domain
00633    * index. Relevant for metrics with local-support transforms, to access
00634    * parameter or derivative memory that is stored linearly in a 1D array.
00635    * The result is the offset (1D array index) to the first of N parameters
00636    * corresponding to the given virtual index, where N is the number of
00637    * local parameters. */
00638   OffsetValueType ComputeParameterOffsetFromVirtualDomainIndex( const VirtualIndexType & index, const NumberOfParametersType numberOfLocalParameters ) const;
00639 
00642   virtual MeasureType GetValue() const;
00643 
00649   virtual void GetValueAndDerivative( MeasureType & value,
00650                                       DerivativeType & derivative ) const;
00651 
00652 protected:
00657   virtual void InitializeForIteration() const;
00658 
00659   friend class ImageToImageMetricv4GetValueAndDerivativeThreaderBase< ThreadedImageRegionPartitioner< VirtualImageDimension >, Self >;
00660   friend class ImageToImageMetricv4GetValueAndDerivativeThreaderBase< ThreadedIndexedContainerPartitioner, Self >;
00661   friend class ImageToImageMetricv4GetValueAndDerivativeThreader< ThreadedImageRegionPartitioner< VirtualImageDimension >, Self >;
00662   friend class ImageToImageMetricv4GetValueAndDerivativeThreader< ThreadedIndexedContainerPartitioner, Self >;
00663 
00664   /* A DenseGetValueAndDerivativeThreader
00665    * Derived classes must define this class and assign it in their constructor
00666    * if threaded processing in GetValueAndDerivative is performed. */
00667   typename ImageToImageMetricv4GetValueAndDerivativeThreader< ThreadedImageRegionPartitioner< VirtualImageDimension >, Self >::Pointer m_DenseGetValueAndDerivativeThreader;
00668   /* A SparseGetValueAndDerivativeThreader
00669    * Derived classes must define this class and assign it in their constructor
00670    * if threaded processing in GetValueAndDerivative is performed. */
00671   typename ImageToImageMetricv4GetValueAndDerivativeThreader< ThreadedIndexedContainerPartitioner, Self >::Pointer m_SparseGetValueAndDerivativeThreader;
00672 
00685   bool TransformAndEvaluateFixedPoint(
00686                            const VirtualIndexType & index,
00687                            const VirtualPointType & point,
00688                            const bool computeImageGradient,
00689                            FixedImagePointType & mappedFixedPoint,
00690                            FixedImagePixelType & mappedFixedPixelValue,
00691                            FixedImageGradientType & mappedFixedImageGradient ) const;
00692 
00694   bool TransformAndEvaluateMovingPoint(
00695                            const VirtualIndexType & index,
00696                            const VirtualPointType & point,
00697                            const bool computeImageGradient,
00698                            MovingImagePointType & mappedMovingPoint,
00699                            MovingImagePixelType & mappedMovingPixelValue,
00700                            MovingImageGradientType & mappedMovingImageGradient ) const;
00701 
00706   virtual void ComputeFixedImageGradientAtPoint(
00707                                     const FixedImagePointType & mappedPoint,
00708                                     FixedImageGradientType & gradient ) const;
00709 
00711   virtual void ComputeMovingImageGradientAtPoint(
00712                                     const MovingImagePointType & mappedPoint,
00713                                     MovingImageGradientType & gradient ) const;
00714 
00720   virtual void ComputeFixedImageGradientAtIndex(
00721                                     const VirtualIndexType & index,
00722                                     FixedImageGradientType & gradient ) const;
00723 
00725   virtual void ComputeMovingImageGradientAtIndex(
00726                                     const VirtualIndexType & index,
00727                                     MovingImageGradientType & gradient ) const;
00728 
00734   virtual void ComputeFixedImageGradientFilterImage();
00735 
00741   virtual void ComputeMovingImageGradientFilterImage() const;
00742 
00745   virtual void InitializeDefaultFixedImageGradientFilter(void);
00746   virtual void InitializeDefaultMovingImageGradientFilter(void);
00748 
00749   FixedImageConstPointer  m_FixedImage;
00750   FixedTransformPointer   m_FixedTransform;
00751   MovingImageConstPointer m_MovingImage;
00752   MovingTransformPointer  m_MovingTransform;
00753   VirtualImagePointer     m_VirtualDomainImage;
00754 
00756   FixedInterpolatorPointer                        m_FixedInterpolator;
00757   MovingInterpolatorPointer                       m_MovingInterpolator;
00758 
00761   bool                          m_UseFixedImageGradientFilter;
00762   bool                          m_UseMovingImageGradientFilter;
00763 
00765   FixedImageGradientFilterPointer   m_FixedImageGradientFilter;
00766   MovingImageGradientFilterPointer  m_MovingImageGradientFilter;
00767 
00770   typename DefaultFixedImageGradientFilter::Pointer
00771                                              m_DefaultFixedImageGradientFilter;
00772   typename DefaultMovingImageGradientFilter::Pointer
00773                                              m_DefaultMovingImageGradientFilter;
00774 
00776   mutable FixedImageGradientImagePointer    m_FixedImageGradientImage;
00777   mutable MovingImageGradientImagePointer   m_MovingImageGradientImage;
00778 
00780   FixedImageGradientCalculatorPointer   m_FixedImageGradientCalculator;
00781   MovingImageGradientCalculatorPointer  m_MovingImageGradientCalculator;
00782 
00784   bool                               m_DoFixedImagePreWarp;
00785 
00787   bool                               m_DoMovingImagePreWarp;
00788 
00790   mutable FixedImagePointer   m_FixedWarpedImage;
00791   mutable MovingImagePointer  m_MovingWarpedImage;
00792 
00794   MovingWarpResampleImageFilterPointer    m_MovingWarpResampleImageFilter;
00795   FixedWarpResampleImageFilterPointer     m_FixedWarpResampleImageFilter;
00796 
00801   mutable DerivativeType *                    m_DerivativeResult;
00802 
00805   mutable SizeValueType                       m_NumberOfValidPoints;
00806 
00809   bool                                        m_UserHasProvidedVirtualDomainImage;
00810 
00812   FixedImageMaskConstPointer                  m_FixedImageMask;
00813   MovingImageMaskConstPointer                 m_MovingImageMask;
00814 
00816   FixedSampledPointSetConstPointer            m_FixedSampledPointSet;
00817   VirtualSampledPointSetPointer               m_VirtualSampledPointSet;
00818 
00820   bool                                        m_UseFixedSampledPointSet;
00821 
00823   mutable MeasureType             m_Value;
00824 
00825   ImageToImageMetricv4();
00826   virtual ~ImageToImageMetricv4();
00827 
00828   void PrintSelf(std::ostream& os, Indent indent) const;
00829 
00830   /* Verify that virtual domain and displacement field are the same size
00831    * and in the same physical space. */
00832   virtual void VerifyDisplacementFieldSizeAndPhysicalSpace();
00833 
00834 private:
00836   void MapFixedSampledPointSetToVirtual( void );
00837 
00840   void DoFixedImagePreWarp( void ) const;
00841   void DoMovingImagePreWarp( void ) const;
00843 
00846   mutable bool m_HaveMadeGetValueWarning;
00847 
00848   ImageToImageMetricv4(const Self &); //purposely not implemented
00849   void operator=(const Self &); //purposely not implemented
00850 
00851   //Sample point coordinates from the virtual image domain
00852   std::vector<VirtualPointType> m_VirtualImageCornerPoints;
00853 
00854   DerivativeValueType m_FloatingPointCorrectionResolution;
00855 };
00856 }//namespace itk
00857 
00858 #ifndef ITK_MANUAL_INSTANTIATION
00859 #include "itkImageToImageMetricv4.hxx"
00860 #endif
00861 
00862 #endif
00863