ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkQuaternionRigidTransform.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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 itkQuaternionRigidTransform_h
19 #define itkQuaternionRigidTransform_h
20 
21 #include <iostream>
22 #include "itkRigid3DTransform.h"
23 #include "vnl/vnl_quaternion.h"
24 
25 namespace itk
26 {
47 template<typename TParametersValueType=double>
48 class ITK_TEMPLATE_EXPORT QuaternionRigidTransform :
49  public Rigid3DTransform<TParametersValueType>
50 {
51 public:
57 
59  itkNewMacro(Self);
60 
63 
65  itkStaticConstMacro(InputSpaceDimension, unsigned int, 3);
66  itkStaticConstMacro(OutputSpaceDimension, unsigned int, 3);
67  itkStaticConstMacro(SpaceDimension, unsigned int, 3);
68  itkStaticConstMacro(ParametersDimension, unsigned int, 7);
70 
72  typedef typename Superclass::ParametersType ParametersType;
73  typedef typename Superclass::ParametersValueType ParametersValueType;
74  typedef typename Superclass::FixedParametersType FixedParametersType;
75  typedef typename Superclass::FixedParametersValueType FixedParametersValueType;
76  typedef typename Superclass::JacobianType JacobianType;
77  typedef typename Superclass::ScalarType ScalarType;
78  typedef typename Superclass::InputPointType InputPointType;
79  typedef typename Superclass::OutputPointType OutputPointType;
80  typedef typename Superclass::InputVectorType InputVectorType;
81  typedef typename Superclass::OutputVectorType OutputVectorType;
82  typedef typename Superclass::OutputVectorValueType OutputVectorValueType;
83  typedef typename Superclass::InputVnlVectorType InputVnlVectorType;
84  typedef typename Superclass::OutputVnlVectorType OutputVnlVectorType;
85  typedef typename Superclass::InputCovariantVectorType InputCovariantVectorType;
86  typedef typename Superclass::OutputCovariantVectorType OutputCovariantVectorType;
87  typedef typename Superclass::MatrixType MatrixType;
88  typedef typename Superclass::InverseMatrixType InverseMatrixType;
89  typedef typename Superclass::CenterType CenterType;
90  typedef typename Superclass::OffsetType OffsetType;
91  typedef typename Superclass::TranslationType TranslationType;
92 
94  typedef vnl_quaternion<TParametersValueType> VnlQuaternionType;
95 
101  void SetRotation(const VnlQuaternionType & rotation);
102 
106  const VnlQuaternionType & GetRotation(void) const
107  {
108  return m_Rotation;
109  }
110 
112  virtual void SetIdentity(void) ITK_OVERRIDE;
113 
119  void SetParameters(const ParametersType & parameters) ITK_OVERRIDE;
120 
121  virtual const ParametersType & GetParameters() const ITK_OVERRIDE;
122 
128  virtual void ComputeJacobianWithRespectToParameters( const InputPointType & p, JacobianType & jacobian) const ITK_OVERRIDE;
129 
130 protected:
131  QuaternionRigidTransform(const MatrixType & matrix, const OutputVectorType & offset);
132  QuaternionRigidTransform(unsigned int paramDims);
134  ~QuaternionRigidTransform() ITK_OVERRIDE {}
135 
136  void ComputeMatrix() ITK_OVERRIDE;
137 
138  void ComputeMatrixParameters() ITK_OVERRIDE;
139 
140  void SetVarRotation(const VnlQuaternionType & rotation)
141  {
142  m_Rotation = rotation;
143  }
144 
145  const InverseMatrixType & GetInverseMatrix() const;
146 
147  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
148 
149 private:
150  ITK_DISALLOW_COPY_AND_ASSIGN(QuaternionRigidTransform);
151 
154 }; // class QuaternionRigidTransform
155 } // namespace itk
156 
157 #ifndef ITK_MANUAL_INSTANTIATION
158 #include "itkQuaternionRigidTransform.hxx"
159 #endif
160 
161 #endif /* itkQuaternionRigidTransform_h */
Superclass::ParametersType ParametersType
Light weight base class for most itk classes.
Rigid3DTransform of a vector space (e.g. space coordinates)
Superclass::InputVectorType InputVectorType
Superclass::OutputVectorValueType OutputVectorValueType
Superclass::FixedParametersType FixedParametersType
Superclass::InputCovariantVectorType InputCovariantVectorType
Superclass::OutputVnlVectorType OutputVnlVectorType
Superclass::InputVnlVectorType InputVnlVectorType
vnl_quaternion< TParametersValueType > VnlQuaternionType
Superclass::OutputPointType OutputPointType
Superclass::TranslationType TranslationType
Superclass::OutputCovariantVectorType OutputCovariantVectorType
Superclass::InverseMatrixType InverseMatrixType
QuaternionRigidTransform of a vector space (e.g. space coordinates).
SmartPointer< const Self > ConstPointer
Superclass::OutputVectorType OutputVectorType
Superclass::ParametersValueType ParametersValueType
Superclass::InputPointType InputPointType
const VnlQuaternionType & GetRotation(void) const
Superclass::FixedParametersValueType FixedParametersValueType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Rigid3DTransform< TParametersValueType > Superclass