ITK  4.13.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 TParametersValueType=double>
57 class ITK_TEMPLATE_EXPORT Rigid3DTransform:
58  public MatrixOffsetTransformBase<TParametersValueType, 3, 3>
59 {
60 public:
66 
67 #ifdef ITKV3_COMPATIBILITY
68 
69  itkNewMacro(Self);
70 #endif
71 
74 
76  itkStaticConstMacro(SpaceDimension, unsigned int, 3);
77  itkStaticConstMacro(InputSpaceDimension, unsigned int, 3);
78  itkStaticConstMacro(OutputSpaceDimension, unsigned int, 3);
79  itkStaticConstMacro(ParametersDimension, unsigned int, 12);
81 
82  typedef typename Superclass::ParametersType ParametersType;
83  typedef typename Superclass::ParametersValueType ParametersValueType;
84  typedef typename Superclass::FixedParametersType FixedParametersType;
85  typedef typename Superclass::FixedParametersValueType FixedParametersValueType;
86  typedef typename Superclass::JacobianType JacobianType;
87  typedef typename Superclass::ScalarType ScalarType;
88  typedef typename Superclass::InputVectorType InputVectorType;
89  typedef typename Superclass::OutputVectorType OutputVectorType;
90  typedef typename Superclass::OutputVectorValueType OutputVectorValueType;
91  typedef typename Superclass::InputCovariantVectorType InputCovariantVectorType;
92  typedef typename Superclass::OutputCovariantVectorType OutputCovariantVectorType;
93  typedef typename Superclass::InputVnlVectorType InputVnlVectorType;
94  typedef typename Superclass::OutputVnlVectorType OutputVnlVectorType;
95  typedef typename Superclass::InputPointType InputPointType;
96  typedef typename Superclass::OutputPointType OutputPointType;
97  typedef typename Superclass::MatrixType MatrixType;
98  typedef typename Superclass::InverseMatrixType InverseMatrixType;
99  typedef typename Superclass::MatrixValueType MatrixValueType;
100  typedef typename Superclass::CenterType CenterType;
101  typedef typename Superclass::TranslationType TranslationType;
102  typedef typename Superclass::OffsetType OffsetType;
103 
106  typedef typename Superclass::InverseTransformBaseType InverseTransformBaseType;
107  typedef typename InverseTransformBaseType::Pointer InverseTransformBasePointer;
108 
119  virtual void SetParameters(const ParametersType & parameters) ITK_OVERRIDE;
120 
126  virtual void SetMatrix(const MatrixType & matrix) ITK_OVERRIDE;
127 
133  virtual void SetMatrix(const MatrixType & matrix, const TParametersValueType tolerance );
134 
142  void Translate(const OffsetType & offset, bool pre = false);
143 
148  bool MatrixIsOrthogonal(const MatrixType & matrix,
149  const TParametersValueType tolerance =
151 
152 #ifdef ITKV3_COMPATIBILITY
153 
154  //NOTE: itkLegacyRemove can not be used for GetInverse
155  // because in itkV3 mode these functions
156  // must be traversed when calling the child classes
157  // member functions
158  // (with no real effect) for backwards compatibility.
159  // In ITKv4 mode only the super class is needed
160  bool GetInverse(Self *inverse) const;
161 
163  //NOTE: itkLegacyRemove can not be used for GetInverseTransform
164  // because in itkV3 mode these functions
165  // must be traversed when calling the child classes
166  // member functions
167  // (with no real effect) for backwards compatibility.
168  // In ITKv4 mode only the super class is needed
169  virtual InverseTransformBasePointer GetInverseTransform() const ITK_OVERRIDE;
170 
179  itkLegacyMacro(const MatrixType & GetRotationMatrix() const);
180 
191  itkLegacyMacro(virtual void SetRotationMatrix(const MatrixType & matrix) );
192 #endif
193 
205  itkLegacyMacro(InputPointType BackTransform(const OutputPointType & point) const);
206  itkLegacyMacro(InputVectorType BackTransform(const OutputVectorType & vector) const);
207  itkLegacyMacro(InputVnlVectorType BackTransform(const OutputVnlVectorType & vector) const);
208  itkLegacyMacro(InputCovariantVectorType BackTransform(const OutputCovariantVectorType & vector) const);
210 
211 protected:
212  Rigid3DTransform(const MatrixType & matrix,
213  const OutputVectorType & offset);
214  Rigid3DTransform(unsigned int paramDim);
216  ~Rigid3DTransform() ITK_OVERRIDE;
217 
221  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
222 
223 private:
224  ITK_DISALLOW_COPY_AND_ASSIGN(Rigid3DTransform);
225 }; //class Rigid3DTransform
226 } // namespace itk
227 
228 #ifndef ITK_MANUAL_INSTANTIATION
229 #include "itkRigid3DTransform.hxx"
230 #endif
231 
232 #endif /* itkRigid3DTransform_h */
Superclass::InputCovariantVectorType InputCovariantVectorType
Superclass::FixedParametersType FixedParametersType
Superclass::TranslationType TranslationType
Superclass::InverseMatrixType InverseMatrixType
Light weight base class for most itk classes.
Superclass::CenterType CenterType
Rigid3DTransform of a vector space (e.g. space coordinates)
Matrix and Offset transformation of a vector space (e.g. space coordinates)
InverseTransformBaseType::Pointer InverseTransformBasePointer
Superclass::MatrixType MatrixType
Superclass::OutputVectorType OutputVectorType
Superclass::InputVectorType InputVectorType
Superclass::OutputVectorValueType OutputVectorValueType
Superclass::OutputPointType OutputPointType
Superclass::OutputCovariantVectorType OutputCovariantVectorType
Superclass::JacobianType JacobianType
SmartPointer< const Self > ConstPointer
Superclass::ParametersValueType ParametersValueType
SmartPointer< Self > Pointer
Superclass::InputVnlVectorType InputVnlVectorType
Superclass::OffsetType OffsetType
Superclass::ParametersType ParametersType
MatrixOffsetTransformBase< TParametersValueType, 3, 3 > Superclass
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Superclass::ScalarType ScalarType
Superclass::InverseTransformBaseType InverseTransformBaseType
Superclass::InputPointType InputPointType
Superclass::OutputVnlVectorType OutputVnlVectorType
Superclass::MatrixValueType MatrixValueType
Superclass::FixedParametersValueType FixedParametersValueType