go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkEulerTransform.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 itkEulerTransform_h
19#define itkEulerTransform_h
20
24
25namespace itk
26{
27
34template <unsigned int Dimension>
35class ITK_TEMPLATE_EXPORT EulerGroup
36{
37public:
38 template <class TScalarType>
39 using TransformAlias = AdvancedMatrixOffsetTransformBase<TScalarType, Dimension, Dimension>;
40};
41
48template <>
49class ITK_TEMPLATE_EXPORT EulerGroup<2>
50{
51public:
52 template <class TScalarType>
53 using TransformAlias = AdvancedRigid2DTransform<TScalarType>;
54};
55
62template <>
63class ITK_TEMPLATE_EXPORT EulerGroup<3>
64{
65public:
66 template <class TScalarType>
67 using TransformAlias = AdvancedEuler3DTransform<TScalarType>;
68};
69
70
74template <class TScalarType, unsigned int Dimension>
75using EulerGroupTemplate = typename EulerGroup<Dimension>::template TransformAlias<TScalarType>;
76
77
87template <class TScalarType, unsigned int Dimension>
88class ITK_TEMPLATE_EXPORT EulerTransform : public EulerGroupTemplate<TScalarType, Dimension>
89{
90public:
92
95 using Superclass = EulerGroupTemplate<TScalarType, Dimension>;
96 using Pointer = SmartPointer<Self>;
97 using ConstPointer = SmartPointer<const Self>;
98
100 itkNewMacro(Self);
101
103 itkTypeMacro(EulerTransform, EulerGroupTemplate);
104
106 itkStaticConstMacro(SpaceDimension, unsigned int, Dimension);
107
111 using typename Superclass::ScalarType;
112 using typename Superclass::ParametersType;
113 using typename Superclass::NumberOfParametersType;
114 using typename Superclass::JacobianType;
115 using typename Superclass::OffsetType;
116 using typename Superclass::InputPointType;
117 using typename Superclass::OutputPointType;
118 using typename Superclass::InputVectorType;
119 using typename Superclass::OutputVectorType;
120 using typename Superclass::InputCovariantVectorType;
121 using typename Superclass::OutputCovariantVectorType;
122 using typename Superclass::InputVnlVectorType;
123 using typename Superclass::OutputVnlVectorType;
124
125 using typename Superclass::NonZeroJacobianIndicesType;
126 using typename Superclass::SpatialJacobianType;
127 using typename Superclass::JacobianOfSpatialJacobianType;
128 using typename Superclass::SpatialHessianType;
129 using typename Superclass::JacobianOfSpatialHessianType;
130 using typename Superclass::InternalMatrixType;
131
135 void
136 SetComputeZYX(const bool) // No override.
137 {
138 static_assert(SpaceDimension != 3, "This is not the specialization is 3D!");
139 }
140
141
145 bool
146 GetComputeZYX() const // No override.
147 {
148 static_assert(SpaceDimension != 3, "This is not the specialization is 3D!");
149 return false;
150 }
151
152
153protected:
154 EulerTransform() = default;
155 ~EulerTransform() override = default;
156};
157
158template <class TScalarType>
159class ITK_TEMPLATE_EXPORT EulerTransform<TScalarType, 3> : public EulerGroupTemplate<TScalarType, 3>
160{
161public:
163
166 using Superclass = EulerGroupTemplate<TScalarType, 3>;
167 using Pointer = SmartPointer<Self>;
168 using ConstPointer = SmartPointer<const Self>;
169
171 itkNewMacro(Self);
172
174 itkTypeMacro(EulerTransform, EulerGroupTemplate);
175
177 itkStaticConstMacro(SpaceDimension, unsigned int, 3);
178
179
184 void
185 SetComputeZYX(const bool arg) override
186 {
187 static_assert(SpaceDimension == 3, "This specialization is for 3D only!");
188
189 using Euler3DTransformType = AdvancedEuler3DTransform<TScalarType>;
190 typename Euler3DTransformType::Pointer transform = dynamic_cast<Euler3DTransformType *>(this);
191 if (transform)
192 {
193 transform->Euler3DTransformType::SetComputeZYX(arg);
194 }
195 }
196
197
202 bool
203 GetComputeZYX() const override
204 {
205 static_assert(SpaceDimension == 3, "This specialization is for 3D only!");
206
207 using Euler3DTransformType = AdvancedEuler3DTransform<TScalarType>;
208 typename Euler3DTransformType::ConstPointer transform = dynamic_cast<const Euler3DTransformType *>(this);
209
210 if (transform)
211 {
212 return transform->Euler3DTransformType::GetComputeZYX();
213 }
214 return false;
215 }
216
217
218protected:
219 EulerTransform() = default;
220 ~EulerTransform() override = default;
221};
222
223} // end namespace itk
224
225#endif // end #ifndef itkEulerTransform_h
AdvancedEuler3DTransform of a vector space (e.g. space coordinates)
void SetComputeZYX(const bool arg) override
itkStaticConstMacro(SpaceDimension, unsigned int, 3)
SmartPointer< const Self > ConstPointer
EulerGroupTemplate< TScalarType, 3 > Superclass
This class combines the Euler2DTransform with the Euler3DTransform.
bool GetComputeZYX() const
ITK_DISALLOW_COPY_AND_MOVE(EulerTransform)
itkStaticConstMacro(SpaceDimension, unsigned int, Dimension)
~EulerTransform() override=default
EulerGroupTemplate< TScalarType, Dimension > Superclass
SmartPointer< const Self > ConstPointer
void SetComputeZYX(const bool)
EulerTransform()=default


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