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 & inputPoint,
186 JacobianType & j,
187 NonZeroJacobianIndicesType & nonZeroJacobianIndices) const override
188 {
189 itkExceptionMacro(<< "Not implemented for DeformationFieldInterpolatingTransform");
190 }
191
192
193 void
194 GetSpatialJacobian(const InputPointType & inputPoint, SpatialJacobianType & sj) const override
195 {
196 itkExceptionMacro(<< "Not implemented for DeformationFieldInterpolatingTransform");
197 }
198
199
200 void
201 GetSpatialHessian(const InputPointType & inputPoint, SpatialHessianType & sh) const override
202 {
203 itkExceptionMacro(<< "Not implemented for DeformationFieldInterpolatingTransform");
204 }
205
206
207 void
208 GetJacobianOfSpatialJacobian(const InputPointType & inputPoint,
210 NonZeroJacobianIndicesType & nonZeroJacobianIndices) const override
211 {
212 itkExceptionMacro(<< "Not implemented for DeformationFieldInterpolatingTransform");
213 }
214
215
216 void
217 GetJacobianOfSpatialJacobian(const InputPointType & inputPoint,
220 NonZeroJacobianIndicesType & nonZeroJacobianIndices) const override
221 {
222 itkExceptionMacro(<< "Not implemented for DeformationFieldInterpolatingTransform");
223 }
224
225
226 void
227 GetJacobianOfSpatialHessian(const InputPointType & inputPoint,
229 NonZeroJacobianIndicesType & nonZeroJacobianIndices) const override
230 {
231 itkExceptionMacro(<< "Not implemented for DeformationFieldInterpolatingTransform");
232 }
233
234
235 void
236 GetJacobianOfSpatialHessian(const InputPointType & inputPoint,
239 NonZeroJacobianIndicesType & nonZeroJacobianIndices) const override
240 {
241 itkExceptionMacro(<< "Not implemented for DeformationFieldInterpolatingTransform");
242 }
243
244
245protected:
248
250 using InputContinuousIndexType = typename DeformationFieldInterpolatorType::ContinuousIndexType;
251 using InterpolatorOutputType = typename DeformationFieldInterpolatorType::OutputType;
252
254 void
255 PrintSelf(std::ostream & os, Indent indent) const override;
256
260};
261
262} // namespace itk
263
264#ifndef ITK_MANUAL_INSTANTIATION
265# include "itkDeformationFieldInterpolatingTransform.hxx"
266#endif
267
268#endif /* itkDeformationFieldInterpolatingTransform_h */
Transform maps points, vectors and covariant vectors from an input space to an output space.
typename SpatialJacobianType::InternalMatrixType InternalMatrixType
Matrix< ScalarType, OutputSpaceDimension, InputSpaceDimension > SpatialJacobianType
FixedArray< Matrix< ScalarType, InputSpaceDimension, InputSpaceDimension >, OutputSpaceDimension > SpatialHessianType
Transform that interpolates a given deformation field.
~DeformationFieldInterpolatingTransform() override=default
typename DeformationFieldInterpolatorType::OutputType InterpolatorOutputType
OutputPointType TransformPoint(const InputPointType &point) const override
void GetSpatialHessian(const InputPointType &inputPoint, SpatialHessianType &sh) 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)
typename DeformationFieldInterpolatorType::Pointer DeformationFieldInterpolatorPointer
void GetJacobian(const InputPointType &inputPoint, JacobianType &j, NonZeroJacobianIndicesType &nonZeroJacobianIndices) const override
VectorInterpolateImageFunction< DeformationFieldType, ScalarType > DeformationFieldInterpolatorType
typename DeformationFieldInterpolatorType::ContinuousIndexType InputContinuousIndexType
ITK_DISALLOW_COPY_AND_MOVE(DeformationFieldInterpolatingTransform)
OutputCovariantVectorType TransformCovariantVector(const InputCovariantVectorType &) const override
virtual void SetDeformationField(DeformationFieldType *_arg)
OutputVectorType TransformVector(const InputVectorType &) const override
Vector< DeformationFieldComponentType, Self::OutputSpaceDimension > DeformationFieldVectorType
VectorNearestNeighborInterpolateImageFunction< DeformationFieldType, ScalarType > DefaultDeformationFieldInterpolatorType
void GetJacobianOfSpatialHessian(const InputPointType &inputPoint, SpatialHessianType &sh, JacobianOfSpatialHessianType &jsh, NonZeroJacobianIndicesType &nonZeroJacobianIndices) const override
void GetJacobianOfSpatialJacobian(const InputPointType &inputPoint, JacobianOfSpatialJacobianType &jsj, NonZeroJacobianIndicesType &nonZeroJacobianIndices) const override
void GetJacobianOfSpatialHessian(const InputPointType &inputPoint, JacobianOfSpatialHessianType &jsh, NonZeroJacobianIndicesType &nonZeroJacobianIndices) const override
void GetJacobianOfSpatialJacobian(const InputPointType &inputPoint, SpatialJacobianType &sj, JacobianOfSpatialJacobianType &jsj, NonZeroJacobianIndicesType &nonZeroJacobianIndices) const override
void GetSpatialJacobian(const InputPointType &inputPoint, SpatialJacobianType &sj) const override
itkGetModifiableObjectMacro(DeformationFieldInterpolator, DeformationFieldInterpolatorType)
itkStaticConstMacro(OutputSpaceDimension, unsigned int, Superclass::OutputSpaceDimension)
itkGetModifiableObjectMacro(DeformationField, DeformationFieldType)


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