go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkAdvancedLinearInterpolateImageFunction.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 __itkAdvancedLinearInterpolateImageFunction_h
19 #define __itkAdvancedLinearInterpolateImageFunction_h
20 
21 #include "itkLinearInterpolateImageFunction.h"
22 
23 namespace itk
24 {
51 template< class TInputImage, class TCoordRep = double >
53  public LinearInterpolateImageFunction< TInputImage, TCoordRep >
54 {
55 public:
56 
59  typedef LinearInterpolateImageFunction< TInputImage, TCoordRep > Superclass;
60  typedef SmartPointer< Self > Pointer;
61  typedef SmartPointer< const Self > ConstPointer;
62 
64  itkTypeMacro( AdvancedLinearInterpolateImageFunction, LinearInterpolateImageFunction );
65 
67  itkNewMacro( Self );
68 
70  typedef typename Superclass::OutputType OutputType;
71 
73  typedef typename Superclass::InputImageType InputImageType;
74  typedef typename InputImageType::SpacingType InputImageSpacingType;
75 
77  typedef typename Superclass::InputPixelType InputPixelType;
78 
80  typedef typename Superclass::RealType RealType;
81 
83  itkStaticConstMacro( ImageDimension, unsigned int, Superclass::ImageDimension );
84 
86  typedef typename Superclass::IndexType IndexType;
87 
89  typedef typename Superclass::ContinuousIndexType ContinuousIndexType;
90  typedef typename ContinuousIndexType::ValueType ContinuousIndexValueType;
91 
93  typedef CovariantVector< OutputType,
94  itkGetStaticConstMacro( ImageDimension ) > CovariantVectorType;
95 
98  const ContinuousIndexType & x ) const;
99 
102  const ContinuousIndexType & x,
103  OutputType & value,
104  CovariantVectorType & deriv ) const
105  {
107  Dispatch< ImageDimension >(), x, value, deriv );
108  }
109 
110 
111 protected:
112 
115 
116 private:
117 
118  AdvancedLinearInterpolateImageFunction( const Self & ); // purposely not implemented
119  void operator=( const Self & ); // purposely not implemented
120 
122  struct DispatchBase {};
123  template< unsigned int >
124  struct Dispatch : public DispatchBase {};
125 
128  const Dispatch< 2 > &,
129  const ContinuousIndexType & x,
130  OutputType & value,
131  CovariantVectorType & deriv ) const;
132 
135  const Dispatch< 3 > &,
136  const ContinuousIndexType & x,
137  OutputType & value,
138  CovariantVectorType & deriv ) const;
139 
142  const DispatchBase &,
143  const ContinuousIndexType & x,
144  OutputType & value,
145  CovariantVectorType & deriv ) const
146  {
147  return this->EvaluateValueAndDerivativeUnOptimized( x, value, deriv );
148  }
149 
150 
153  const ContinuousIndexType & x,
154  OutputType & value,
155  CovariantVectorType & deriv ) const
156  {
157  itkExceptionMacro( << "ERROR: EvaluateValueAndDerivativeAtContinuousIndex() "
158  << "is not implemented for this dimension ("
159  << ImageDimension << ")." );
160  }
161 
162 
163 };
164 
165 } // end namespace itk
166 
167 #ifndef ITK_MANUAL_INSTANTIATION
168 #include "itkAdvancedLinearInterpolateImageFunction.hxx"
169 #endif
170 
171 #endif
CovariantVector< OutputType, itkGetStaticConstMacro(ImageDimension) > CovariantVectorType
void EvaluateValueAndDerivativeOptimized(const DispatchBase &, const ContinuousIndexType &x, OutputType &value, CovariantVectorType &deriv) const
LinearInterpolateImageFunction< TInputImage, TCoordRep > Superclass
void EvaluateValueAndDerivativeUnOptimized(const ContinuousIndexType &x, OutputType &value, CovariantVectorType &deriv) const
CovariantVectorType EvaluateDerivativeAtContinuousIndex(const ContinuousIndexType &x) const
void EvaluateValueAndDerivativeAtContinuousIndex(const ContinuousIndexType &x, OutputType &value, CovariantVectorType &deriv) const
void EvaluateValueAndDerivativeOptimized(const Dispatch< 2 > &, const ContinuousIndexType &x, OutputType &value, CovariantVectorType &deriv) const
itkStaticConstMacro(ImageDimension, unsigned int, Superclass::ImageDimension)
Linearly interpolate an image at specified positions.


Generated on 27-04-2014 for elastix by doxygen 1.8.6 elastix logo