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 &, OutputType &, CovariantVectorType &) const
161 {
162 itkExceptionMacro("ERROR: EvaluateValueAndDerivativeAtContinuousIndex() is not implemented for this dimension ("
163 << ImageDimension << ").");
164 }
165};
166
167} // end namespace itk
168
169#ifndef ITK_MANUAL_INSTANTIATION
170# include "itkAdvancedLinearInterpolateImageFunction.hxx"
171#endif
172
173#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)
CovariantVectorType EvaluateDerivativeAtContinuousIndex(const ContinuousIndexType &x) const
void EvaluateValueAndDerivativeUnOptimized(const ContinuousIndexType &, OutputType &, CovariantVectorType &) const
LinearInterpolateImageFunction< TInputImage, TCoordRep > Superclass
void EvaluateValueAndDerivativeOptimized(const DispatchBase &, const ContinuousIndexType &x, OutputType &value, CovariantVectorType &deriv) const


Generated on 2024-07-17 for elastix by doxygen 1.11.0 (9b424b03c9833626cd435af22a444888fbbb192d) elastix logo