ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkExtrapolateImageFunction.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 #ifndef __itkExtrapolateImageFunction_h
00019 #define __itkExtrapolateImageFunction_h
00020 
00021 #include "itkImageFunction.h"
00022 
00023 namespace itk
00024 {
00042 template< class TInputImage, class TCoordRep = float >
00043 class ITK_EXPORT ExtrapolateImageFunction:
00044   public ImageFunction< TInputImage,
00045                         typename NumericTraits< typename TInputImage::PixelType >::RealType, TCoordRep >
00046 {
00047 public:
00049   typedef ExtrapolateImageFunction                        Self;
00050   typedef ImageFunction< TInputImage,
00051                          typename NumericTraits< typename TInputImage::PixelType >::RealType,
00052                          TCoordRep >                      Superclass;
00053   typedef SmartPointer< Self >                            Pointer;
00054   typedef SmartPointer< const Self >                      ConstPointer;
00055 
00057   itkTypeMacro(ExtrapolateImageFunction, ImageFunction);
00058 
00060   typedef typename Superclass::OutputType OutputType;
00061 
00063   typedef typename Superclass::InputImageType InputImageType;
00064 
00066   itkStaticConstMacro(ImageDimension, unsigned int,
00067                       Superclass::ImageDimension);
00068 
00070   typedef typename Superclass::PointType PointType;
00071 
00073   typedef typename Superclass::IndexType IndexType;
00074 
00076   typedef typename Superclass::ContinuousIndexType ContinuousIndexType;
00077 
00079   typedef typename NumericTraits< typename TInputImage::PixelType >::RealType RealType;
00080 
00086   virtual OutputType Evaluate(const PointType & point) const
00087   {
00088     ContinuousIndexType index;
00089 
00090     this->GetInputImage()->TransformPhysicalPointToContinuousIndex(point, index);
00091     return ( this->EvaluateAtContinuousIndex(index) );
00092   }
00093 
00099   virtual OutputType EvaluateAtContinuousIndex(
00100     const ContinuousIndexType & index) const = 0;
00101 
00107   virtual OutputType EvaluateAtIndex(
00108     const IndexType & index) const = 0;
00109 
00110 protected:
00111   ExtrapolateImageFunction(){}
00112   ~ExtrapolateImageFunction(){}
00113   void PrintSelf(std::ostream & os, Indent indent) const
00114   { Superclass::PrintSelf(os, indent); }
00115 private:
00116   ExtrapolateImageFunction(const Self &); //purposely not implemented
00117   void operator=(const Self &);           //purposely not implemented
00118 };
00119 } // end namespace itk
00120 
00121 #endif
00122