go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkAdvancedTranslationTransform.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/*=========================================================================
19
20 Program: Insight Segmentation & Registration Toolkit
21 Module: $RCSfile: itkAdvancedTranslationTransform.h,v $
22 Date: $Date: 2007-07-15 16:38:25 $
23 Version: $Revision: 1.36 $
24
25 Copyright (c) Insight Software Consortium. All rights reserved.
26 See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
27
28 This software is distributed WITHOUT ANY WARRANTY; without even
29 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
30 PURPOSE. See the above copyright notices for more information.
31
32=========================================================================*/
33#ifndef itkAdvancedTranslationTransform_h
34#define itkAdvancedTranslationTransform_h
35
36#include <iostream>
38#include "itkMacro.h"
39#include "itkMatrix.h"
40
41namespace itk
42{
43
51template <class TScalarType = double, // Data type for scalars (float or double)
52 unsigned int NDimensions = 3>
53// Number of dimensions
54class ITK_TEMPLATE_EXPORT AdvancedTranslationTransform : public AdvancedTransform<TScalarType, NDimensions, NDimensions>
55{
56public:
58
62 using Pointer = SmartPointer<Self>;
63 using ConstPointer = SmartPointer<const Self>;
64
66 itkNewMacro(Self);
67
70
72 itkStaticConstMacro(SpaceDimension, unsigned int, NDimensions);
73 itkStaticConstMacro(ParametersDimension, unsigned int, NDimensions);
74
76 using typename Superclass::ScalarType;
77
79 using typename Superclass::ParametersType;
80 using typename Superclass::FixedParametersType;
81 using typename Superclass::NumberOfParametersType;
82 using typename Superclass::TransformCategoryEnum;
83
85 using typename Superclass::JacobianType;
86
88 using InputVectorType = Vector<TScalarType, Self::SpaceDimension>;
89 using OutputVectorType = Vector<TScalarType, Self::SpaceDimension>;
90
92 using InputCovariantVectorType = CovariantVector<TScalarType, Self::SpaceDimension>;
93 using OutputCovariantVectorType = CovariantVector<TScalarType, Self::SpaceDimension>;
94
96 using InputVnlVectorType = vnl_vector_fixed<TScalarType, Self::SpaceDimension>;
97 using OutputVnlVectorType = vnl_vector_fixed<TScalarType, Self::SpaceDimension>;
98
100 using InputPointType = Point<TScalarType, Self::SpaceDimension>;
101 using OutputPointType = Point<TScalarType, Self::SpaceDimension>;
102
105 using typename Superclass::SpatialJacobianType;
107 using typename Superclass::SpatialHessianType;
109 using typename Superclass::InternalMatrixType;
110
114 const OutputVectorType &
115 GetOffset() const
116 {
117 return m_Offset;
118 }
119
122 void
123 SetParameters(const ParametersType & parameters) override;
124
126 const ParametersType &
127 GetParameters() const override;
128
132 void
134 {
135 m_Offset = offset;
136 return;
137 }
138
143 OutputPointType
144 TransformPoint(const InputPointType & point) const override;
145
147 TransformVector(const InputVectorType & vector) const override;
148
150 TransformVector(const InputVnlVectorType & vector) const override;
151
154
156 void
157 GetJacobian(const InputPointType &, JacobianType &, NonZeroJacobianIndicesType &) const override;
158
160 void
162
164 void
166
168 void
171 NonZeroJacobianIndicesType &) const override;
172
174 void
178 NonZeroJacobianIndicesType &) const override;
179
181 void
184 NonZeroJacobianIndicesType &) const override;
185
189 void
193 NonZeroJacobianIndicesType & nonZeroJacobianIndices) const override;
194
196 void
198
200 NumberOfParametersType
201 GetNumberOfParameters() const override
202 {
203 return NDimensions;
204 }
205
211 bool
212 IsLinear() const override
213 {
214 return true;
215 }
216
220 TransformCategoryEnum
221 GetTransformCategory() const override
222 {
223 return TransformCategoryEnum::Linear;
224 }
225
226
230 void
231 SetFixedParameters(const FixedParametersType &) override
232 { /* purposely blank */
233 }
234
238 const FixedParametersType &
239 GetFixedParameters() const override
240 {
241 this->m_FixedParameters.SetSize(0);
242 return this->m_FixedParameters;
243 }
244
245
246protected:
250 void
251 PrintSelf(std::ostream & os, Indent indent) const override;
252
253private:
254 OutputVectorType m_Offset{}; // Offset of the transformation
255
256 // The Jacobian of this transform is constant. Therefore it can be shared among all the threads.
257 const JacobianType m_LocalJacobian{
258 Matrix<TScalarType, NDimensions, NDimensions>::GetIdentity().GetVnlMatrix().as_matrix()
259 };
260 const SpatialJacobianType m_SpatialJacobian{ SpatialJacobianType::GetIdentity() };
261 const SpatialHessianType m_SpatialHessian{};
262 NonZeroJacobianIndicesType m_NonZeroJacobianIndices{ NonZeroJacobianIndicesType(NDimensions) };
263 const JacobianOfSpatialJacobianType m_JacobianOfSpatialJacobian{ JacobianOfSpatialJacobianType(NDimensions) };
264 const JacobianOfSpatialHessianType m_JacobianOfSpatialHessian{ JacobianOfSpatialHessianType(NDimensions) };
265};
266
267// class AdvancedTranslationTransform
268
269
270} // namespace itk
271
272#ifndef ITK_MANUAL_INSTANTIATION
273# include "itkAdvancedTranslationTransform.hxx"
274#endif
275
276#endif /* itkAdvancedTranslationTransform_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
Translation transformation of a vector space (e.g. space coordinates)
void GetSpatialJacobian(const InputPointType &, SpatialJacobianType &) const override
void GetSpatialHessian(const InputPointType &, SpatialHessianType &) const override
Point< TScalarType, Self::SpaceDimension > OutputPointType
CovariantVector< TScalarType, Self::SpaceDimension > InputCovariantVectorType
void SetFixedParameters(const FixedParametersType &) override
void SetOffset(const OutputVectorType &offset)
ITK_DISALLOW_COPY_AND_MOVE(AdvancedTranslationTransform)
void SetParameters(const ParametersType &parameters) override
OutputVectorType TransformVector(const InputVectorType &vector) const override
itkStaticConstMacro(SpaceDimension, unsigned int, NDimensions)
Vector< TScalarType, Self::SpaceDimension > OutputVectorType
OutputCovariantVectorType TransformCovariantVector(const InputCovariantVectorType &vector) const override
void PrintSelf(std::ostream &os, Indent indent) const override
void GetJacobianOfSpatialHessian(const InputPointType &, JacobianOfSpatialHessianType &, NonZeroJacobianIndicesType &) const override
CovariantVector< TScalarType, Self::SpaceDimension > OutputCovariantVectorType
OutputVnlVectorType TransformVector(const InputVnlVectorType &vector) const override
void GetJacobianOfSpatialHessian(const InputPointType &inputPoint, SpatialHessianType &sh, JacobianOfSpatialHessianType &jsh, NonZeroJacobianIndicesType &nonZeroJacobianIndices) const override
Point< TScalarType, Self::SpaceDimension > InputPointType
const ParametersType & GetParameters() const override
NumberOfParametersType GetNumberOfParameters() const override
void GetJacobian(const InputPointType &, JacobianType &, NonZeroJacobianIndicesType &) const override
Vector< TScalarType, Self::SpaceDimension > InputVectorType
void GetJacobianOfSpatialJacobian(const InputPointType &, JacobianOfSpatialJacobianType &, NonZeroJacobianIndicesType &) const override
const FixedParametersType & GetFixedParameters() const override
TransformCategoryEnum GetTransformCategory() const override
OutputPointType TransformPoint(const InputPointType &point) const override
vnl_vector_fixed< TScalarType, Self::SpaceDimension > OutputVnlVectorType
itkStaticConstMacro(ParametersDimension, unsigned int, NDimensions)
const OutputVectorType & GetOffset() const
void GetJacobianOfSpatialJacobian(const InputPointType &, SpatialJacobianType &, JacobianOfSpatialJacobianType &, NonZeroJacobianIndicesType &) const override
vnl_vector_fixed< TScalarType, Self::SpaceDimension > InputVnlVectorType


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