ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkVersorTransform.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 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_ASSIGN(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 SetParameters(const ParametersType & parameters) override;
109 
111  const ParametersType & GetParameters() const override;
112 
114  void SetRotation(const VersorType & versor);
115 
116  void SetRotation(const AxisType & axis, AngleType angle);
117 
118  itkGetConstReferenceMacro(Versor, VersorType);
119 
121  void SetIdentity() override;
122 
128  void ComputeJacobianWithRespectToParameters( const InputPointType & p, JacobianType & jacobian) const override;
129 
130 protected:
131 
133  VersorTransform(const MatrixType & matrix, const OutputVectorType & offset);
134  VersorTransform(unsigned int paramDims);
135  VersorTransform();
137 
139  ~VersorTransform() override = default;
140 
141  void SetVarVersor(const VersorType & newVersor)
142  {
143  m_Versor = newVersor;
144  }
145 
147  void PrintSelf(std::ostream & os, Indent indent) const override;
148 
151  void ComputeMatrix() override;
152 
153  void ComputeMatrixParameters() override;
154 
155 private:
158 }; // class VersorTransform
159 } // namespace itk
160 
161 #ifndef ITK_MANUAL_INSTANTIATION
162 #include "itkVersorTransform.hxx"
163 #endif
164 
165 #endif /* itkVersorTransform_h */
typename Superclass::FixedParametersType FixedParametersType
typename Superclass::OutputCovariantVectorType OutputCovariantVectorType
Light weight base class for most itk classes.
typename Superclass::MatrixType MatrixType
typename Superclass::JacobianType JacobianType
typename Superclass::InputCovariantVectorType InputCovariantVectorType
Rigid3DTransform of a vector space (e.g. space coordinates)
typename Superclass::OutputVnlVectorType OutputVnlVectorType
typename Superclass::ParametersType ParametersType
TParametersValueType ValueType
Definition: itkVersor.h:58
void SetVarVersor(const VersorType &newVersor)
typename VersorType::ValueType AngleType
typename Superclass::OutputVectorType OutputVectorType
typename Superclass::InverseMatrixType InverseMatrixType
typename AxisType::ValueType AxisValueType
typename Superclass::InputVnlVectorType InputVnlVectorType
typename Superclass::CenterType CenterType
typename Superclass::OutputPointType OutputPointType
typename Superclass::InputPointType InputPointType
typename Superclass::InputVectorType InputVectorType
vnl_quaternion< TParametersValueType > VnlQuaternionType
typename Superclass::JacobianPositionType JacobianPositionType
typename VersorType::VectorType AxisType
typename Superclass::ParametersValueType ParametersValueType
typename Superclass::OffsetType OffsetType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
typename Superclass::InverseJacobianPositionType InverseJacobianPositionType
typename Superclass::ScalarType ScalarType