ITK  5.4.0
Insight Toolkit
itkAffineTransform.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
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  * https://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 itkAffineTransform_h
19 #define itkAffineTransform_h
20 
22 #include <iostream>
23 
24 
25 namespace itk
26 {
99 template <typename TParametersValueType = double, unsigned int VDimension = 3>
100 // Number of dimensions in the input space
101 class ITK_TEMPLATE_EXPORT AffineTransform
102  : public MatrixOffsetTransformBase<TParametersValueType, VDimension, VDimension>
103 {
104 public:
105  ITK_DISALLOW_COPY_AND_MOVE(AffineTransform);
106 
110 
113 
115  itkOverrideGetNameOfClassMacro(AffineTransform);
116 
118  itkNewMacro(Self);
119 
121  static constexpr unsigned int InputSpaceDimension = VDimension;
122  static constexpr unsigned int OutputSpaceDimension = VDimension;
123  static constexpr unsigned int SpaceDimension = VDimension;
124  static constexpr unsigned int ParametersDimension = VDimension * (VDimension + 1);
125 
127  using typename Superclass::ParametersType;
128  using typename Superclass::FixedParametersType;
129  using typename Superclass::JacobianType;
130  using typename Superclass::JacobianPositionType;
131  using typename Superclass::InverseJacobianPositionType;
132  using typename Superclass::ScalarType;
133  using typename Superclass::InputPointType;
134  using typename Superclass::OutputPointType;
135  using typename Superclass::InputVectorType;
136  using typename Superclass::OutputVectorType;
137  using typename Superclass::InputVnlVectorType;
138  using typename Superclass::OutputVnlVectorType;
139  using typename Superclass::InputCovariantVectorType;
140  using typename Superclass::OutputCovariantVectorType;
141  using typename Superclass::MatrixType;
142  using typename Superclass::InverseMatrixType;
143  using typename Superclass::CenterType;
144  using typename Superclass::OffsetType;
145  using typename Superclass::TranslationType;
146 
149  using InverseTransformBaseType = typename Superclass::InverseTransformBaseType;
151 
158  void
159  Translate(const OutputVectorType & trans, bool pre = false);
160 
172  void
173  Scale(const OutputVectorType & factor, bool pre = false);
174 
175  void
176  Scale(const TParametersValueType & factor, bool pre = false);
177 
193  void
194  Rotate(int axis1, int axis2, TParametersValueType angle, bool pre = false);
210  void
211  Rotate2D(TParametersValueType angle, bool pre = false);
212 
226  void
227  Rotate3D(const OutputVectorType & axis, TParametersValueType angle, bool pre = false);
228 
240  void
241  Shear(int axis1, int axis2, TParametersValueType coef, bool pre = false);
242 
244  bool
245  GetInverse(Self * inverse) const;
246 
249  GetInverseTransform() const override;
250 
262  ScalarType
263  Metric(const Self * other) const;
264 
268  ScalarType
269  Metric() const;
270 
271 protected:
279  AffineTransform(const MatrixType & matrix, const OutputVectorType & offset);
280  AffineTransform(unsigned int parametersDimension);
281  AffineTransform();
285  ~AffineTransform() override = default;
286 
287 }; // class AffineTransform
288 
289 } // namespace itk
290 
291 #ifndef ITK_MANUAL_INSTANTIATION
292 # include "itkAffineTransform.hxx"
293 #endif
294 
295 #endif /* itkAffineTransform_h */
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
itk::Vector
A templated class holding a n-Dimensional vector.
Definition: itkVector.h:62
itk::MatrixOffsetTransformBase
Matrix and Offset transformation of a vector space (e.g. space coordinates)
Definition: itkMatrixOffsetTransformBase.h:106
itk::SmartPointer< Self >
itk::AffineTransform
Definition: itkAffineTransform.h:101
itk::AffineTransform::InverseTransformBasePointer
typename InverseTransformBaseType::Pointer InverseTransformBasePointer
Definition: itkAffineTransform.h:150
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itkMatrixOffsetTransformBase.h
itk::Transform::ScalarType
ParametersValueType ScalarType
Definition: itkTransform.h:141
itk::Matrix< TParametersValueType, Self::OutputSpaceDimension, Self::InputSpaceDimension >
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::AffineTransform::InverseTransformBaseType
typename Superclass::InverseTransformBaseType InverseTransformBaseType
Definition: itkAffineTransform.h:149