go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkImageToImageMetricWithFeatures.h
Go to the documentation of this file.
00001 /*======================================================================
00002 
00003   This file is part of the elastix software.
00004 
00005   Copyright (c) University Medical Center Utrecht. All rights reserved.
00006   See src/CopyrightElastix.txt or http://elastix.isi.uu.nl/legal.php for
00007   details.
00008 
00009      This software is distributed WITHOUT ANY WARRANTY; without even
00010      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00011      PURPOSE. See the above copyright notices for more information.
00012 
00013 ======================================================================*/
00014 
00015 #ifndef __itkImageToImageMetricWithFeatures_h
00016 #define __itkImageToImageMetricWithFeatures_h
00017 
00018 #include "itkAdvancedImageToImageMetric.h"
00019 #include "itkInterpolateImageFunction.h"
00020 
00021 
00022 namespace itk
00023 {
00024 
00035 template <class TFixedImage, class TMovingImage,
00036   class TFixedFeatureImage = TFixedImage, class TMovingFeatureImage = TMovingImage>
00037 class ImageToImageMetricWithFeatures :
00038   public AdvancedImageToImageMetric< TFixedImage, TMovingImage >
00039 {
00040 public:
00042   typedef ImageToImageMetricWithFeatures  Self;
00043   typedef AdvancedImageToImageMetric<
00044     TFixedImage, TMovingImage >           Superclass;
00045   typedef SmartPointer<Self>              Pointer;
00046   typedef SmartPointer<const Self>        ConstPointer;
00047 
00049   itkTypeMacro( ImageToImageMetricWithFeatures, AdvancedImageToImageMetric );
00050 
00052   typedef typename
00053     Superclass::CoordinateRepresentationType              CoordinateRepresentationType;
00054   typedef typename Superclass::MovingImageType            MovingImageType;
00055   typedef typename Superclass::MovingImagePixelType       MovingImagePixelType;
00056   typedef typename Superclass::MovingImageConstPointer    MovingImageConstPointer;
00057   typedef typename Superclass::FixedImageType             FixedImageType;
00058   typedef typename Superclass::FixedImageConstPointer     FixedImageConstPointer;
00059   typedef typename Superclass::FixedImageRegionType       FixedImageRegionType;
00060   typedef typename Superclass::TransformType              TransformType;
00061   typedef typename Superclass::TransformPointer           TransformPointer;
00062   typedef typename Superclass::InputPointType             InputPointType;
00063   typedef typename Superclass::OutputPointType            OutputPointType;
00064   typedef typename Superclass::TransformParametersType    TransformParametersType;
00065   typedef typename Superclass::TransformJacobianType      TransformJacobianType;
00066   typedef typename Superclass::InterpolatorType           InterpolatorType;
00067   typedef typename Superclass::InterpolatorPointer        InterpolatorPointer;
00068   typedef typename Superclass::RealType                   RealType;
00069   typedef typename Superclass::GradientPixelType          GradientPixelType;
00070   typedef typename Superclass::GradientImageType          GradientImageType;
00071   typedef typename Superclass::GradientImagePointer       GradientImagePointer;
00072   typedef typename Superclass::GradientImageFilterType    GradientImageFilterType;
00073   typedef typename Superclass::GradientImageFilterPointer GradientImageFilterPointer;
00074   typedef typename Superclass::FixedImageMaskType         FixedImageMaskType;
00075   typedef typename Superclass::FixedImageMaskPointer      FixedImageMaskPointer;
00076   typedef typename Superclass::MovingImageMaskType        MovingImageMaskType;
00077   typedef typename Superclass::MovingImageMaskPointer     MovingImageMaskPointer;
00078   typedef typename Superclass::MeasureType                MeasureType;
00079   typedef typename Superclass::DerivativeType             DerivativeType;
00080   typedef typename Superclass::ParametersType             ParametersType;
00081   typedef typename Superclass::FixedImagePixelType        FixedImagePixelType;
00082   typedef typename Superclass::MovingImageRegionType      MovingImageRegionType;
00083   typedef typename Superclass::ImageSamplerType           ImageSamplerType;
00084   typedef typename Superclass::ImageSamplerPointer        ImageSamplerPointer;
00085   typedef typename Superclass::ImageSampleContainerType   ImageSampleContainerType;
00086   typedef typename
00087     Superclass::ImageSampleContainerPointer               ImageSampleContainerPointer;
00088   typedef typename Superclass::InternalMaskPixelType      InternalMaskPixelType;
00089   typedef typename
00090     Superclass::InternalMovingImageMaskType               InternalMovingImageMaskType;
00091   typedef typename
00092     Superclass::MovingImageMaskInterpolatorType           MovingImageMaskInterpolatorType;
00093   typedef typename Superclass::FixedImageLimiterType      FixedImageLimiterType;
00094   typedef typename Superclass::MovingImageLimiterType     MovingImageLimiterType;
00095   typedef typename
00096     Superclass::FixedImageLimiterOutputType               FixedImageLimiterOutputType;
00097   typedef typename
00098     Superclass::MovingImageLimiterOutputType              MovingImageLimiterOutputType;
00099 
00101   itkStaticConstMacro( FixedImageDimension, unsigned int,
00102     FixedImageType::ImageDimension );
00103 
00105   itkStaticConstMacro( MovingImageDimension, unsigned int,
00106     MovingImageType::ImageDimension );
00107 
00109   typedef TFixedFeatureImage                                FixedFeatureImageType;
00110   typedef typename FixedFeatureImageType::Pointer           FixedFeatureImagePointer;
00111   typedef TMovingFeatureImage                               MovingFeatureImageType;
00112   typedef typename MovingFeatureImageType::Pointer          MovingFeatureImagePointer;
00113   typedef std::vector<FixedFeatureImagePointer>             FixedFeatureImageVectorType;
00114   typedef std::vector<MovingFeatureImagePointer>            MovingFeatureImageVectorType;
00115 
00117   typedef InterpolateImageFunction<
00118     FixedFeatureImageType,double>                           FixedFeatureInterpolatorType;
00119   typedef InterpolateImageFunction<
00120     MovingFeatureImageType,double>                          MovingFeatureInterpolatorType;
00121   typedef typename FixedFeatureInterpolatorType::Pointer    FixedFeatureInterpolatorPointer;
00122   typedef typename MovingFeatureInterpolatorType::Pointer   MovingFeatureInterpolatorPointer;
00123   typedef std::vector<FixedFeatureInterpolatorPointer>      FixedFeatureInterpolatorVectorType;
00124   typedef std::vector<MovingFeatureInterpolatorPointer>     MovingFeatureInterpolatorVectorType;
00125 
00127   void SetNumberOfFixedFeatureImages( unsigned int arg );
00128 
00130   itkGetConstMacro( NumberOfFixedFeatureImages, unsigned int );
00131 
00133   void SetFixedFeatureImage( unsigned int i, FixedFeatureImageType * im );
00134   void SetFixedFeatureImage( FixedFeatureImageType * im )
00135   {
00136     this->SetFixedFeatureImage( 0, im );
00137   };
00138 
00140   const FixedFeatureImageType * GetFixedFeatureImage( unsigned int i ) const;
00141   const FixedFeatureImageType * GetFixedFeatureImage( void ) const
00142   {
00143     return this->GetFixedFeatureImage( 0 );
00144   };
00145 
00147   void SetFixedFeatureInterpolator( unsigned int i, FixedFeatureInterpolatorType * interpolator );
00148   void SetFixedFeatureInterpolator( FixedFeatureInterpolatorType * interpolator )
00149   {
00150     this->SetFixedFeatureInterpolator( 0, interpolator );
00151   };
00152 
00154   const FixedFeatureInterpolatorType * GetFixedFeatureInterpolator( unsigned int i ) const;
00155   const FixedFeatureInterpolatorType * GetFixedFeatureInterpolator( void ) const
00156   {
00157     return this->GetFixedFeatureInterpolator( 0 );
00158   };
00159 
00161   void SetNumberOfMovingFeatureImages( unsigned int arg );
00162 
00164   itkGetConstMacro( NumberOfMovingFeatureImages, unsigned int );
00165 
00167   void SetMovingFeatureImage( unsigned int i, MovingFeatureImageType * im );
00168   void SetMovingFeatureImage( MovingFeatureImageType * im )
00169   {
00170     this->SetMovingFeatureImage( 0, im );
00171   };
00172 
00174   const MovingFeatureImageType * GetMovingFeatureImage( unsigned int i ) const;
00175   const MovingFeatureImageType * GetMovingFeatureImage( void ) const
00176   {
00177     return this->GetMovingFeatureImage( 0 );
00178   };
00179 
00181   void SetMovingFeatureInterpolator( unsigned int i, MovingFeatureInterpolatorType * interpolator );
00182   void SetMovingFeatureInterpolator( MovingFeatureInterpolatorType * interpolator )
00183   {
00184     this->SetMovingFeatureInterpolator( 0, interpolator );
00185   };
00186 
00188   const MovingFeatureInterpolatorType * GetMovingFeatureInterpolator( unsigned int i ) const;
00189   const MovingFeatureInterpolatorType * GetMovingFeatureInterpolator( void ) const
00190   {
00191     return this->GetMovingFeatureInterpolator( 0 );
00192   };
00193 
00195   virtual void Initialize( void ) throw ( ExceptionObject );
00196 
00197 protected:
00198   ImageToImageMetricWithFeatures();
00199   virtual ~ImageToImageMetricWithFeatures() {};
00200   void PrintSelf( std::ostream& os, Indent indent ) const;
00201 
00202   typedef typename Superclass::BSplineInterpolatorType    BSplineInterpolatorType;
00203   typedef typename BSplineInterpolatorType::Pointer       BSplineInterpolatorPointer;
00204   typedef std::vector<BSplineInterpolatorPointer>         BSplineFeatureInterpolatorVectorType;
00205   typedef typename Superclass::FixedImagePointType        FixedImagePointType;
00206   typedef typename Superclass::MovingImagePointType       MovingImagePointType;
00207   typedef typename Superclass::MovingImageDerivativeType  MovingImageDerivativeType;
00208   typedef typename Superclass::MovingImageContinuousIndexType  MovingImageContinuousIndexType;
00209 
00211   unsigned int                          m_NumberOfFixedFeatureImages;
00212   unsigned int                          m_NumberOfMovingFeatureImages;
00213   FixedFeatureImageVectorType           m_FixedFeatureImages;
00214   MovingFeatureImageVectorType          m_MovingFeatureImages;
00215   FixedFeatureInterpolatorVectorType    m_FixedFeatureInterpolators;
00216   MovingFeatureInterpolatorVectorType   m_MovingFeatureInterpolators;
00217 
00218   std::vector<bool>                     m_FeatureInterpolatorsIsBSpline;
00219   bool                                  m_FeatureInterpolatorsAreBSpline;
00220   BSplineFeatureInterpolatorVectorType  m_MovingFeatureBSplineInterpolators;
00221 
00225   virtual void CheckForBSplineFeatureInterpolators( void );
00226 
00227 private:
00228   ImageToImageMetricWithFeatures(const Self&); //purposely not implemented
00229   void operator=(const Self&); //purposely not implemented
00230 
00231 }; // end class ImageToImageMetricWithFeatures
00232 
00233 } // end namespace itk
00234 
00235 #ifndef ITK_MANUAL_INSTANTIATION
00236 #include "itkImageToImageMetricWithFeatures.txx"
00237 #endif
00238 
00239 #endif // end #ifndef __itkImageToImageMetricWithFeatures_h
00240 
00241 
00242 


Generated on 11-05-2012 for elastix by doxygen 1.7.6.1 elastix logo