ITK  5.2.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  * 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 : public Rigid3DTransform<TParametersValueType>
49 {
50 public:
51  ITK_DISALLOW_COPY_AND_MOVE(QuaternionRigidTransform);
52 
58 
60  itkNewMacro(Self);
61 
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 ParametersType = typename Superclass::ParametersType;
73  using ParametersValueType = typename Superclass::ParametersValueType;
74  using FixedParametersType = typename Superclass::FixedParametersType;
75  using FixedParametersValueType = typename Superclass::FixedParametersValueType;
76  using JacobianType = typename Superclass::JacobianType;
77  using JacobianPositionType = typename Superclass::JacobianPositionType;
78  using InverseJacobianPositionType = typename Superclass::InverseJacobianPositionType;
79  using ScalarType = typename Superclass::ScalarType;
80  using InputPointType = typename Superclass::InputPointType;
81  using OutputPointType = typename Superclass::OutputPointType;
82  using InputVectorType = typename Superclass::InputVectorType;
83  using OutputVectorType = typename Superclass::OutputVectorType;
84  using OutputVectorValueType = typename Superclass::OutputVectorValueType;
85  using InputVnlVectorType = typename Superclass::InputVnlVectorType;
86  using OutputVnlVectorType = typename Superclass::OutputVnlVectorType;
87  using InputCovariantVectorType = typename Superclass::InputCovariantVectorType;
88  using OutputCovariantVectorType = typename Superclass::OutputCovariantVectorType;
89  using MatrixType = typename Superclass::MatrixType;
90  using InverseMatrixType = typename Superclass::InverseMatrixType;
91  using CenterType = typename Superclass::CenterType;
92  using OffsetType = typename Superclass::OffsetType;
93  using TranslationType = 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:
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::QuaternionRigidTransform::FixedParametersType
typename Superclass::FixedParametersType FixedParametersType
Definition: itkQuaternionRigidTransform.h:74
itk::QuaternionRigidTransform::FixedParametersValueType
typename Superclass::FixedParametersValueType FixedParametersValueType
Definition: itkQuaternionRigidTransform.h:75
itk::QuaternionRigidTransform::m_Rotation
VnlQuaternionType m_Rotation
Definition: itkQuaternionRigidTransform.h:164
itk::QuaternionRigidTransform::InputVectorType
typename Superclass::InputVectorType InputVectorType
Definition: itkQuaternionRigidTransform.h:82
itk::QuaternionRigidTransform::ScalarType
typename Superclass::ScalarType ScalarType
Definition: itkQuaternionRigidTransform.h:79
itk::QuaternionRigidTransform::ParametersValueType
typename Superclass::ParametersValueType ParametersValueType
Definition: itkQuaternionRigidTransform.h:73
itk::QuaternionRigidTransform::CenterType
typename Superclass::CenterType CenterType
Definition: itkQuaternionRigidTransform.h:91
itk::QuaternionRigidTransform::OutputVectorType
typename Superclass::OutputVectorType OutputVectorType
Definition: itkQuaternionRigidTransform.h:83
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::QuaternionRigidTransform::OutputCovariantVectorType
typename Superclass::OutputCovariantVectorType OutputCovariantVectorType
Definition: itkQuaternionRigidTransform.h:88
itk::QuaternionRigidTransform::SetVarRotation
void SetVarRotation(const VnlQuaternionType &rotation)
Definition: itkQuaternionRigidTransform.h:151
itk::QuaternionRigidTransform::OutputPointType
typename Superclass::OutputPointType OutputPointType
Definition: itkQuaternionRigidTransform.h:81
itk::QuaternionRigidTransform::InverseJacobianPositionType
typename Superclass::InverseJacobianPositionType InverseJacobianPositionType
Definition: itkQuaternionRigidTransform.h:78
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::QuaternionRigidTransform::MatrixType
typename Superclass::MatrixType MatrixType
Definition: itkQuaternionRigidTransform.h:89
itkRigid3DTransform.h
itk::QuaternionRigidTransform::JacobianType
typename Superclass::JacobianType JacobianType
Definition: itkQuaternionRigidTransform.h:76
itk::QuaternionRigidTransform::JacobianPositionType
typename Superclass::JacobianPositionType JacobianPositionType
Definition: itkQuaternionRigidTransform.h:77
itk::QuaternionRigidTransform::OffsetType
typename Superclass::OffsetType OffsetType
Definition: itkQuaternionRigidTransform.h:92
itk::QuaternionRigidTransform::OutputVectorValueType
typename Superclass::OutputVectorValueType OutputVectorValueType
Definition: itkQuaternionRigidTransform.h:84
itk::QuaternionRigidTransform::InputVnlVectorType
typename Superclass::InputVnlVectorType InputVnlVectorType
Definition: itkQuaternionRigidTransform.h:85
itk::QuaternionRigidTransform::InputPointType
typename Superclass::InputPointType InputPointType
Definition: itkQuaternionRigidTransform.h:80
itk::QuaternionRigidTransform::TranslationType
typename Superclass::TranslationType TranslationType
Definition: itkQuaternionRigidTransform.h:93
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::QuaternionRigidTransform::InverseMatrixType
typename Superclass::InverseMatrixType InverseMatrixType
Definition: itkQuaternionRigidTransform.h:90
itk::QuaternionRigidTransform::OutputVnlVectorType
typename Superclass::OutputVnlVectorType OutputVnlVectorType
Definition: itkQuaternionRigidTransform.h:86
itk::QuaternionRigidTransform::InputCovariantVectorType
typename Superclass::InputCovariantVectorType InputCovariantVectorType
Definition: itkQuaternionRigidTransform.h:87
itk::QuaternionRigidTransform::VnlQuaternionType
vnl_quaternion< TParametersValueType > VnlQuaternionType
Definition: itkQuaternionRigidTransform.h:96
itk::QuaternionRigidTransform::ParametersType
typename Superclass::ParametersType ParametersType
Definition: itkQuaternionRigidTransform.h:72
itk::QuaternionRigidTransform
QuaternionRigidTransform of a vector space (e.g. space coordinates).
Definition: itkQuaternionRigidTransform.h:48