ITK  6.0.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;
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;
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 
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 #if !defined(ITK_LEGACY_REMOVE)
280  [[deprecated("Removed unused constructor")]] AffineTransform(const MatrixType & matrix,
281  const OutputVectorType & offset);
282 #endif
283  AffineTransform(unsigned int parametersDimension);
284  AffineTransform();
288  ~AffineTransform() override = default;
289 
290 }; // class AffineTransform
291 
292 } // namespace itk
293 
294 #ifndef ITK_MANUAL_INSTANTIATION
295 # include "itkAffineTransform.hxx"
296 #endif
297 
298 #endif /* itkAffineTransform_h */
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
itk::MatrixOffsetTransformBase< TParametersValueType, VDimension, VDimension >::OutputVnlVectorType
vnl_vector_fixed< TParametersValueType, Self::OutputSpaceDimension > OutputVnlVectorType
Definition: itkMatrixOffsetTransformBase.h:171
itk::Vector< TParametersValueType, Self::InputSpaceDimension >
itk::MatrixOffsetTransformBase
Matrix and Offset transformation of a vector space (e.g. space coordinates)
Definition: itkMatrixOffsetTransformBase.h:106
itk::SmartPointer< Self >
itk::MatrixOffsetTransformBase< TParametersValueType, VDimension, VDimension >::InverseJacobianPositionType
vnl_matrix_fixed< ParametersValueType, VInputDimension, VOutputDimension > InverseJacobianPositionType
Definition: itkTransform.h:132
itk::AffineTransform
Definition: itkAffineTransform.h:101
itk::AffineTransform::InverseTransformBasePointer
typename InverseTransformBaseType::Pointer InverseTransformBasePointer
Definition: itkAffineTransform.h:150
itk::MatrixOffsetTransformBase< TParametersValueType, VDimension, VDimension >::ScalarType
ParametersValueType ScalarType
Definition: itkTransform.h:127
itk::MatrixOffsetTransformBase< TParametersValueType, VDimension, VDimension >::JacobianPositionType
vnl_matrix_fixed< ParametersValueType, VOutputDimension, VInputDimension > JacobianPositionType
Definition: itkTransform.h:131
itk::MatrixOffsetTransformBase< TParametersValueType, VDimension, VDimension >::InverseTransformBaseType
typename Superclass::InverseTransformBaseType InverseTransformBaseType
Definition: itkMatrixOffsetTransformBase.h:197
itk::MatrixOffsetTransformBase< TParametersValueType, VDimension, VDimension >::InputVnlVectorType
vnl_vector_fixed< TParametersValueType, Self::InputSpaceDimension > InputVnlVectorType
Definition: itkMatrixOffsetTransformBase.h:170
itkMatrixOffsetTransformBase.h
itk::Transform::ScalarType
ParametersValueType ScalarType
Definition: itkTransform.h:127
itk::Matrix< TParametersValueType, Self::OutputSpaceDimension, Self::InputSpaceDimension >
itk::CovariantVector
A templated class holding a n-Dimensional covariant vector.
Definition: itkCovariantVector.h:70
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::Point< TParametersValueType, Self::InputSpaceDimension >
itk::Array2D
Array2D class representing a 2D array.
Definition: itkArray2D.h:42
itk::AffineTransform::InverseTransformBaseType
typename Superclass::InverseTransformBaseType InverseTransformBaseType
Definition: itkAffineTransform.h:149