ITK  4.6.0
Insight Segmentation and Registration Toolkit
itkRigid3DTransform.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 __itkRigid3DTransform_h
19 #define __itkRigid3DTransform_h
20 
21 #include <iostream>
23 #include "itkVersor.h"
24 
25 namespace itk
26 {
56 template< typename TScalar = double >
57 // type for scalars (float or double)
59  public MatrixOffsetTransformBase< TScalar, 3, 3 >
60 {
61 public:
67 
68 #ifdef ITKV3_COMPATIBILITY
69 
70  itkNewMacro(Self);
71 #endif
72 
75 
77  itkStaticConstMacro(SpaceDimension, unsigned int, 3);
78  itkStaticConstMacro(InputSpaceDimension, unsigned int, 3);
79  itkStaticConstMacro(OutputSpaceDimension, unsigned int, 3);
80  itkStaticConstMacro(ParametersDimension, unsigned int, 12);
82 
102 
106  typedef typename InverseTransformBaseType::Pointer InverseTransformBasePointer;
107 
118  virtual void SetParameters(const ParametersType & parameters);
119 
125  virtual void SetMatrix(const MatrixType & matrix);
126 
134  void Translate(const OffsetType & offset, bool pre = false);
135 
140  bool MatrixIsOrthogonal(const MatrixType & matrix, double tol = 1e-10);
141 
142 #ifdef ITKV3_COMPATIBILITY
143 
144  //NOTE: itkLegacyRemove can not be used for GetInverse
145  // because in itkV3 mode these functions
146  // must be traversed when calling the child classes
147  // member functions
148  // (with no real effect) for backwards compatibility.
149  // In ITKv4 mode only the super class is needed
150  bool GetInverse(Self *inverse) const;
151 
153  //NOTE: itkLegacyRemove can not be used for GetInverseTransform
154  // because in itkV3 mode these functions
155  // must be traversed when calling the child classes
156  // member functions
157  // (with no real effect) for backwards compatibility.
158  // In ITKv4 mode only the super class is needed
160 
169  itkLegacyMacro(const MatrixType & GetRotationMatrix() const);
170 
181  itkLegacyMacro(virtual void SetRotationMatrix(const MatrixType & matrix) );
182 #endif
183 
195  itkLegacyMacro(InputPointType BackTransform(const OutputPointType & point) const);
196  itkLegacyMacro(InputVectorType BackTransform(const OutputVectorType & vector) const);
197  itkLegacyMacro(InputVnlVectorType BackTransform(const OutputVnlVectorType & vector) const);
198  itkLegacyMacro(InputCovariantVectorType BackTransform(const OutputCovariantVectorType & vector) const);
200 
201 protected:
202  Rigid3DTransform(const MatrixType & matrix,
203  const OutputVectorType & offset);
204  Rigid3DTransform(unsigned int paramDim);
207 
211  void PrintSelf(std::ostream & os, Indent indent) const;
212 
213 private:
214  Rigid3DTransform(const Self &); //purposely not implemented
215  void operator=(const Self &); //purposely not implemented
216 }; //class Rigid3DTransform
217 } // namespace itk
218 
219 #ifndef ITK_MANUAL_INSTANTIATION
220 #include "itkRigid3DTransform.hxx"
221 #endif
222 
223 #endif /* __itkRigid3DTransform_h */
Superclass::InverseTransformBaseType InverseTransformBaseType
Superclass::InputVectorType InputVectorType
Light weight base class for most itk classes.
virtual void SetMatrix(const MatrixType &matrix)
Superclass::InputPointType InputPointType
Vector< TScalar, itkGetStaticConstMacro(InputSpaceDimension)> InputVectorType
itkLegacyMacro(InputPointType BackTransform(const OutputPointType &point) const)
Rigid3DTransform of a vector space (e.g. space coordinates)
Matrix and Offset transformation of a vector space (e.g. space coordinates)
Superclass::OutputCovariantVectorType OutputCovariantVectorType
vnl_vector_fixed< TScalar, itkGetStaticConstMacro(OutputSpaceDimension)> OutputVnlVectorType
InverseTransformBaseType::Pointer InverseTransformBasePointer
bool MatrixIsOrthogonal(const MatrixType &matrix, double tol=1e-10)
Superclass::TranslationType TranslationType
Matrix< TScalar, itkGetStaticConstMacro(OutputSpaceDimension), itkGetStaticConstMacro(InputSpaceDimension)> MatrixType
MatrixOffsetTransformBase< TScalar, 3, 3 > Superclass
void PrintSelf(std::ostream &os, Indent indent) const
static const unsigned int InputSpaceDimension
void Translate(const OffsetType &offset, bool pre=false)
static const double e
The base of the natural logarithm or Euler&#39;s number
Definition: itkMath.h:45
Superclass::ScalarType ScalarType
static const unsigned int OutputSpaceDimension
Vector< TScalar, itkGetStaticConstMacro(OutputSpaceDimension)> OutputVectorType
virtual InverseTransformBasePointer GetInverseTransform() const
Superclass::InputVnlVectorType InputVnlVectorType
Superclass::MatrixValueType MatrixValueType
Matrix< TScalar, itkGetStaticConstMacro(InputSpaceDimension), itkGetStaticConstMacro(OutputSpaceDimension)> InverseMatrixType
vnl_vector_fixed< TScalar, itkGetStaticConstMacro(InputSpaceDimension)> InputVnlVectorType
Point< TScalar, itkGetStaticConstMacro(InputSpaceDimension)> InputPointType
SmartPointer< Self > Pointer
CovariantVector< TScalar, itkGetStaticConstMacro(OutputSpaceDimension)> OutputCovariantVectorType
static const unsigned int SpaceDimension
Superclass::OutputVectorType OutputVectorType
Superclass::MatrixType MatrixType
Point< TScalar, itkGetStaticConstMacro(OutputSpaceDimension)> OutputPointType
Superclass::JacobianType JacobianType
Superclass::OutputPointType OutputPointType
Superclass::OutputVnlVectorType OutputVnlVectorType
Superclass::ParametersType ParametersType
Superclass::CenterType CenterType
Superclass::OutputVectorValueType OutputVectorValueType
CovariantVector< TScalar, itkGetStaticConstMacro(InputSpaceDimension)> InputCovariantVectorType
static const unsigned int ParametersDimension
virtual void SetParameters(const ParametersType &parameters)
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Superclass::InverseTransformBaseType InverseTransformBaseType
Superclass::OffsetType OffsetType
void operator=(const Self &)
Superclass::InputCovariantVectorType InputCovariantVectorType
Superclass::ParametersValueType ParametersValueType
Superclass::InverseMatrixType InverseMatrixType
SmartPointer< const Self > ConstPointer