ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkScalableAffineTransform.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 itkScalableAffineTransform_h
19 #define itkScalableAffineTransform_h
20 
21 #include "itkAffineTransform.h"
22 
23 namespace itk
24 {
33 template<
34  typename TParametersValueType=double,
35  unsigned int NDimensions = 3>
36 class ITK_TEMPLATE_EXPORT ScalableAffineTransform:
37  public AffineTransform<TParametersValueType, NDimensions>
38 {
39 public:
45 
48 
50  itkNewMacro(Self);
51 
53  static constexpr unsigned int InputSpaceDimension = NDimensions;
54  static constexpr unsigned int OutputSpaceDimension = NDimensions;
55  static constexpr unsigned int SpaceDimension = NDimensions;
56  static constexpr unsigned int ParametersDimension = NDimensions * ( NDimensions + 1 );
57 
59  using ParametersType = typename Superclass::ParametersType;
60  using ParametersValueType = typename Superclass::ParametersValueType;
61  using FixedParametersType = typename Superclass::FixedParametersType;
62  using FixedParametersValueType = typename Superclass::FixedParametersValueType;
63  using JacobianType = typename Superclass::JacobianType;
64  using JacobianPositionType = typename Superclass::JacobianPositionType;
65  using InverseJacobianPositionType = typename Superclass::InverseJacobianPositionType;
66  using ScalarType = typename Superclass::ScalarType;
68  using OutputVectorType = typename Superclass::OutputVectorType;
69  using InputCovariantVectorType = typename Superclass::InputCovariantVectorType;
70  using OutputCovariantVectorType = typename Superclass::OutputCovariantVectorType;
71  using InputVnlVectorType = typename Superclass::InputVnlVectorType;
72  using OutputVnlVectorType = typename Superclass::OutputVnlVectorType;
73  using InputPointType = typename Superclass::InputPointType;
74  using OutputPointType = typename Superclass::OutputPointType;
75  using MatrixType = typename Superclass::MatrixType;
76  using MatrixValueType = typename Superclass::MatrixValueType;
77  using InverseMatrixType = typename Superclass::InverseMatrixType;
78  using CenterType = typename Superclass::CenterType;
79  using OffsetType = typename Superclass::OffsetType;
80  using TranslationType = typename Superclass::TranslationType;
81 
84  using InverseTransformBaseType = typename Superclass::InverseTransformBaseType;
85  using InverseTransformBasePointer = typename InverseTransformBaseType::Pointer;
86 
90  void SetIdentity() override;
91 
93  virtual void SetScale(const InputVectorType & scale);
94 
95  virtual void SetScaleComponent(const InputVectorType & scale)
96  { this->SetScale(scale); }
97 
99  virtual void SetScale(const double scale[NDimensions]);
100 
101  virtual void SetScaleComponent(const double scale[NDimensions])
102  { this->SetScale(scale); }
103 
105  virtual const double * GetScale() const
106  { return m_Scale; }
107  virtual const double * GetScaleComponent() const
108  { return m_Scale; }
110 
112  bool GetInverse(Self *inverse) const;
113 
115  InverseTransformBasePointer GetInverseTransform() const override;
116 
117 protected:
125  ScalableAffineTransform(const MatrixType & matrix,
126  const OutputVectorType & offset);
127  ScalableAffineTransform(unsigned int outputSpaceDimension,
128  unsigned int parametersDimension);
129  ScalableAffineTransform(unsigned int parametersDimension);
132 
133  void ComputeMatrix() override;
134 
136  ~ScalableAffineTransform() override = default;
137 
139  void PrintSelf(std::ostream & s, Indent indent) const override;
140 
141  void SetVarScale(const double *scale)
142  { for ( int i = 0; i < InputSpaceDimension; i++ ) { m_Scale[i] = scale[i]; } }
143 
144 private:
145 
146  ScalableAffineTransform(const Self & other) = delete;
147  const Self & operator=(const Self &) = delete;
148 
149  double m_Scale[NDimensions];
151 }; //class ScalableAffineTransform
152 } // namespace itk
153 
154 #ifndef ITK_MANUAL_INSTANTIATION
155 #include "itkScalableAffineTransform.hxx"
156 #endif
157 
158 #endif /* itkScalableAffineTransform_h */
typename Superclass::FixedParametersValueType FixedParametersValueType
typename Superclass::InverseTransformBaseType InverseTransformBaseType
Light weight base class for most itk classes.
typename Superclass::JacobianType JacobianType
void SetVarScale(const double *scale)
typename Superclass::InputVnlVectorType InputVnlVectorType
typename Superclass::InverseMatrixType InverseMatrixType
typename Superclass::JacobianPositionType JacobianPositionType
typename Superclass::OutputVectorType OutputVectorType
typename Superclass::OffsetType OffsetType
virtual const double * GetScale() const
typename Superclass::ParametersValueType ParametersValueType
typename Superclass::TranslationType TranslationType
typename Superclass::MatrixType MatrixType
virtual void SetScaleComponent(const InputVectorType &scale)
typename Superclass::FixedParametersType FixedParametersType
typename Superclass::InputVectorType InputVectorType
typename Superclass::InputCovariantVectorType InputCovariantVectorType
virtual const double * GetScaleComponent() const
typename Superclass::OutputVnlVectorType OutputVnlVectorType
typename InverseTransformBaseType::Pointer InverseTransformBasePointer
typename Superclass::OutputPointType OutputPointType
typename Superclass::InputPointType InputPointType
typename Superclass::CenterType CenterType
virtual void SetScaleComponent(const double scale[NDimensions])
Control indentation during Print() invocation.
Definition: itkIndent.h:49
typename Superclass::ParametersType ParametersType
typename Superclass::ScalarType ScalarType
typename Superclass::MatrixValueType MatrixValueType
typename Superclass::OutputCovariantVectorType OutputCovariantVectorType
typename Superclass::InverseJacobianPositionType InverseJacobianPositionType
Affine transformation with a specified center of rotation.