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 UMC Utrecht and contributors
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
23namespace itk
24{
62template <class TInputImage, class TCoordRep = double>
64 : public LinearInterpolateImageFunction<TInputImage, TCoordRep>
65{
66public:
68
71 using Superclass = LinearInterpolateImageFunction<TInputImage, TCoordRep>;
72 using Pointer = SmartPointer<Self>;
73 using ConstPointer = SmartPointer<const Self>;
74
76 itkTypeMacro(AdvancedLinearInterpolateImageFunction, LinearInterpolateImageFunction);
77
79 itkNewMacro(Self);
80
82 using typename Superclass::OutputType;
83
85 using typename Superclass::InputImageType;
86 using InputImageSpacingType = typename InputImageType::SpacingType;
87
89 using typename Superclass::InputPixelType;
90
92 using typename Superclass::RealType;
93
95 itkStaticConstMacro(ImageDimension, unsigned int, Superclass::ImageDimension);
96
98 using typename Superclass::IndexType;
99
101 using typename Superclass::ContinuousIndexType;
102 using ContinuousIndexValueType = typename ContinuousIndexType::ValueType;
103
105 using CovariantVectorType = CovariantVector<OutputType, Self::ImageDimension>;
106
109 EvaluateDerivativeAtContinuousIndex(const ContinuousIndexType & x) const;
110
112 void
113 EvaluateValueAndDerivativeAtContinuousIndex(const ContinuousIndexType & x,
114 OutputType & value,
115 CovariantVectorType & deriv) const
116 {
117 return this->EvaluateValueAndDerivativeOptimized(Dispatch<ImageDimension>(), x, value, deriv);
118 }
119
120
121protected:
124
125private:
127 struct DispatchBase
128 {};
129 template <unsigned int>
130 struct Dispatch : public DispatchBase
131 {};
132
134 void
136 const ContinuousIndexType & x,
137 OutputType & value,
138 CovariantVectorType & deriv) const;
139
141 void
143 const ContinuousIndexType & x,
144 OutputType & value,
145 CovariantVectorType & deriv) const;
146
148 void
150 const ContinuousIndexType & x,
151 OutputType & value,
152 CovariantVectorType & deriv) const
153 {
154 return this->EvaluateValueAndDerivativeUnOptimized(x, value, deriv);
155 }
156
157
159 void
160 EvaluateValueAndDerivativeUnOptimized(const ContinuousIndexType & x,
161 OutputType & value,
162 CovariantVectorType & deriv) const
163 {
164 itkExceptionMacro(<< "ERROR: EvaluateValueAndDerivativeAtContinuousIndex() is not implemented for this dimension ("
165 << ImageDimension << ").");
166 }
167};
168
169} // end namespace itk
170
171#ifndef ITK_MANUAL_INSTANTIATION
172# include "itkAdvancedLinearInterpolateImageFunction.hxx"
173#endif
174
175#endif
Linearly interpolate an image at specified positions.
itkStaticConstMacro(ImageDimension, unsigned int, Superclass::ImageDimension)
void EvaluateValueAndDerivativeOptimized(const Dispatch< 2 > &, const ContinuousIndexType &x, OutputType &value, CovariantVectorType &deriv) const
CovariantVector< OutputType, Self::ImageDimension > CovariantVectorType
void EvaluateValueAndDerivativeOptimized(const Dispatch< 3 > &, const ContinuousIndexType &x, OutputType &value, CovariantVectorType &deriv) const
void EvaluateValueAndDerivativeAtContinuousIndex(const ContinuousIndexType &x, OutputType &value, CovariantVectorType &deriv) const
~AdvancedLinearInterpolateImageFunction() override=default
ITK_DISALLOW_COPY_AND_MOVE(AdvancedLinearInterpolateImageFunction)
void EvaluateValueAndDerivativeUnOptimized(const ContinuousIndexType &x, OutputType &value, CovariantVectorType &deriv) const
CovariantVectorType EvaluateDerivativeAtContinuousIndex(const ContinuousIndexType &x) const
LinearInterpolateImageFunction< TInputImage, TCoordRep > Superclass
void EvaluateValueAndDerivativeOptimized(const DispatchBase &, const ContinuousIndexType &x, OutputType &value, CovariantVectorType &deriv) const


Generated on 2023-01-13 for elastix by doxygen 1.9.6 elastix logo