ITK  4.6.0
Insight Segmentation and Registration Toolkit
itkInterpolateImageFunction.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef __itkInterpolateImageFunction_h
19 #define __itkInterpolateImageFunction_h
20 
21 #include "itkImageFunction.h"
22 
23 namespace itk
24 {
43 template< typename TInputImage, typename TCoordRep = double >
45  public ImageFunction< TInputImage,
46  typename NumericTraits< typename TInputImage::PixelType >::RealType, TCoordRep >
47 {
48 public:
51  typedef ImageFunction< TInputImage,
53  TCoordRep > Superclass;
54 
57 
60 
62  typedef typename Superclass::OutputType OutputType;
63 
66 
68  itkStaticConstMacro(ImageDimension, unsigned int,
70 
72  typedef typename Superclass::PointType PointType;
73 
75  typedef typename Superclass::IndexType IndexType;
77 
80 
83 
92  virtual OutputType Evaluate(const PointType & point) const
93  {
94  ContinuousIndexType index;
95 
96  this->GetInputImage()->TransformPhysicalPointToContinuousIndex(point, index);
97  return ( this->EvaluateAtContinuousIndex(index) );
98  }
99 
111  const ContinuousIndexType & index) const = 0;
112 
121  virtual OutputType EvaluateAtIndex(const IndexType & index) const
122  {
123  return ( static_cast< RealType >( this->GetInputImage()->GetPixel(index) ) );
124  }
125 
126 protected:
129  void PrintSelf(std::ostream & os, Indent indent) const
130  { Superclass::PrintSelf(os, indent); }
131 
132 private:
133  InterpolateImageFunction(const Self &); //purposely not implemented
134  void operator=(const Self &); //purposely not implemented
135 };
136 } // end namespace itk
137 
138 #endif
Point< TCoordRep, itkGetStaticConstMacro(ImageDimension) > PointType
void operator=(const Self &)
virtual OutputType EvaluateAtContinuousIndex(const ContinuousIndexType &index) const =0
static const unsigned int ImageDimension
SmartPointer< const Self > ConstPointer
static const unsigned int ImageDimension
virtual OutputType EvaluateAtIndex(const IndexType &index) const
virtual OutputType Evaluate(const PointType &point) const
InputImageType::IndexType IndexType
Superclass::InputImageType InputImageType
TInputImage InputImageType
void PrintSelf(std::ostream &os, Indent indent) const
ContinuousIndex< TCoordRep, itkGetStaticConstMacro(ImageDimension) > ContinuousIndexType
Superclass::ContinuousIndexType ContinuousIndexType
Base class for all image interpolaters.
void PrintSelf(std::ostream &os, Indent indent) const
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Superclass::IndexValueType IndexValueType
A templated class holding a geometric point in n-Dimensional space.
Definition: itkPoint.h:51
Evaluates a function of an image at specified position.
InputImageType::IndexValueType IndexValueType
NumericTraits< typename TInputImage::PixelType >::RealType RealType
ImageFunction< TInputImage, typename NumericTraits< typename TInputImage::PixelType >::RealType, TCoordRep > Superclass