ITK  5.4.0
Insight Toolkit
itkQuaternionRigidTransform.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
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  * https://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 : public Rigid3DTransform<TParametersValueType>
49 {
50 public:
51  ITK_DISALLOW_COPY_AND_MOVE(QuaternionRigidTransform);
52 
58 
60  itkNewMacro(Self);
61 
63  itkOverrideGetNameOfClassMacro(QuaternionRigidTransform);
64 
66  static constexpr unsigned int InputSpaceDimension = 3;
67  static constexpr unsigned int OutputSpaceDimension = 3;
68  static constexpr unsigned int SpaceDimension = 3;
69  static constexpr unsigned int ParametersDimension = 7;
70 
72  using typename Superclass::ParametersType;
73  using typename Superclass::ParametersValueType;
74  using typename Superclass::FixedParametersType;
75  using typename Superclass::FixedParametersValueType;
76  using typename Superclass::JacobianType;
77  using typename Superclass::JacobianPositionType;
78  using typename Superclass::InverseJacobianPositionType;
79  using typename Superclass::ScalarType;
80  using typename Superclass::InputPointType;
81  using typename Superclass::OutputPointType;
82  using typename Superclass::InputVectorType;
83  using typename Superclass::OutputVectorType;
84  using typename Superclass::OutputVectorValueType;
85  using typename Superclass::InputVnlVectorType;
86  using typename Superclass::OutputVnlVectorType;
87  using typename Superclass::InputCovariantVectorType;
88  using typename Superclass::OutputCovariantVectorType;
89  using typename Superclass::MatrixType;
90  using typename Superclass::InverseMatrixType;
91  using typename Superclass::CenterType;
92  using typename Superclass::OffsetType;
93  using typename Superclass::TranslationType;
94 
96  using VnlQuaternionType = vnl_quaternion<TParametersValueType>;
97 
103  void
104  SetRotation(const VnlQuaternionType & rotation);
105 
109  const VnlQuaternionType &
110  GetRotation() const
111  {
112  return m_Rotation;
113  }
114 
116  void
117  SetIdentity() override;
118 
124  void
125  SetParameters(const ParametersType & parameters) override;
126 
127  const ParametersType &
128  GetParameters() const override;
129 
135  void
136  ComputeJacobianWithRespectToParameters(const InputPointType & p, JacobianType & jacobian) const override;
137 
138 protected:
139  QuaternionRigidTransform(const MatrixType & matrix, const OutputVectorType & offset);
140  QuaternionRigidTransform(unsigned int parametersDimension);
142  ~QuaternionRigidTransform() override = default;
143 
144  void
145  ComputeMatrix() override;
146 
147  void
148  ComputeMatrixParameters() override;
149 
150  void
152  {
153  m_Rotation = rotation;
154  }
155 
156  const InverseMatrixType &
157  GetInverseMatrix() const;
158 
159  void
160  PrintSelf(std::ostream & os, Indent indent) const override;
161 
162 private:
164  VnlQuaternionType m_Rotation{};
165 }; // class QuaternionRigidTransform
166 } // namespace itk
167 
168 #ifndef ITK_MANUAL_INSTANTIATION
169 # include "itkQuaternionRigidTransform.hxx"
170 #endif
171 
172 #endif /* itkQuaternionRigidTransform_h */
itk::Rigid3DTransform
Rigid3DTransform of a vector space (e.g. space coordinates)
Definition: itkRigid3DTransform.h:57
itk::QuaternionRigidTransform::GetRotation
const VnlQuaternionType & GetRotation() const
Definition: itkQuaternionRigidTransform.h:110
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::QuaternionRigidTransform::SetVarRotation
void SetVarRotation(const VnlQuaternionType &rotation)
Definition: itkQuaternionRigidTransform.h:151
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itkRigid3DTransform.h
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::QuaternionRigidTransform::VnlQuaternionType
vnl_quaternion< TParametersValueType > VnlQuaternionType
Definition: itkQuaternionRigidTransform.h:96
itk::QuaternionRigidTransform
QuaternionRigidTransform of a vector space (e.g. space coordinates).
Definition: itkQuaternionRigidTransform.h:48