ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkAffineTransform.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 itkAffineTransform_h
19 #define itkAffineTransform_h
20 
22 #include <iostream>
23 
24 
25 namespace itk
26 {
98 
99 template<
100  typename TParametersValueType = double,
101  unsigned int NDimensions = 3 >
102 // Number of dimensions in the input space
103 class ITK_TEMPLATE_EXPORT AffineTransform:
104  public MatrixOffsetTransformBase< TParametersValueType, NDimensions, NDimensions>
105 {
106 public:
109  using Superclass = MatrixOffsetTransformBase< TParametersValueType,
110  NDimensions,
111  NDimensions >;
112 
115 
118 
120  itkNewMacro(Self);
121 
123  static constexpr unsigned int InputSpaceDimension = NDimensions;
124  static constexpr unsigned int OutputSpaceDimension = NDimensions;
125  static constexpr unsigned int SpaceDimension = NDimensions;
126  static constexpr unsigned int ParametersDimension = NDimensions *( NDimensions + 1 );
127 
129  using ParametersType = typename Superclass::ParametersType;
130  using FixedParametersType = typename Superclass::FixedParametersType;
131  using JacobianType = typename Superclass::JacobianType;
132  using JacobianPositionType = typename Superclass::JacobianPositionType;
133  using InverseJacobianPositionType = typename Superclass::InverseJacobianPositionType;
134  using ScalarType = typename Superclass::ScalarType;
135  using InputPointType = typename Superclass::InputPointType;
136  using OutputPointType = typename Superclass::OutputPointType;
137  using InputVectorType = typename Superclass::InputVectorType;
138  using OutputVectorType = typename Superclass::OutputVectorType;
139  using InputVnlVectorType = typename Superclass::InputVnlVectorType;
140  using OutputVnlVectorType = typename Superclass::OutputVnlVectorType;
141  using InputCovariantVectorType = typename Superclass::InputCovariantVectorType;
142  using OutputCovariantVectorType = typename Superclass::OutputCovariantVectorType;
143  using MatrixType = typename Superclass::MatrixType;
144  using InverseMatrixType = typename Superclass::InverseMatrixType;
145  using CenterType = typename Superclass::CenterType;
146  using OffsetType = typename Superclass::OffsetType;
147  using TranslationType = typename Superclass::TranslationType;
148 
151  using InverseTransformBaseType = typename Superclass::InverseTransformBaseType;
152  using InverseTransformBasePointer = typename InverseTransformBaseType::Pointer;
153 
160  void Translate(const OutputVectorType & offset, bool pre = false);
161 
173  void Scale(const OutputVectorType & factor, bool pre = false);
174 
175  void Scale(const TParametersValueType & factor, bool pre = false);
176 
192  void Rotate(int axis1, int axis2, TParametersValueType angle, bool pre = false);
194 
208  void Rotate2D(TParametersValueType angle, bool pre = false);
209 
223  void Rotate3D(const OutputVectorType & axis, TParametersValueType angle, bool pre = false);
224 
236  void Shear(int axis1, int axis2, TParametersValueType coef, bool pre = false);
237 
239  bool GetInverse(Self *inverse) const;
240 
242  InverseTransformBasePointer GetInverseTransform() const override;
243 
255  ScalarType Metric(const Self *other) const;
256 
260  ScalarType Metric() const;
261 
262 protected:
270  AffineTransform(const MatrixType & matrix,
271  const OutputVectorType & offset);
272  AffineTransform(unsigned int paramDims);
273  AffineTransform();
275 
277  ~AffineTransform() override = default;
278 
280  void PrintSelf(std::ostream & s, Indent indent) const override;
281 
282 private:
283 
284  AffineTransform(const Self & other) = delete;
285  const Self & operator=(const Self &) = delete;
286 }; //class AffineTransform
287 
288 } // namespace itk
289 
290 #ifndef ITK_MANUAL_INSTANTIATION
291 #include "itkAffineTransform.hxx"
292 #endif
293 
294 #endif /* itkAffineTransform_h */
typename Superclass::InverseTransformBaseType InverseTransformBaseType
Light weight base class for most itk classes.
typename Superclass::JacobianType JacobianType
typename Superclass::InputVnlVectorType InputVnlVectorType
Matrix and Offset transformation of a vector space (e.g. space coordinates)
typename Superclass::InverseMatrixType InverseMatrixType
typename Superclass::JacobianPositionType JacobianPositionType
typename Superclass::OutputVectorType OutputVectorType
typename Superclass::OffsetType OffsetType
typename Superclass::TranslationType TranslationType
typename Superclass::MatrixType MatrixType
typename Superclass::FixedParametersType FixedParametersType
typename Superclass::InputVectorType InputVectorType
typename Superclass::InputCovariantVectorType InputCovariantVectorType
typename Superclass::OutputVnlVectorType OutputVnlVectorType
typename InverseTransformBaseType::Pointer InverseTransformBasePointer
typename Superclass::OutputPointType OutputPointType
typename Superclass::InputPointType InputPointType
typename Superclass::CenterType CenterType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
typename Superclass::ParametersType ParametersType
typename Superclass::ScalarType ScalarType
typename Superclass::OutputCovariantVectorType OutputCovariantVectorType
typename Superclass::InverseJacobianPositionType InverseJacobianPositionType