KWStyle - itkEuler3DTransform.h
 
Matrix View
Description

1 /*=========================================================================
2
3   Program:   Insight Segmentation & Registration Toolkit
4   Module:    $RCSfile: itkEuler3DTransform.h.html,v $
5   Language:  C++
6   Date:      $Date: 2006/01/17 19:15:35 $
7   Version:   $Revision: 1.4 $
8
9   Copyright (c) Insight Software Consortium. All rights reserved.
10   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
11
12      This software is distributed WITHOUT ANY WARRANTY; without even 
13      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
14      PURPOSE.  See the above copyright notices for more information.
15
16 =========================================================================*/
17 #ifndef __itkEuler3DTransform_h
18 #define __itkEuler3DTransform_h
19
20 #include <iostream>
21 #include "itkRigid3DTransform.h"
22
23 namespace itk
24 {
25
26 /** \brief Euler3DTransform of a vector space (e.g. space coordinates)
27  *
28  * This transform applies a rotation and translation to the space given 3 euler
29  * angles and a 3D offset.
30  *
31  * \ingroup Transforms
32  */
33 LEN template < class TScalarType=double >    // Data type for scalars (float or double)
34 MCM class ITK_EXPORT Euler3DTransform : 
35 IND ************public Rigid3DTransform< TScalarType > 
36 {
37 public:
38   /** Standard class typedefs. */
39   typedef Euler3DTransform                  Self;
40   typedef Rigid3DTransform< TScalarType >   Superclass;
41   typedef SmartPointer<Self>                Pointer;
42   typedef SmartPointer<const Self>          ConstPointer;
43     
44   /** New macro for creation of through a Smart Pointer. */
45   itkNewMacro( Self );
46
47   /** Run-time type information (and related methods). */
48   itkTypeMacro( Euler3DTransform, Rigid3DTransform );
49
50   /** Dimension of the space. */
51   itkStaticConstMacro(SpaceDimension, unsigned int, 3);
52   itkStaticConstMacro(InputSpaceDimension, unsigned int, 3);
53   itkStaticConstMacro(OutputSpaceDimension, unsigned int, 3);
54   itkStaticConstMacro(ParametersDimension, unsigned int, 6);
55
56   typedef typename Superclass::ParametersType             ParametersType;
57   typedef typename Superclass::JacobianType               JacobianType;
58   typedef typename Superclass::ScalarType                 ScalarType;
59   typedef typename Superclass::InputVectorType            InputVectorType;
60   typedef typename Superclass::OutputVectorType           OutputVectorType;
61   typedef typename Superclass::InputCovariantVectorType  
62 TDA,IND *****************************************************InputCovariantVectorType;
63   typedef typename Superclass::OutputCovariantVectorType  
64 TDA,IND *****************************************************OutputCovariantVectorType;
65   typedef typename Superclass::InputVnlVectorType         InputVnlVectorType;
66   typedef typename Superclass::OutputVnlVectorType        OutputVnlVectorType;
67   typedef typename Superclass::InputPointType             InputPointType;
68   typedef typename Superclass::OutputPointType            OutputPointType;
69   typedef typename Superclass::MatrixType                 MatrixType;
70   typedef typename Superclass::InverseMatrixType          InverseMatrixType;
71   typedef typename Superclass::CenterType                 CenterType;
72   typedef typename Superclass::TranslationType            TranslationType;
73   typedef typename Superclass::OffsetType                 OffsetType;
74
75   typedef typename Superclass::ScalarType                 AngleType;
76   
77   /** Set/Get the transformation from a container of parameters
78    * This is typically used by optimizers.  There are 6 parameters. The first
79    * three represent the angles to rotate around the coordinate axis, and the
80    * last three represents the offset. */
81   void SetParameters( const ParametersType & parameters );
82   const ParametersType& GetParameters(void) const;
83
84   /** Set the rotational part of the transform. */
85   void SetRotation(ScalarType angleX,ScalarType angleY,ScalarType angleZ);
86   itkGetConstMacro(AngleX, ScalarType);
87   itkGetConstMacro(AngleY, ScalarType);
88   itkGetConstMacro(AngleZ, ScalarType);
89
90   /** This method computes the Jacobian matrix of the transformation.
91    * given point or vector, returning the transformed point or
92    * vector. The rank of the Jacobian will also indicate if the 
93    * transform is invertible at this point. */
94   const JacobianType & GetJacobian(const InputPointType  &point ) const;
95
96   /** Set/Get the order of the computation. Default ZXY */
97   itkSetMacro(ComputeZYX,bool);
98   itkGetConstMacro(ComputeZYX,bool);
99
100   virtual void SetIdentity(void);
101
102
103 protected:
104   Euler3DTransform();
105   Euler3DTransform(const MatrixType & matrix,
106                    const OutputPointType & offset);
107   Euler3DTransform(unsigned int outputSpaceDims,
108                    unsigned int paramsSpaceDims);
109
110   ~Euler3DTransform(){};
111
112   void PrintSelf(std::ostream &os, Indent indent) const;
113
114   void SetVarRotation(ScalarType angleX, ScalarType angleY, ScalarType angleZ)
115     { m_AngleX = angleX; m_AngleY = angleY; m_AngleZ = angleZ; };
116
117   /** Compute the components of the rotation matrix in the superclass. */
118   void ComputeMatrix(void);
119 IND *void ComputeMatrixParameters(void);
120
121 private:
122   Euler3DTransform(const Self&); //purposely not implemented
123   void operator=(const Self&); //purposely not implemented
124
125   ScalarType  m_AngleX; 
126   ScalarType  m_AngleY; 
127   ScalarType  m_AngleZ;
128   bool        m_ComputeZYX;
129
130 }; //class Euler3DTransform
131
132
133 }  // namespace itk
134
135
136 #ifndef ITK_MANUAL_INSTANTIATION
137 #include "itkEuler3DTransform.txx"
138 #endif
139
140 #endif /* __itkEuler3DTransform_h */
141

Generated by KWStyle 1.0b on Tuesday January,17 at 02:14:07PM
© Kitware Inc.