ITK  4.13.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:
55 
57  itkTypeMacro(VersorTransform, Rigid3DTransform);
58 
60  itkNewMacro(Self);
61 
63  itkStaticConstMacro(SpaceDimension, unsigned int, 3);
64  itkStaticConstMacro(InputSpaceDimension, unsigned int, 3);
65  itkStaticConstMacro(OutputSpaceDimension, unsigned int, 3);
66  itkStaticConstMacro(ParametersDimension, unsigned int, 3);
68 
70  typedef typename Superclass::ScalarType ScalarType;
71  typedef typename Superclass::ParametersType ParametersType;
72  typedef typename Superclass::FixedParametersType FixedParametersType;
73  typedef typename Superclass::JacobianType JacobianType;
74  typedef typename Superclass::InputPointType InputPointType;
75  typedef typename Superclass::OutputPointType OutputPointType;
76  typedef typename Superclass::InputVectorType InputVectorType;
77  typedef typename Superclass::OutputVectorType OutputVectorType;
78  typedef typename Superclass::InputVnlVectorType InputVnlVectorType;
79  typedef typename Superclass::OutputVnlVectorType OutputVnlVectorType;
80  typedef typename Superclass::InputCovariantVectorType InputCovariantVectorType;
81  typedef typename Superclass::OutputCovariantVectorType OutputCovariantVectorType;
82  typedef typename Superclass::MatrixType MatrixType;
83  typedef typename Superclass::InverseMatrixType InverseMatrixType;
84  typedef typename Superclass::CenterType CenterType;
85  typedef typename Superclass::OffsetType OffsetType;
86 
88  typedef vnl_quaternion<TParametersValueType> VnlQuaternionType;
89 
92  typedef typename VersorType::VectorType AxisType;
93  typedef typename VersorType::ValueType AngleType;
95  typedef typename ParametersType::ValueType ParametersValueType;
96 
105  void SetParameters(const ParametersType & parameters) ITK_OVERRIDE;
106 
108  const ParametersType & GetParameters(void) const ITK_OVERRIDE;
109 
111  void SetRotation(const VersorType & versor);
112 
113  void SetRotation(const AxisType & axis, AngleType angle);
114 
115  itkGetConstReferenceMacro(Versor, VersorType);
116 
118  virtual void SetIdentity(void) ITK_OVERRIDE;
119 
125  virtual void ComputeJacobianWithRespectToParameters( const InputPointType & p, JacobianType & jacobian) const ITK_OVERRIDE;
126 
127 protected:
128 
130  VersorTransform(const MatrixType & matrix, const OutputVectorType & offset);
131  VersorTransform(unsigned int paramDims);
132  VersorTransform();
134 
136  ~VersorTransform() ITK_OVERRIDE {}
137 
138 #ifdef ITKV3_COMPATIBILITY
139 
141  itkLegacyMacro( virtual void SetRotationMatrix(const MatrixType & matrix) ITK_OVERRIDE);
142 #endif
143 
144  void SetVarVersor(const VersorType & newVersor)
145  {
146  m_Versor = newVersor;
147  }
148 
150  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
151 
154  void ComputeMatrix(void) ITK_OVERRIDE;
155 
156  void ComputeMatrixParameters(void) ITK_OVERRIDE;
157 
158 private:
160  VersorTransform(const Self & other); // Not implemented
161 
163  const Self & operator=(const Self &); // Not implemented
164 
166  VersorType m_Versor;
167 }; // class VersorTransform
168 } // namespace itk
169 
170 #ifndef ITK_MANUAL_INSTANTIATION
171 #include "itkVersorTransform.hxx"
172 #endif
173 
174 #endif /* itkVersorTransform_h */
Superclass::OutputPointType OutputPointType
Light weight base class for most itk classes.
Rigid3DTransform of a vector space (e.g. space coordinates)
Versor< TParametersValueType > VersorType
Superclass::InputVnlVectorType InputVnlVectorType
Superclass::OffsetType OffsetType
void SetVarVersor(const VersorType &newVersor)
Superclass::MatrixType MatrixType
Superclass::OutputVectorType OutputVectorType
Superclass::OutputVectorType OutputVectorType
Superclass::InputCovariantVectorType InputCovariantVectorType
Superclass::OutputCovariantVectorType OutputCovariantVectorType
Superclass::InputPointType InputPointType
Superclass::ScalarType ScalarType
Superclass::OutputVnlVectorType OutputVnlVectorType
VersorType::VectorType AxisType
Superclass::CenterType CenterType
Superclass::InputVectorType InputVectorType
AxisType::ValueType AxisValueType
Superclass::MatrixType MatrixType
Superclass::JacobianType JacobianType
Superclass::InverseMatrixType InverseMatrixType
Superclass::FixedParametersType FixedParametersType
VersorType::ValueType AngleType
ParametersType::ValueType ParametersValueType
Superclass::ParametersType ParametersType
Superclass::JacobianType JacobianType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
vnl_quaternion< TParametersValueType > VnlQuaternionType
SmartPointer< const Self > ConstPointer
Superclass::InputPointType InputPointType
TParametersValueType ValueType
Definition: itkVector.h:71
Superclass::ParametersType ParametersType
SmartPointer< Self > Pointer
TParametersValueType ValueType
Definition: itkVersor.h:58
Rigid3DTransform< TParametersValueType > Superclass