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: 2008-05-14 09:26:05 $
00007   Version:   $Revision: 1.21 $
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 #ifndef __itkInterpolateImageFunction_h
00018 #define __itkInterpolateImageFunction_h
00019 
00020 #include "itkImageFunction.h"
00021 
00022 namespace itk
00023 {
00024 
00041 template <class TInputImage, class TCoordRep = double>
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,
00050     typename NumericTraits<typename TInputImage::PixelType>::RealType,
00051     TCoordRep>                         Superclass;
00052   typedef SmartPointer<Self>           Pointer;
00053   typedef SmartPointer<const Self>     ConstPointer;
00054 
00056   itkTypeMacro(InterpolateImageFunction, ImageFunction);
00057 
00059   typedef typename Superclass::OutputType OutputType;
00060 
00062   typedef typename Superclass::InputImageType InputImageType;
00063 
00065   itkStaticConstMacro(ImageDimension, unsigned int,
00066                       Superclass::ImageDimension);
00067 
00069   typedef typename Superclass::PointType PointType;
00070 
00072   typedef typename Superclass::IndexType IndexType;
00073 
00075   typedef typename Superclass::ContinuousIndexType ContinuousIndexType;
00076 
00078   typedef typename NumericTraits<typename TInputImage::PixelType>::RealType RealType;
00079 
00088   virtual OutputType Evaluate( const PointType& point ) const
00089     {
00090     ContinuousIndexType index;
00091     this->GetInputImage()->TransformPhysicalPointToContinuousIndex( point, index );
00092     return ( this->EvaluateAtContinuousIndex( index ) );
00093     }
00095 
00106   virtual OutputType EvaluateAtContinuousIndex( 
00107     const ContinuousIndexType & index ) const = 0;
00108 
00117   virtual OutputType EvaluateAtIndex( const IndexType & index ) const
00118     {
00119     return ( static_cast<RealType>( this->GetInputImage()->GetPixel( index ) ) );
00120     }
00121 
00122 protected:
00123   InterpolateImageFunction(){};
00124   ~InterpolateImageFunction(){};
00125   void PrintSelf(std::ostream& os, Indent indent) const
00126     { Superclass::PrintSelf( os, indent ); }
00127 
00128 private:
00129   InterpolateImageFunction( const Self& ); //purposely not implemented
00130   void operator=( const Self& ); //purposely not implemented
00131 
00132 };
00133 
00134 } // end namespace itk
00135 
00136 #endif
00137 

Generated at Wed Nov 5 22:27:49 2008 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000