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

itkInterpolateImageFunction.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkInterpolateImageFunction.h,v $
00005   Language:  C++
00006   Date:      $Date: 2003/02/16 07:04:01 $
00007   Version:   $Revision: 1.14 $
00008 
00009   Copyright (c) 2002 Insight 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 #ifndef _itkInterpolateImageFunction_h
00018 #define _itkInterpolateImageFunction_h
00019 
00020 #include "itkImageFunction.h"
00021 
00022 namespace itk
00023 {
00024 
00041 template <class TInputImage, class TCoordRep = float>
00042 class ITK_EXPORT InterpolateImageFunction : 
00043   public ImageFunction< TInputImage, 
00044     ITK_TYPENAME NumericTraits<typename TInputImage::PixelType>::RealType, TCoordRep > 
00045 {
00046 public:
00048   typedef InterpolateImageFunction Self;
00049   typedef ImageFunction<TInputImage,double,TCoordRep> Superclass;
00050   typedef SmartPointer<Self> Pointer;
00051   typedef SmartPointer<const Self>  ConstPointer;
00052   
00054   itkTypeMacro(InterpolateImageFunction, ImageFunction);
00055 
00057   typedef typename Superclass::OutputType OutputType;
00058 
00060   typedef typename Superclass::InputImageType InputImageType;
00061   
00063   itkStaticConstMacro(ImageDimension, unsigned int,
00064                       Superclass::ImageDimension);
00065 
00067   typedef typename Superclass::PointType PointType;
00068 
00070   typedef typename Superclass::IndexType IndexType;
00071 
00073   typedef typename Superclass::ContinuousIndexType ContinuousIndexType;
00074 
00076   typedef typename NumericTraits<typename TInputImage::PixelType>::RealType RealType;
00077 
00086   virtual OutputType Evaluate( const PointType& point ) const
00087     {
00088     ContinuousIndexType index;
00089     m_Image->TransformPhysicalPointToContinuousIndex( point, index );
00090     return ( this->EvaluateAtContinuousIndex( index ) );
00091     }
00092 
00103   virtual OutputType EvaluateAtContinuousIndex( 
00104     const ContinuousIndexType & index ) const = 0;
00105 
00114   virtual OutputType EvaluateAtIndex( const IndexType & index ) const
00115     {
00116     return ( static_cast<RealType>( m_Image->GetPixel( index ) ) );
00117     }
00118 
00119 protected:
00120   InterpolateImageFunction(){};
00121   ~InterpolateImageFunction(){};
00122   void PrintSelf(std::ostream& os, Indent indent) const
00123     { Superclass::PrintSelf( os, indent ); }
00124 
00125 private:
00126   InterpolateImageFunction( const Self& ); //purposely not implemented
00127   void operator=( const Self& ); //purposely not implemented
00128 
00129 };
00130 
00131 } // namespace itk
00132 
00133 #endif

Generated at Fri May 21 01:14:58 2004 for ITK by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2000