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: 2009-10-29 11:18:40 $
00007   Version:   $Revision: 1.22 $
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   typedef typename Superclass::IndexValueType IndexValueType;
00074 
00076   typedef typename Superclass::ContinuousIndexType ContinuousIndexType;
00077 
00079   typedef typename NumericTraits<typename TInputImage::PixelType>::RealType RealType;
00080 
00089   virtual OutputType Evaluate( const PointType& point ) const
00090     {
00091     ContinuousIndexType index;
00092     this->GetInputImage()->TransformPhysicalPointToContinuousIndex( point, index );
00093     return ( this->EvaluateAtContinuousIndex( index ) );
00094     }
00096 
00107   virtual OutputType EvaluateAtContinuousIndex( 
00108     const ContinuousIndexType & index ) const = 0;
00109 
00118   virtual OutputType EvaluateAtIndex( const IndexType & index ) const
00119     {
00120     return ( static_cast<RealType>( this->GetInputImage()->GetPixel( index ) ) );
00121     }
00122 
00123 protected:
00124   InterpolateImageFunction(){};
00125   ~InterpolateImageFunction(){};
00126   void PrintSelf(std::ostream& os, Indent indent) const
00127     { Superclass::PrintSelf( os, indent ); }
00128 
00129 private:
00130   InterpolateImageFunction( const Self& ); //purposely not implemented
00131   void operator=( const Self& ); //purposely not implemented
00132 
00133 };
00134 
00135 } // end namespace itk
00136 
00137 #endif
00138 

Generated at Fri Apr 16 18:46:45 2010 for ITK by doxygen 1.6.1 written by Dimitri van Heesch, © 1997-2000