ITK  4.2.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 {
47 template< class TScalarType = double >
48 // type for scalars (float or double)
49 class ITK_EXPORT Rigid3DTransform:
50  public MatrixOffsetTransformBase< TScalarType, 3, 3 >
51 {
52 public:
58 
59 #ifdef ITKV3_COMPATIBILITY
60 
61  itkNewMacro(Self);
62 #endif
63 
66 
68  itkStaticConstMacro(SpaceDimension, unsigned int, 3);
69  itkStaticConstMacro(InputSpaceDimension, unsigned int, 3);
70  itkStaticConstMacro(OutputSpaceDimension, unsigned int, 3);
71  itkStaticConstMacro(ParametersDimension, unsigned int, 12);
73 
74  typedef typename Superclass::ParametersType ParametersType;
75  typedef typename Superclass::ParametersValueType ParametersValueType;
76  typedef typename Superclass::JacobianType JacobianType;
77  typedef typename Superclass::ScalarType ScalarType;
78  typedef typename Superclass::InputVectorType InputVectorType;
79  typedef typename Superclass::OutputVectorType OutputVectorType;
80  typedef typename Superclass::OutputVectorValueType OutputVectorValueType;
81  typedef typename Superclass::InputCovariantVectorType InputCovariantVectorType;
82  typedef typename Superclass::OutputCovariantVectorType OutputCovariantVectorType;
83  typedef typename Superclass::InputVnlVectorType InputVnlVectorType;
84  typedef typename Superclass::OutputVnlVectorType OutputVnlVectorType;
85  typedef typename Superclass::InputPointType InputPointType;
86  typedef typename Superclass::OutputPointType OutputPointType;
87  typedef typename Superclass::MatrixType MatrixType;
88  typedef typename Superclass::InverseMatrixType InverseMatrixType;
89  typedef typename Superclass::MatrixValueType MatrixValueType;
90  typedef typename Superclass::CenterType CenterType;
91  typedef typename Superclass::TranslationType TranslationType;
92  typedef typename Superclass::OffsetType OffsetType;
93 
96  typedef typename Superclass::InverseTransformBaseType InverseTransformBaseType;
97  typedef typename InverseTransformBaseType::Pointer InverseTransformBasePointer;
98 
109  virtual void SetParameters(const ParametersType & parameters);
110 
116  virtual void SetMatrix(const MatrixType & matrix);
117 
125  void Translate(const OffsetType & offset, bool pre = false);
126 
131  bool MatrixIsOrthogonal(const MatrixType & matrix, double tol = 1e-10);
132 
133 #ifdef ITKV3_COMPATIBILITY
134 
135  itkLegacyMacro(bool GetInverse(Self *inverse) const);
136 
138  itkLegacyMacro(virtual InverseTransformBasePointer GetInverseTransform() const);
139 
148  itkLegacyMacro(const MatrixType & GetRotationMatrix() const);
149 
160  itkLegacyMacro(virtual void SetRotationMatrix(const MatrixType & matrix) );
161 #endif
162 
174  itkLegacyMacro(InputPointType BackTransform(const OutputPointType & point) const);
175  itkLegacyMacro(InputVectorType BackTransform(const OutputVectorType & vector) const);
176  itkLegacyMacro(InputVnlVectorType BackTransform(const OutputVnlVectorType & vector) const);
177  itkLegacyMacro(InputCovariantVectorType BackTransform(const OutputCovariantVectorType & vector) const);
179 
180 protected:
181  Rigid3DTransform(const MatrixType & matrix,
182  const OutputVectorType & offset);
183  Rigid3DTransform(unsigned int paramDim);
185  ~Rigid3DTransform();
186 
190  void PrintSelf(std::ostream & os, Indent indent) const;
191 
192 private:
193  Rigid3DTransform(const Self &); //purposely not implemented
194  void operator=(const Self &); //purposely not implemented
195 }; //class Rigid3DTransform
196 } // namespace itk
197 
198 // Define instantiation macro for this template.
199 #define ITK_TEMPLATE_Rigid3DTransform(_, EXPORT, TypeX, TypeY) \
200  namespace itk \
201  { \
202  _( 1 ( class EXPORT Rigid3DTransform< ITK_TEMPLATE_1 TypeX > ) ) \
203  namespace Templates \
204  { \
205  typedef Rigid3DTransform< ITK_TEMPLATE_1 TypeX > Rigid3DTransform##TypeY; \
206  } \
207  }
208 
209 #if ITK_TEMPLATE_EXPLICIT
210 #include "Templates/itkRigid3DTransform+-.h"
211 #endif
212 
213 #if ITK_TEMPLATE_TXX
214 #include "itkRigid3DTransform.hxx"
215 #endif
216 
217 #endif /* __itkRigid3DTransform_h */
218