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: 2006/02/06 22:01:56 $
00007   Version:   $Revision: 1.19 $
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 = 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,typename NumericTraits<typename TInputImage::PixelType>::RealType,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     this->GetInputImage()->TransformPhysicalPointToContinuousIndex( point, index );
00090     return ( this->EvaluateAtContinuousIndex( index ) );
00091     }
00093 
00104   virtual OutputType EvaluateAtContinuousIndex( 
00105     const ContinuousIndexType & index ) const = 0;
00106 
00115   virtual OutputType EvaluateAtIndex( const IndexType & index ) const
00116     {
00117     return ( static_cast<RealType>( this->GetInputImage()->GetPixel( index ) ) );
00118     }
00119 
00120 protected:
00121   InterpolateImageFunction(){};
00122   ~InterpolateImageFunction(){};
00123   void PrintSelf(std::ostream& os, Indent indent) const
00124     { Superclass::PrintSelf( os, indent ); }
00125 
00126 private:
00127   InterpolateImageFunction( const Self& ); //purposely not implemented
00128   void operator=( const Self& ); //purposely not implemented
00129 
00130 };
00131 
00132 } // end namespace itk
00133 
00134 #endif
00135 

Generated at Sun Sep 23 13:15:42 2007 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000