ITK  4.6.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 TScalar = double >
47 // Data type for scalars (float or double)
48 class VersorTransform : public Rigid3DTransform< TScalar >
49 {
50 public:
56 
58  itkTypeMacro(VersorTransform, Rigid3DTransform);
59 
61  itkNewMacro(Self);
62 
64  itkStaticConstMacro(SpaceDimension, unsigned int, 3);
65  itkStaticConstMacro(InputSpaceDimension, unsigned int, 3);
66  itkStaticConstMacro(OutputSpaceDimension, unsigned int, 3);
67  itkStaticConstMacro(ParametersDimension, unsigned int, 3);
69 
86 
88  typedef vnl_quaternion< TScalar > VnlQuaternionType;
89 
92  typedef typename VersorType::VectorType AxisType;
93  typedef typename VersorType::ValueType AngleType;
95  typedef typename ParametersType::ValueType ParameterValueType;
96 
105  void SetParameters(const ParametersType & parameters);
106 
108  const ParametersType & GetParameters(void) const;
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);
119 
125  virtual void ComputeJacobianWithRespectToParameters( const InputPointType & p, JacobianType & jacobian) const;
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;
153 
156  void ComputeMatrix(void);
157 
158  void ComputeMatrixParameters(void);
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 */
void SetVarVersor(const VersorType &newVersor)
Superclass::InputVectorType InputVectorType
virtual void SetIdentity(void)
Light weight base class for most itk classes.
Superclass::InputPointType InputPointType
void ComputeMatrix(void)
ParametersType::ValueType ParameterValueType
VersorType::VectorType AxisType
const ParametersType & GetParameters(void) const
Superclass::OffsetType OffsetType
itkLegacyMacro(InputPointType BackTransform(const OutputPointType &point) const)
Rigid3DTransform of a vector space (e.g. space coordinates)
Superclass::MatrixType MatrixType
Superclass::OutputCovariantVectorType OutputCovariantVectorType
void SetRotation(const VersorType &versor)
Superclass::OutputCovariantVectorType OutputCovariantVectorType
void ComputeMatrixParameters(void)
Superclass::OutputVnlVectorType OutputVnlVectorType
Rigid3DTransform< TScalar > Superclass
virtual void ComputeJacobianWithRespectToParameters(const InputPointType &p, JacobianType &jacobian) const
static const unsigned int SpaceDimension
Superclass::ScalarType ScalarType
VersorType::ValueType AngleType
Superclass::OutputVectorType OutputVectorType
static const unsigned int OutputSpaceDimension
Superclass::InputVnlVectorType InputVnlVectorType
vnl_quaternion< TScalar > VnlQuaternionType
Superclass::InputVectorType InputVectorType
const Self & operator=(const Self &)
SmartPointer< const Self > ConstPointer
void SetParameters(const ParametersType &parameters)
Superclass::OutputVectorType OutputVectorType
Superclass::MatrixType MatrixType
Superclass::InputVnlVectorType InputVnlVectorType
Superclass::ParametersType ParametersType
Superclass::JacobianType JacobianType
SmartPointer< Self > Pointer
Superclass::OutputPointType OutputPointType
Superclass::OutputVnlVectorType OutputVnlVectorType
Superclass::ParametersType ParametersType
AxisType::ValueType AxisValueType
Superclass::CenterType CenterType
static const unsigned int ParametersDimension
void PrintSelf(std::ostream &os, Indent indent) const
Superclass::CenterType CenterType
Versor< TScalar > VersorType
Superclass::JacobianType JacobianType
static const unsigned int InputSpaceDimension
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Superclass::OffsetType OffsetType
Superclass::InputPointType InputPointType
Superclass::InputCovariantVectorType InputCovariantVectorType
Superclass::ScalarType ScalarType
Superclass::OutputPointType OutputPointType
Superclass::InverseMatrixType InverseMatrixType
Superclass::InputCovariantVectorType InputCovariantVectorType
Superclass::InverseMatrixType InverseMatrixType