ITK  4.0.0
Insight Segmentation and Registration Toolkit
itkVectorLinearInterpolateNearestNeighborExtrapolateImageFunction.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 __itkVectorLinearInterpolateNearestNeighborExtrapolateImageFunction_h
00019 #define __itkVectorLinearInterpolateNearestNeighborExtrapolateImageFunction_h
00020 
00021 #include "itkVectorInterpolateImageFunction.h"
00022 
00023 namespace itk
00024 {
00053 template< class TInputImage, class TCoordRep = float >
00054 class ITK_EXPORT VectorLinearInterpolateNearestNeighborExtrapolateImageFunction:
00055   public VectorInterpolateImageFunction< TInputImage, TCoordRep >
00056 {
00057 public:
00058 
00060   typedef VectorLinearInterpolateNearestNeighborExtrapolateImageFunction Self;
00061   typedef VectorInterpolateImageFunction< TInputImage, TCoordRep >       Superclass;
00062   typedef SmartPointer< Self >                                           Pointer;
00063   typedef SmartPointer< const Self >                                     ConstPointer;
00064 
00066   itkNewMacro(Self);
00067 
00069   itkTypeMacro(VectorLinearInterpolateNearestNeighborExtrapolateImageFunction,
00070                VectorInterpolateImageFunction);
00071 
00073   typedef typename Superclass::InputImageType InputImageType;
00074   typedef typename Superclass::PixelType      PixelType;
00075   typedef typename Superclass::ValueType      ValueType;
00076   typedef typename Superclass::RealType       RealType;
00077 
00078   typedef typename Superclass::PointType PointType;
00079 
00081   //itkStaticConstMacro(Dimension, unsigned int,
00082   //                    Superclass::Dimension);
00083 
00085   itkStaticConstMacro(ImageDimension, unsigned int, Superclass::ImageDimension);
00086 
00088   typedef typename Superclass::IndexType      IndexType;
00089   typedef typename Superclass::IndexValueType IndexValueType;
00090 
00092   typedef typename Superclass::ContinuousIndexType ContinuousIndexType;
00093 
00095   typedef typename Superclass::OutputType OutputType;
00096 
00099   virtual bool IsInsideBuffer(const IndexType &) const
00100   {
00101     return true;
00102   }
00103 
00106   virtual bool IsInsideBuffer(const PointType &) const
00107   {
00108     return true;
00109   }
00110 
00113   virtual bool IsInsideBuffer(const ContinuousIndexType &) const
00114   {
00115     return true;
00116   }
00117 
00123   virtual OutputType EvaluateAtContinuousIndex(
00124     const ContinuousIndexType & index) const;
00125 
00131   virtual OutputType EvaluateAtIndex(const IndexType & index) const;
00132 
00133 protected:
00134   VectorLinearInterpolateNearestNeighborExtrapolateImageFunction();
00135   virtual ~VectorLinearInterpolateNearestNeighborExtrapolateImageFunction() {}
00136 
00137   virtual void PrintSelf(std::ostream & os, Indent indent) const;
00138 
00139 private:
00140   VectorLinearInterpolateNearestNeighborExtrapolateImageFunction(const Self &); //purposely
00141                                                                                 // not
00142                                                                                 // implemented
00143   void operator=(const Self &);                                                 //purposely
00144                                                                                 // not
00145                                                                                 // implemented
00146 
00148   static const unsigned int m_Neighbors;
00149 };
00150 } // end namespace itk
00151 
00152 #ifndef ITK_MANUAL_INSTANTIATION
00153 #include "itkVectorLinearInterpolateNearestNeighborExtrapolateImageFunction.hxx"
00154 #endif
00155 
00156 #endif
00157