ITK  5.0.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:
52  ITK_DISALLOW_COPY_AND_ASSIGN(QuaternionRigidTransform);
53 
59 
61  itkNewMacro(Self);
62 
65 
67  static constexpr unsigned int InputSpaceDimension = 3;
68  static constexpr unsigned int OutputSpaceDimension = 3;
69  static constexpr unsigned int SpaceDimension = 3;
70  static constexpr unsigned int ParametersDimension = 7;
71 
73  using ParametersType = typename Superclass::ParametersType;
74  using ParametersValueType = typename Superclass::ParametersValueType;
75  using FixedParametersType = typename Superclass::FixedParametersType;
76  using FixedParametersValueType = typename Superclass::FixedParametersValueType;
77  using JacobianType = typename Superclass::JacobianType;
78  using JacobianPositionType = typename Superclass::JacobianPositionType;
79  using InverseJacobianPositionType = typename Superclass::InverseJacobianPositionType;
80  using ScalarType = typename Superclass::ScalarType;
81  using InputPointType = typename Superclass::InputPointType;
82  using OutputPointType = typename Superclass::OutputPointType;
83  using InputVectorType = typename Superclass::InputVectorType;
84  using OutputVectorType = typename Superclass::OutputVectorType;
85  using OutputVectorValueType = typename Superclass::OutputVectorValueType;
86  using InputVnlVectorType = typename Superclass::InputVnlVectorType;
87  using OutputVnlVectorType = typename Superclass::OutputVnlVectorType;
88  using InputCovariantVectorType = typename Superclass::InputCovariantVectorType;
89  using OutputCovariantVectorType = typename Superclass::OutputCovariantVectorType;
90  using MatrixType = typename Superclass::MatrixType;
91  using InverseMatrixType = typename Superclass::InverseMatrixType;
92  using CenterType = typename Superclass::CenterType;
93  using OffsetType = typename Superclass::OffsetType;
94  using TranslationType = typename Superclass::TranslationType;
95 
97  using VnlQuaternionType = vnl_quaternion<TParametersValueType>;
98 
104  void SetRotation(const VnlQuaternionType & rotation);
105 
110  {
111  return m_Rotation;
112  }
113 
115  void SetIdentity() override;
116 
122  void SetParameters(const ParametersType & parameters) override;
123 
124  const ParametersType & GetParameters() const override;
125 
131  void ComputeJacobianWithRespectToParameters( const InputPointType & p, JacobianType & jacobian) const override;
132 
133 protected:
134  QuaternionRigidTransform(const MatrixType & matrix, const OutputVectorType & offset);
135  QuaternionRigidTransform(unsigned int paramDims);
137  ~QuaternionRigidTransform() override = default;
138 
139  void ComputeMatrix() override;
140 
141  void ComputeMatrixParameters() override;
142 
143  void SetVarRotation(const VnlQuaternionType & rotation)
144  {
145  m_Rotation = rotation;
146  }
147 
148  const InverseMatrixType & GetInverseMatrix() const;
149 
150  void PrintSelf(std::ostream & os, Indent indent) const override;
151 
152 private:
155 }; // class QuaternionRigidTransform
156 } // namespace itk
157 
158 #ifndef ITK_MANUAL_INSTANTIATION
159 #include "itkQuaternionRigidTransform.hxx"
160 #endif
161 
162 #endif /* itkQuaternionRigidTransform_h */
typename Superclass::MatrixType MatrixType
Light weight base class for most itk classes.
typename Superclass::InputCovariantVectorType InputCovariantVectorType
typename Superclass::ParametersValueType ParametersValueType
typename Superclass::OutputCovariantVectorType OutputCovariantVectorType
Rigid3DTransform of a vector space (e.g. space coordinates)
const VnlQuaternionType & GetRotation() const
typename Superclass::OutputVectorType OutputVectorType
typename Superclass::FixedParametersValueType FixedParametersValueType
typename Superclass::OutputPointType OutputPointType
typename Superclass::InverseMatrixType InverseMatrixType
typename Superclass::JacobianType JacobianType
QuaternionRigidTransform of a vector space (e.g. space coordinates).
typename Superclass::OutputVectorValueType OutputVectorValueType
typename Superclass::InputPointType InputPointType
typename Superclass::InputVnlVectorType InputVnlVectorType
typename Superclass::OutputVnlVectorType OutputVnlVectorType
void SetVarRotation(const VnlQuaternionType &rotation)
typename Superclass::OffsetType OffsetType
typename Superclass::CenterType CenterType
typename Superclass::ParametersType ParametersType
typename Superclass::TranslationType TranslationType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
typename Superclass::InputVectorType InputVectorType
vnl_quaternion< TParametersValueType > VnlQuaternionType
typename Superclass::FixedParametersType FixedParametersType
typename Superclass::JacobianPositionType JacobianPositionType
typename Superclass::InverseJacobianPositionType InverseJacobianPositionType
typename Superclass::ScalarType ScalarType