go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkDeformationFieldInterpolatingTransform.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 itkDeformationFieldInterpolatingTransform_h
19#define itkDeformationFieldInterpolatingTransform_h
20
21#include <iostream>
23#include "itkMacro.h"
24#include "itkImage.h"
25#include "itkVectorInterpolateImageFunction.h"
26#include "itkVectorNearestNeighborInterpolateImageFunction.h"
27
28namespace itk
29{
30
42template <class TScalarType = double, // Data type for scalars (float or double)
43 unsigned int NDimensions = 3, // Number of input dimensions
44 class TComponentType = double>
45// ComponentType of the deformation field
47 : public AdvancedTransform<TScalarType, NDimensions, NDimensions>
48{
49public:
51
55 using Pointer = SmartPointer<Self>;
56 using ConstPointer = SmartPointer<const Self>;
57
59 itkNewMacro(Self);
60
63
65 itkStaticConstMacro(InputSpaceDimension, unsigned int, Superclass::InputSpaceDimension);
66 itkStaticConstMacro(OutputSpaceDimension, unsigned int, Superclass::OutputSpaceDimension);
67
69 using typename Superclass::ScalarType;
70 using typename Superclass::ParametersType;
71 using typename Superclass::NumberOfParametersType;
72 using typename Superclass::JacobianType;
73 using typename Superclass::InputVectorType;
74 using typename Superclass::OutputVectorType;
75 using typename Superclass::InputCovariantVectorType;
76 using typename Superclass::OutputCovariantVectorType;
77 using typename Superclass::InputVnlVectorType;
78 using typename Superclass::OutputVnlVectorType;
79 using typename Superclass::InputPointType;
80 using typename Superclass::OutputPointType;
82 using typename Superclass::SpatialHessianType;
86
87 using typename Superclass::InternalMatrixType;
88
89 using DeformationFieldComponentType = TComponentType;
90 using DeformationFieldVectorType = Vector<DeformationFieldComponentType, Self::OutputSpaceDimension>;
92 using DeformationFieldPointer = typename DeformationFieldType::Pointer;
93
94 using DeformationFieldInterpolatorType = VectorInterpolateImageFunction<DeformationFieldType, ScalarType>;
95 using DeformationFieldInterpolatorPointer = typename DeformationFieldInterpolatorType::Pointer;
97 VectorNearestNeighborInterpolateImageFunction<DeformationFieldType, ScalarType>;
98
102 void
103 SetParameters(const ParametersType &) override
104 {
105 itkExceptionMacro("ERROR: SetParameters() is not implemented for DeformationFieldInterpolatingTransform.\n"
106 << "Use SetDeformationField() instead.\n"
107 << "Note that this transform is NOT suited for image registration.\n"
108 << "Just use it as an (initial) fixed transform that is not optimized.");
109 }
110
111
113 void
114 SetFixedParameters(const ParametersType &) override
115 {
116 // This transform has no fixed parameters.
117 }
118
119
121 const ParametersType &
122 GetFixedParameters() const override
123 {
124 // This transform has no fixed parameters.
125 return this->m_FixedParameters;
126 }
127
128
132 OutputPointType
133 TransformPoint(const InputPointType & point) const override;
134
136 OutputVectorType
137 TransformVector(const InputVectorType &) const override
138 {
139 itkExceptionMacro(
140 "TransformVector(const InputVectorType &) is not implemented for DeformationFieldInterpolatingTransform");
141 }
142
143
144 OutputVnlVectorType
145 TransformVector(const InputVnlVectorType &) const override
146 {
147 itkExceptionMacro(
148 "TransformVector(const InputVnlVectorType &) is not implemented for DeformationFieldInterpolatingTransform");
149 }
150
151
152 OutputCovariantVectorType
153 TransformCovariantVector(const InputCovariantVectorType &) const override
154 {
155 itkExceptionMacro("TransformCovariantVector(const InputCovariantVectorType &) is not implemented for "
156 "DeformationFieldInterpolatingTransform");
157 }
158
159
162 void
164
166 virtual void
168
170
172 virtual void
174
176
177 bool
178 IsLinear() const override
179 {
180 return false;
181 }
182
184 void
185 GetJacobian(const InputPointType &, JacobianType &, NonZeroJacobianIndicesType &) const override
186 {
187 itkExceptionMacro("Not implemented for DeformationFieldInterpolatingTransform");
188 }
189
190
191 void
192 GetSpatialJacobian(const InputPointType &, SpatialJacobianType &) const override
193 {
194 itkExceptionMacro("Not implemented for DeformationFieldInterpolatingTransform");
195 }
196
197
198 void
199 GetSpatialHessian(const InputPointType &, SpatialHessianType &) const override
200 {
201 itkExceptionMacro("Not implemented for DeformationFieldInterpolatingTransform");
202 }
203
204
205 void
206 GetJacobianOfSpatialJacobian(const InputPointType &,
208 NonZeroJacobianIndicesType &) const override
209 {
210 itkExceptionMacro("Not implemented for DeformationFieldInterpolatingTransform");
211 }
212
213
214 void
215 GetJacobianOfSpatialJacobian(const InputPointType &,
218 NonZeroJacobianIndicesType &) const override
219 {
220 itkExceptionMacro("Not implemented for DeformationFieldInterpolatingTransform");
221 }
222
223
224 void
225 GetJacobianOfSpatialHessian(const InputPointType &,
227 NonZeroJacobianIndicesType &) const override
228 {
229 itkExceptionMacro("Not implemented for DeformationFieldInterpolatingTransform");
230 }
231
232
233 void
234 GetJacobianOfSpatialHessian(const InputPointType &,
237 NonZeroJacobianIndicesType &) const override
238 {
239 itkExceptionMacro("Not implemented for DeformationFieldInterpolatingTransform");
240 }
241
242
243protected:
246
248 using InputContinuousIndexType = typename DeformationFieldInterpolatorType::ContinuousIndexType;
249 using InterpolatorOutputType = typename DeformationFieldInterpolatorType::OutputType;
250
252 void
253 PrintSelf(std::ostream & os, Indent indent) const override;
254
255 DeformationFieldPointer m_DeformationField{};
256 DeformationFieldPointer m_ZeroDeformationField{};
257 DeformationFieldInterpolatorPointer m_DeformationFieldInterpolator{};
258
259private:
260 // Private using-declarations, to avoid `-Woverloaded-virtual` warnings from GCC (GCC 11.4).
261 using Superclass::TransformCovariantVector;
262 using Superclass::TransformVector;
263};
264
265} // namespace itk
266
267#ifndef ITK_MANUAL_INSTANTIATION
268# include "itkDeformationFieldInterpolatingTransform.hxx"
269#endif
270
271#endif /* itkDeformationFieldInterpolatingTransform_h */
Transform maps points, vectors and covariant vectors from an input space to an output space.
typename SpatialJacobianType::InternalMatrixType InternalMatrixType
FixedArray< Matrix< ScalarType, InputSpaceDimension, InputSpaceDimension >, OutputSpaceDimension > SpatialHessianType
Matrix< ScalarType, OutputSpaceDimension, InputSpaceDimension > SpatialJacobianType
Transform that interpolates a given deformation field.
~DeformationFieldInterpolatingTransform() override=default
typename DeformationFieldInterpolatorType::OutputType InterpolatorOutputType
OutputPointType TransformPoint(const InputPointType &point) const override
void GetJacobianOfSpatialHessian(const InputPointType &, SpatialHessianType &, JacobianOfSpatialHessianType &, NonZeroJacobianIndicesType &) const override
virtual void SetDeformationFieldInterpolator(DeformationFieldInterpolatorType *_arg)
void PrintSelf(std::ostream &os, Indent indent) const override
OutputVnlVectorType TransformVector(const InputVnlVectorType &) const override
itkStaticConstMacro(InputSpaceDimension, unsigned int, Superclass::InputSpaceDimension)
void GetSpatialHessian(const InputPointType &, SpatialHessianType &) const override
void GetJacobianOfSpatialJacobian(const InputPointType &, JacobianOfSpatialJacobianType &, NonZeroJacobianIndicesType &) const override
typename DeformationFieldInterpolatorType::Pointer DeformationFieldInterpolatorPointer
VectorNearestNeighborInterpolateImageFunction< DeformationFieldType, ScalarType > DefaultDeformationFieldInterpolatorType
void GetJacobianOfSpatialJacobian(const InputPointType &, SpatialJacobianType &, JacobianOfSpatialJacobianType &, NonZeroJacobianIndicesType &) const override
VectorInterpolateImageFunction< DeformationFieldType, ScalarType > DeformationFieldInterpolatorType
typename DeformationFieldInterpolatorType::ContinuousIndexType InputContinuousIndexType
ITK_DISALLOW_COPY_AND_MOVE(DeformationFieldInterpolatingTransform)
void GetJacobian(const InputPointType &, JacobianType &, NonZeroJacobianIndicesType &) const override
OutputCovariantVectorType TransformCovariantVector(const InputCovariantVectorType &) const override
virtual void SetDeformationField(DeformationFieldType *_arg)
void GetSpatialJacobian(const InputPointType &, SpatialJacobianType &) const override
OutputVectorType TransformVector(const InputVectorType &) const override
Vector< DeformationFieldComponentType, Self::OutputSpaceDimension > DeformationFieldVectorType
void GetJacobianOfSpatialHessian(const InputPointType &, JacobianOfSpatialHessianType &, NonZeroJacobianIndicesType &) const override
itkGetModifiableObjectMacro(DeformationFieldInterpolator, DeformationFieldInterpolatorType)
itkStaticConstMacro(OutputSpaceDimension, unsigned int, Superclass::OutputSpaceDimension)
itkGetModifiableObjectMacro(DeformationField, DeformationFieldType)


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