Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkVectorCentralDifferenceImageFunction.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkVectorCentralDifferenceImageFunction.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-04-23 03:43:42 $
00007   Version:   $Revision: 1.3 $
00008 
00009   Copyright (c) Insight Software Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012      This software is distributed WITHOUT ANY WARRANTY; without even
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00014      PURPOSE.  See the above copyright notices for more information.
00015 
00016 =========================================================================*/
00017 
00018 #ifndef __itkVectorCentralDifferenceImageFunction_h
00019 #define __itkVectorCentralDifferenceImageFunction_h
00020 
00021 #include "itkImageFunction.h"
00022 #include "itkMatrix.h"
00023 #include "itkImageBase.h"
00024 
00025 namespace itk
00026 {
00027 
00028 #ifndef __itkVectorInterpolateImageFunction_h
00029 
00035 template <typename T>
00036 struct GetDimension
00037 {
00038   itkStaticConstMacro(Dimension, int, T::Dimension);
00039 };
00040 #endif
00041 
00042    
00060 template <
00061   class TInputImage, 
00062   class TCoordRep = float >
00063 class ITK_EXPORT VectorCentralDifferenceImageFunction :
00064   public ImageFunction< TInputImage, 
00065                         Matrix<double, \
00066                         ::itk::GetDimension<typename TInputImage::PixelType>::Dimension, \
00067                         ::itk::GetImageDimension<TInputImage>::ImageDimension>,
00068                         TCoordRep >
00069 {
00070 public:
00071   typedef typename TInputImage::PixelType InputPixelType;
00072 
00074   itkStaticConstMacro(Dimension, unsigned int,
00075                       InputPixelType::Dimension);
00076 
00078   itkStaticConstMacro(ImageDimension, unsigned int,
00079                       TInputImage::ImageDimension);
00080 
00082   typedef VectorCentralDifferenceImageFunction Self;
00083   typedef ImageFunction<TInputImage,
00084                         Matrix<double,itkGetStaticConstMacro(Dimension),
00085                                itkGetStaticConstMacro(ImageDimension)>,
00086                         TCoordRep>       Superclass;
00087   typedef SmartPointer<Self>             Pointer;
00088   typedef SmartPointer<const Self>       ConstPointer;
00090 
00092   itkTypeMacro(VectorCentralDifferenceImageFunction, ImageFunction);
00093 
00095   itkNewMacro(Self);
00096 
00098   typedef TInputImage InputImageType;
00099 
00101   typedef typename Superclass::OutputType OutputType;
00102 
00104   typedef typename Superclass::IndexType IndexType;
00105 
00107   typedef typename Superclass::ContinuousIndexType ContinuousIndexType;
00108 
00110   typedef typename Superclass::PointType PointType;
00111 
00119   virtual OutputType EvaluateAtIndex( const IndexType& index ) const;
00120 
00129    virtual OutputType Evaluate( const PointType& point ) const
00130     { 
00131     IndexType index;
00132     this->ConvertPointToNearestIndex( point, index );
00133     return this->EvaluateAtIndex( index ); 
00134     }
00135   virtual OutputType EvaluateAtContinuousIndex( 
00136     const ContinuousIndexType& cindex ) const
00137     { 
00138     IndexType index;
00139     this->ConvertContinuousIndexToNearestIndex( cindex, index );
00140     return this->EvaluateAtIndex( index ); 
00141     }
00143 
00155   itkSetMacro( UseImageDirection, bool );
00156   itkGetConstMacro( UseImageDirection, bool );
00157   itkBooleanMacro( UseImageDirection );
00159 
00160 protected:
00161   VectorCentralDifferenceImageFunction();
00162   ~VectorCentralDifferenceImageFunction(){};
00163   void PrintSelf(std::ostream& os, Indent indent) const;
00164 
00165 private:
00166   VectorCentralDifferenceImageFunction( const Self& ); //purposely not implemented
00167   void operator=( const Self& ); //purposely not implemented
00168 
00169   // flag to take or not the image direction into account
00170   // when computing the derivatives.
00171   bool m_UseImageDirection;
00172 
00173 };
00174 
00175 } // end namespace itk
00176 
00177 #ifndef ITK_MANUAL_INSTANTIATION
00178 #include "itkVectorCentralDifferenceImageFunction.txx"
00179 #endif
00180 
00181 #endif
00182 

Generated at Tue Sep 15 05:15:59 2009 for ITK by doxygen 1.5.8 written by Dimitri van Heesch, © 1997-2000