ITK  5.2.0
Insight Toolkit
itkVersorTransform.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 itkVersorTransform_h
19 #define itkVersorTransform_h
20 
21 #include <iostream>
22 #include "itkRigid3DTransform.h"
23 #include "vnl/vnl_quaternion.h"
24 
25 namespace itk
26 {
46 template <typename TParametersValueType = double>
47 class ITK_TEMPLATE_EXPORT VersorTransform : public Rigid3DTransform<TParametersValueType>
48 {
49 public:
50  ITK_DISALLOW_COPY_AND_MOVE(VersorTransform);
51 
57 
59  itkTypeMacro(VersorTransform, Rigid3DTransform);
60 
62  itkNewMacro(Self);
63 
65  static constexpr unsigned int SpaceDimension = 3;
66  static constexpr unsigned int InputSpaceDimension = 3;
67  static constexpr unsigned int OutputSpaceDimension = 3;
68  static constexpr unsigned int ParametersDimension = 3;
69 
71  using ScalarType = typename Superclass::ScalarType;
72  using ParametersType = typename Superclass::ParametersType;
73  using FixedParametersType = typename Superclass::FixedParametersType;
74  using JacobianType = typename Superclass::JacobianType;
75  using JacobianPositionType = typename Superclass::JacobianPositionType;
76  using InverseJacobianPositionType = typename Superclass::InverseJacobianPositionType;
77  using InputPointType = typename Superclass::InputPointType;
78  using OutputPointType = typename Superclass::OutputPointType;
79  using InputVectorType = typename Superclass::InputVectorType;
80  using OutputVectorType = typename Superclass::OutputVectorType;
81  using InputVnlVectorType = typename Superclass::InputVnlVectorType;
82  using OutputVnlVectorType = typename Superclass::OutputVnlVectorType;
83  using InputCovariantVectorType = typename Superclass::InputCovariantVectorType;
84  using OutputCovariantVectorType = typename Superclass::OutputCovariantVectorType;
85  using MatrixType = typename Superclass::MatrixType;
86  using InverseMatrixType = typename Superclass::InverseMatrixType;
87  using CenterType = typename Superclass::CenterType;
88  using OffsetType = typename Superclass::OffsetType;
89 
91  using VnlQuaternionType = vnl_quaternion<TParametersValueType>;
92 
95  using AxisType = typename VersorType::VectorType;
96  using AngleType = typename VersorType::ValueType;
97  using AxisValueType = typename AxisType::ValueType;
98  using ParametersValueType = typename ParametersType::ValueType;
99 
108  void
109  SetParameters(const ParametersType & parameters) override;
110 
112  const ParametersType &
113  GetParameters() const override;
114 
116  void
117  SetRotation(const VersorType & versor);
118 
119  void
120  SetRotation(const AxisType & axis, AngleType angle);
121 
122  itkGetConstReferenceMacro(Versor, VersorType);
123 
125  void
126  SetIdentity() override;
127 
133  void
134  ComputeJacobianWithRespectToParameters(const InputPointType & p, JacobianType & jacobian) const override;
135 
136 protected:
138  VersorTransform(const MatrixType & matrix, const OutputVectorType & offset);
139  VersorTransform(unsigned int parametersDimension);
140  VersorTransform();
142 
144  ~VersorTransform() override = default;
145 
146  void
147  SetVarVersor(const VersorType & newVersor)
148  {
149  m_Versor = newVersor;
150  }
151 
153  void
154  PrintSelf(std::ostream & os, Indent indent) const override;
155 
158  void
159  ComputeMatrix() override;
160 
161  void
162  ComputeMatrixParameters() override;
163 
164 private:
167 }; // class VersorTransform
168 } // namespace itk
169 
170 #ifndef ITK_MANUAL_INSTANTIATION
171 # include "itkVersorTransform.hxx"
172 #endif
173 
174 #endif /* itkVersorTransform_h */
itk::Rigid3DTransform::InputPointType
typename Superclass::InputPointType InputPointType
Definition: itkRigid3DTransform.h:95
itk::Rigid3DTransform
Rigid3DTransform of a vector space (e.g. space coordinates)
Definition: itkRigid3DTransform.h:57
itk::VersorTransform::SetVarVersor
void SetVarVersor(const VersorType &newVersor)
Definition: itkVersorTransform.h:147
itk::Rigid3DTransform::JacobianType
typename Superclass::JacobianType JacobianType
Definition: itkRigid3DTransform.h:84
itk::Rigid3DTransform::OffsetType
typename Superclass::OffsetType OffsetType
Definition: itkRigid3DTransform.h:102
itk::Rigid3DTransform::InputCovariantVectorType
typename Superclass::InputCovariantVectorType InputCovariantVectorType
Definition: itkRigid3DTransform.h:91
itk::GTest::TypedefsAndConstructors::Dimension2::VectorType
ImageBaseType::SpacingType VectorType
Definition: itkGTestTypedefsAndConstructors.h:53
itk::Rigid3DTransform::ParametersType
typename Superclass::ParametersType ParametersType
Definition: itkRigid3DTransform.h:80
itk::Rigid3DTransform::ParametersValueType
typename Superclass::ParametersValueType ParametersValueType
Definition: itkRigid3DTransform.h:81
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::Versor< TParametersValueType >
itk::Rigid3DTransform::OutputVectorType
typename Superclass::OutputVectorType OutputVectorType
Definition: itkRigid3DTransform.h:89
itk::VersorTransform::AxisValueType
typename AxisType::ValueType AxisValueType
Definition: itkVersorTransform.h:97
itk::Rigid3DTransform::FixedParametersType
typename Superclass::FixedParametersType FixedParametersType
Definition: itkRigid3DTransform.h:82
itk::VersorTransform::VnlQuaternionType
vnl_quaternion< TParametersValueType > VnlQuaternionType
Definition: itkVersorTransform.h:91
itk::Rigid3DTransform::CenterType
typename Superclass::CenterType CenterType
Definition: itkRigid3DTransform.h:100
itk::Rigid3DTransform::JacobianPositionType
typename Superclass::JacobianPositionType JacobianPositionType
Definition: itkRigid3DTransform.h:85
itk::Rigid3DTransform::MatrixType
typename Superclass::MatrixType MatrixType
Definition: itkRigid3DTransform.h:97
itk::Rigid3DTransform::InputVectorType
typename Superclass::InputVectorType InputVectorType
Definition: itkRigid3DTransform.h:88
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::VersorTransform
Definition: itkVersorTransform.h:47
itkRigid3DTransform.h
itk::VersorTransform::AngleType
typename VersorType::ValueType AngleType
Definition: itkVersorTransform.h:96
itk::Versor< TParametersValueType >::ValueType
TParametersValueType ValueType
Definition: itkVersor.h:58
itk::VersorTransform::AxisType
typename VersorType::VectorType AxisType
Definition: itkVersorTransform.h:95
itk::Rigid3DTransform::ScalarType
typename Superclass::ScalarType ScalarType
Definition: itkRigid3DTransform.h:87
itk::Rigid3DTransform::OutputVnlVectorType
typename Superclass::OutputVnlVectorType OutputVnlVectorType
Definition: itkRigid3DTransform.h:94
itk::Rigid3DTransform::OutputCovariantVectorType
typename Superclass::OutputCovariantVectorType OutputCovariantVectorType
Definition: itkRigid3DTransform.h:92
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::Rigid3DTransform::OutputPointType
typename Superclass::OutputPointType OutputPointType
Definition: itkRigid3DTransform.h:96
itk::Rigid3DTransform::InputVnlVectorType
typename Superclass::InputVnlVectorType InputVnlVectorType
Definition: itkRigid3DTransform.h:93
itk::Rigid3DTransform::InverseMatrixType
typename Superclass::InverseMatrixType InverseMatrixType
Definition: itkRigid3DTransform.h:98
itk::Rigid3DTransform::InverseJacobianPositionType
typename Superclass::InverseJacobianPositionType InverseJacobianPositionType
Definition: itkRigid3DTransform.h:86
itk::VersorTransform::m_Versor
VersorType m_Versor
Definition: itkVersorTransform.h:166