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 
25 namespace itk
26 {
27 
34 template< unsigned int Dimension >
35 class EulerGroup
36 {
37 public:
38 
39  template< class TScalarType >
40  class Dummy
41  {
42 public:
43 
45  typedef AdvancedMatrixOffsetTransformBase< TScalarType, Dimension, Dimension > EulerTransform_tmp;
46 
47  };
48 
49 };
50 
57 template< >
58 class EulerGroup< 2 >
59 {
60 public:
61 
62  template< class TScalarType >
63  class Dummy
64  {
65 public:
66 
68  typedef AdvancedRigid2DTransform< TScalarType > EulerTransform_tmp;
69 
70  };
71 
72 };
73 
80 template< >
81 class EulerGroup< 3 >
82 {
83 public:
84 
85  template< class TScalarType >
86  class Dummy
87  {
88 public:
89 
91  typedef AdvancedEuler3DTransform< TScalarType > EulerTransform_tmp;
92 
93  };
94 
95 };
96 
103 template< class TScalarType, unsigned int Dimension >
104 class EulerGroupTemplate
105 {
106 public:
107 
108  typedef EulerGroupTemplate Self;
109  typedef TScalarType ScalarType;
110  itkStaticConstMacro( SpaceDimension, unsigned int, Dimension );
111 
112  // This declaration of 'Euler' does not work with the GCC compiler
113  // typedef EulerGroup< itkGetStaticConstMacro( SpaceDimension ) > Euler;
114  // The following trick works though:
115  template< unsigned int D >
116  class EulerGroupWrap
117  {
118 public:
119 
120  typedef EulerGroup< D > Euler;
121  };
122 
123  typedef EulerGroupWrap< Dimension > EulerGroupWrapInstance;
124  typedef typename EulerGroupWrapInstance::Euler Euler;
125 
126  typedef typename Euler::template Dummy< ScalarType > EulerDummy;
127  typedef typename EulerDummy::EulerTransform_tmp EulerTransform_tmp;
128 
129 };
130 
140 template< class TScalarType, unsigned int Dimension >
142  public EulerGroupTemplate<
143  TScalarType, Dimension >::EulerTransform_tmp
144 {
145 public:
146 
149  typedef typename EulerGroupTemplate<
150  TScalarType, Dimension >
151  ::EulerTransform_tmp Superclass;
152  typedef SmartPointer< Self > Pointer;
153  typedef SmartPointer< const Self > ConstPointer;
154 
156  itkNewMacro( Self );
157 
159  itkTypeMacro( EulerTransform, EulerGroupTemplate );
160 
162  itkStaticConstMacro( SpaceDimension, unsigned int, Dimension );
163 
167  typedef typename Superclass::ScalarType ScalarType;
168  typedef typename Superclass::ParametersType ParametersType;
169  typedef typename Superclass::NumberOfParametersType NumberOfParametersType;
170  typedef typename Superclass::JacobianType JacobianType;
171  typedef typename Superclass::OffsetType OffsetType;
172  typedef typename Superclass::InputPointType InputPointType;
173  typedef typename Superclass::OutputPointType OutputPointType;
174  typedef typename Superclass::InputVectorType InputVectorType;
175  typedef typename Superclass::OutputVectorType OutputVectorType;
176  typedef typename Superclass::InputCovariantVectorType InputCovariantVectorType;
177  typedef typename Superclass::OutputCovariantVectorType OutputCovariantVectorType;
178  typedef typename Superclass::InputVnlVectorType InputVnlVectorType;
179  typedef typename Superclass::OutputVnlVectorType OutputVnlVectorType;
180 
181  typedef typename Superclass
182  ::NonZeroJacobianIndicesType NonZeroJacobianIndicesType;
183  typedef typename Superclass::SpatialJacobianType SpatialJacobianType;
184  typedef typename Superclass
185  ::JacobianOfSpatialJacobianType JacobianOfSpatialJacobianType;
186  typedef typename Superclass::SpatialHessianType SpatialHessianType;
187  typedef typename Superclass
188  ::JacobianOfSpatialHessianType JacobianOfSpatialHessianType;
189  typedef typename Superclass::InternalMatrixType InternalMatrixType;
190 
194  void SetComputeZYX( const bool ) // No override.
195  {
196  static_assert(SpaceDimension != 3, "This is not the specialization is 3D!");
197  }
198 
199 
203  bool GetComputeZYX( void ) const // No override.
204  {
205  static_assert(SpaceDimension != 3, "This is not the specialization is 3D!");
206  return false;
207  }
208 
209 
210 protected:
211 
213  ~EulerTransform() override{}
214 
215 private:
216 
217  EulerTransform( const Self & ); // purposely not implemented
218  void operator=( const Self & ); // purposely not implemented
219 
220 };
221 
222 template< class TScalarType >
223 class EulerTransform<TScalarType, 3> :
224  public EulerGroupTemplate<
225  TScalarType, 3 >::EulerTransform_tmp
226 {
227 public:
228 
231  typedef typename EulerGroupTemplate<
232  TScalarType, 3 >
233  ::EulerTransform_tmp Superclass;
234  typedef SmartPointer< Self > Pointer;
235  typedef SmartPointer< const Self > ConstPointer;
236 
238  itkNewMacro( Self );
239 
241  itkTypeMacro( EulerTransform, EulerGroupTemplate );
242 
244  itkStaticConstMacro( SpaceDimension, unsigned int, 3 );
245 
246 
251  void SetComputeZYX( const bool arg ) override
252  {
253  static_assert(SpaceDimension == 3, "This specialization is for 3D only!");
254 
255  typedef AdvancedEuler3DTransform< TScalarType > Euler3DTransformType;
256  typename Euler3DTransformType::Pointer transform
257  = dynamic_cast< Euler3DTransformType * >( this );
258  if( transform )
259  {
260  transform->Euler3DTransformType::SetComputeZYX( arg );
261  }
262  }
263 
264 
269  bool GetComputeZYX( void ) const override
270  {
271  static_assert(SpaceDimension == 3, "This specialization is for 3D only!");
272 
273  typedef AdvancedEuler3DTransform< TScalarType > Euler3DTransformType;
274  typename Euler3DTransformType::ConstPointer transform
275  = dynamic_cast< const Euler3DTransformType * >( this );
276 
277  if( transform )
278  {
279  return transform->Euler3DTransformType::GetComputeZYX();
280  }
281  return false;
282  }
283 
284 
285 protected:
286 
288  ~EulerTransform() override{}
289 
290 private:
291 
292  EulerTransform( const Self & ); // purposely not implemented
293  void operator=( const Self & ); // purposely not implemented
294 
295 };
296 
297 } // end namespace itk
298 
299 #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
bool GetComputeZYX(void) const override
EulerGroupTemplate< TScalarType, 3 >::EulerTransform_tmp Superclass
This class combines the Euler2DTransform with the Euler3DTransform.
Superclass ::JacobianOfSpatialJacobianType JacobianOfSpatialJacobianType
Superclass::InputPointType InputPointType
bool GetComputeZYX(void) const
Superclass::ParametersType ParametersType
Superclass::SpatialHessianType SpatialHessianType
Superclass::InputCovariantVectorType InputCovariantVectorType
Superclass::OutputVnlVectorType OutputVnlVectorType
Superclass::SpatialJacobianType SpatialJacobianType
Superclass::OffsetType OffsetType
void operator=(const Self &)
Superclass ::JacobianOfSpatialHessianType JacobianOfSpatialHessianType
EulerGroupTemplate< TScalarType, Dimension >::EulerTransform_tmp Superclass
itkStaticConstMacro(SpaceDimension, unsigned int, Dimension)
Superclass::ScalarType ScalarType
Superclass::InputVnlVectorType InputVnlVectorType
Superclass::JacobianType JacobianType
Superclass::OutputCovariantVectorType OutputCovariantVectorType
Superclass::OutputPointType OutputPointType
Superclass::OutputVectorType OutputVectorType
EulerTransform(const Self &)
SmartPointer< Self > Pointer
void SetComputeZYX(const bool)
Superclass::InputVectorType InputVectorType
Superclass::NumberOfParametersType NumberOfParametersType
SmartPointer< const Self > ConstPointer
Superclass::InternalMatrixType InternalMatrixType
Superclass ::NonZeroJacobianIndicesType NonZeroJacobianIndicesType


Generated on 1652341256 for elastix by doxygen 1.9.1 elastix logo