ITK  4.9.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 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 
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 
137  {
138  }
139 
140 #ifdef ITKV3_COMPATIBILITY
141 
143  itkLegacyMacro( virtual void SetRotationMatrix(const MatrixType & matrix) );
144 #endif
145 
146  void SetVarVersor(const VersorType & newVersor)
147  {
148  m_Versor = newVersor;
149  }
150 
152  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
153 
156  void ComputeMatrix(void) ITK_OVERRIDE;
157 
158  void ComputeMatrixParameters(void) ITK_OVERRIDE;
159 
160 private:
162  VersorTransform(const Self & other); // Not implemented
163 
165  const Self & operator=(const Self &); // Not implemented
166 
169 }; // class VersorTransform
170 } // namespace itk
171 
172 #ifndef ITK_MANUAL_INSTANTIATION
173 #include "itkVersorTransform.hxx"
174 #endif
175 
176 #endif /* itkVersorTransform_h */
Superclass::InputCovariantVectorType InputCovariantVectorType
Superclass::FixedParametersType FixedParametersType
void ComputeMatrix(void) override
Superclass::OutputPointType OutputPointType
Superclass::InverseMatrixType InverseMatrixType
Light weight base class for most itk classes.
Superclass::CenterType CenterType
virtual void ComputeJacobianWithRespectToParameters(const InputPointType &p, JacobianType &jacobian) const override
Rigid3DTransform of a vector space (e.g. space coordinates)
static const unsigned int SpaceDimension
Versor< TParametersValueType > VersorType
Superclass::InputVnlVectorType InputVnlVectorType
void ComputeMatrixParameters(void) override
Superclass::OffsetType OffsetType
void SetVarVersor(const VersorType &newVersor)
Superclass::MatrixType MatrixType
Superclass::OutputVectorType OutputVectorType
itkLegacyMacro(InputPointType BackTransform(const OutputPointType &point) const)
Superclass::OutputVectorType OutputVectorType
Superclass::InputVectorType InputVectorType
Superclass::InputCovariantVectorType InputCovariantVectorType
Superclass::OutputCovariantVectorType OutputCovariantVectorType
Superclass::InputPointType InputPointType
Superclass::ScalarType ScalarType
const ParametersType & GetParameters(void) const override
Superclass::OutputVnlVectorType OutputVnlVectorType
VersorType::VectorType AxisType
Superclass::CenterType CenterType
Superclass::InputVectorType InputVectorType
static const unsigned int OutputSpaceDimension
static const unsigned int InputSpaceDimension
Superclass::OutputPointType OutputPointType
void SetParameters(const ParametersType &parameters) override
void SetRotation(const VersorType &versor)
AxisType::ValueType AxisValueType
Superclass::OutputCovariantVectorType OutputCovariantVectorType
Superclass::MatrixType MatrixType
Superclass::JacobianType JacobianType
Superclass::InverseMatrixType InverseMatrixType
Superclass::FixedParametersType FixedParametersType
void PrintSelf(std::ostream &os, Indent indent) const override
Superclass::InputVnlVectorType InputVnlVectorType
VersorType::ValueType AngleType
static const unsigned int ParametersDimension
ParametersType::ValueType ParametersValueType
Superclass::OffsetType OffsetType
Superclass::ParametersType ParametersType
Superclass::JacobianType JacobianType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
vnl_quaternion< TParametersValueType > VnlQuaternionType
SmartPointer< const Self > ConstPointer
Superclass::ScalarType ScalarType
Superclass::InputPointType InputPointType
TParametersValueType ValueType
Definition: itkVector.h:71
Superclass::OutputVnlVectorType OutputVnlVectorType
Superclass::ParametersType ParametersType
SmartPointer< Self > Pointer
TParametersValueType ValueType
Definition: itkVersor.h:58
Rigid3DTransform< TParametersValueType > Superclass
virtual void SetIdentity(void) override