ITK  4.3.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< class TScalarType = double >
57 // type for scalars (float or double)
58 class ITK_EXPORT Rigid3DTransform:
59  public MatrixOffsetTransformBase< TScalarType, 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 
83  typedef typename Superclass::ParametersType ParametersType;
84  typedef typename Superclass::ParametersValueType ParametersValueType;
85  typedef typename Superclass::JacobianType JacobianType;
86  typedef typename Superclass::ScalarType ScalarType;
87  typedef typename Superclass::InputVectorType InputVectorType;
88  typedef typename Superclass::OutputVectorType OutputVectorType;
89  typedef typename Superclass::OutputVectorValueType OutputVectorValueType;
90  typedef typename Superclass::InputCovariantVectorType InputCovariantVectorType;
91  typedef typename Superclass::OutputCovariantVectorType OutputCovariantVectorType;
92  typedef typename Superclass::InputVnlVectorType InputVnlVectorType;
93  typedef typename Superclass::OutputVnlVectorType OutputVnlVectorType;
94  typedef typename Superclass::InputPointType InputPointType;
95  typedef typename Superclass::OutputPointType OutputPointType;
96  typedef typename Superclass::MatrixType MatrixType;
97  typedef typename Superclass::InverseMatrixType InverseMatrixType;
98  typedef typename Superclass::MatrixValueType MatrixValueType;
99  typedef typename Superclass::CenterType CenterType;
100  typedef typename Superclass::TranslationType TranslationType;
101  typedef typename Superclass::OffsetType OffsetType;
102 
105  typedef typename Superclass::InverseTransformBaseType InverseTransformBaseType;
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
159  virtual InverseTransformBasePointer GetInverseTransform() const;
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);
206  ~Rigid3DTransform();
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 */
224