ITK  6.0.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  * 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 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  itkOverrideGetNameOfClassMacro(VersorTransform);
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 typename Superclass::ScalarType;
72  using typename Superclass::ParametersType;
73  using typename Superclass::FixedParametersType;
74  using typename Superclass::JacobianType;
75  using typename Superclass::JacobianPositionType;
77  using typename Superclass::InputPointType;
78  using typename Superclass::OutputPointType;
79  using typename Superclass::InputVectorType;
80  using typename Superclass::OutputVectorType;
81  using typename Superclass::InputVnlVectorType;
82  using typename Superclass::OutputVnlVectorType;
85  using typename Superclass::MatrixType;
86  using typename Superclass::InverseMatrixType;
87  using typename Superclass::CenterType;
88  using 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 #if !defined(ITK_LEGACY_REMOVE)
139  [[deprecated("Removed unused constructor")]] VersorTransform(const MatrixType & matrix,
140  const OutputVectorType & offset);
141 #endif
142  VersorTransform(unsigned int parametersDimension);
143  VersorTransform();
147  ~VersorTransform() override = default;
148 
149  void
150  SetVarVersor(const VersorType & newVersor)
151  {
152  m_Versor = newVersor;
153  }
154 
156  void
157  PrintSelf(std::ostream & os, Indent indent) const override;
158 
161  void
162  ComputeMatrix() override;
163 
164  void
165  ComputeMatrixParameters() override;
166 
167 private:
169  VersorType m_Versor{};
170 }; // class VersorTransform
171 } // namespace itk
172 
173 #ifndef ITK_MANUAL_INSTANTIATION
174 # include "itkVersorTransform.hxx"
175 #endif
176 
177 #endif /* itkVersorTransform_h */
itk::MatrixOffsetTransformBase< TParametersValueType, 3, 3 >::OutputVnlVectorType
vnl_vector_fixed< TParametersValueType, Self::OutputSpaceDimension > OutputVnlVectorType
Definition: itkMatrixOffsetTransformBase.h:171
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:150
itk::GTest::TypedefsAndConstructors::Dimension2::VectorType
ImageBaseType::SpacingType VectorType
Definition: itkGTestTypedefsAndConstructors.h:53
itk::Vector< TParametersValueType, Self::InputSpaceDimension >
itk::MatrixOffsetTransformBase< TParametersValueType, 3, 3 >
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::MatrixOffsetTransformBase< TParametersValueType, 3, 3 >::InverseJacobianPositionType
vnl_matrix_fixed< ParametersValueType, VInputDimension, VOutputDimension > InverseJacobianPositionType
Definition: itkTransform.h:132
itk::Versor< TParametersValueType >
itk::MatrixOffsetTransformBase< TParametersValueType, 3, 3 >::ScalarType
ParametersValueType ScalarType
Definition: itkTransform.h:127
itk::VersorTransform::AxisValueType
typename AxisType::ValueType AxisValueType
Definition: itkVersorTransform.h:97
itk::MatrixOffsetTransformBase< TParametersValueType, 3, 3 >::JacobianPositionType
vnl_matrix_fixed< ParametersValueType, VOutputDimension, VInputDimension > JacobianPositionType
Definition: itkTransform.h:131
itk::VersorTransform::VnlQuaternionType
vnl_quaternion< TParametersValueType > VnlQuaternionType
Definition: itkVersorTransform.h:91
itk::MatrixOffsetTransformBase< TParametersValueType, 3, 3 >::InputVnlVectorType
vnl_vector_fixed< TParametersValueType, Self::InputSpaceDimension > InputVnlVectorType
Definition: itkMatrixOffsetTransformBase.h:170
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:60
itk::VersorTransform::AxisType
typename VersorType::VectorType AxisType
Definition: itkVersorTransform.h:95
itk::Matrix< TParametersValueType, Self::OutputSpaceDimension, Self::InputSpaceDimension >
itk::CovariantVector
A templated class holding a n-Dimensional covariant vector.
Definition: itkCovariantVector.h:70
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::Point< TParametersValueType, Self::InputSpaceDimension >
itk::Array2D
Array2D class representing a 2D array.
Definition: itkArray2D.h:42
itk::VersorTransform::ParametersValueType
typename ParametersType::ValueType ParametersValueType
Definition: itkVersorTransform.h:98