ITK  5.2.0
Insight Toolkit
itkScalableAffineTransform.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  * 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 <typename TParametersValueType = double, unsigned int NDimensions = 3>
34 class ITK_TEMPLATE_EXPORT ScalableAffineTransform : public AffineTransform<TParametersValueType, NDimensions>
35 {
36 public:
37  ITK_DISALLOW_COPY_AND_ASSIGN(ScalableAffineTransform);
38 
44 
47 
49  itkNewMacro(Self);
50 
52  static constexpr unsigned int InputSpaceDimension = NDimensions;
53  static constexpr unsigned int OutputSpaceDimension = NDimensions;
54  static constexpr unsigned int SpaceDimension = NDimensions;
55  static constexpr unsigned int ParametersDimension = NDimensions * (NDimensions + 1);
56 
58  using ParametersType = typename Superclass::ParametersType;
59  using ParametersValueType = typename Superclass::ParametersValueType;
60  using FixedParametersType = typename Superclass::FixedParametersType;
61  using FixedParametersValueType = typename Superclass::FixedParametersValueType;
62  using JacobianType = typename Superclass::JacobianType;
63  using JacobianPositionType = typename Superclass::JacobianPositionType;
64  using InverseJacobianPositionType = typename Superclass::InverseJacobianPositionType;
65  using ScalarType = typename Superclass::ScalarType;
67  using OutputVectorType = typename Superclass::OutputVectorType;
68  using InputCovariantVectorType = typename Superclass::InputCovariantVectorType;
69  using OutputCovariantVectorType = typename Superclass::OutputCovariantVectorType;
70  using InputVnlVectorType = typename Superclass::InputVnlVectorType;
71  using OutputVnlVectorType = typename Superclass::OutputVnlVectorType;
72  using InputPointType = typename Superclass::InputPointType;
73  using OutputPointType = typename Superclass::OutputPointType;
74  using MatrixType = typename Superclass::MatrixType;
75  using MatrixValueType = typename Superclass::MatrixValueType;
76  using InverseMatrixType = typename Superclass::InverseMatrixType;
77  using CenterType = typename Superclass::CenterType;
78  using OffsetType = typename Superclass::OffsetType;
79  using TranslationType = typename Superclass::TranslationType;
80 
83  using InverseTransformBaseType = typename Superclass::InverseTransformBaseType;
84  using InverseTransformBasePointer = typename InverseTransformBaseType::Pointer;
85 
89  void
90  SetIdentity() override;
91 
93  virtual void
94  SetScale(const InputVectorType & scale);
95 
96  virtual void
98  {
99  this->SetScale(scale);
100  }
101 
103  virtual void
104  SetScale(const double scale[NDimensions]);
105 
106  virtual void
107  SetScaleComponent(const double scale[NDimensions])
108  {
109  this->SetScale(scale);
110  }
111 
113  virtual const double *
114  GetScale() const
115  {
116  return m_Scale;
117  }
118  virtual const double *
120  {
121  return m_Scale;
122  }
124 
126  bool
127  GetInverse(Self * inverse) const;
128 
130  InverseTransformBasePointer
131  GetInverseTransform() const override;
132 
133 protected:
141  ScalableAffineTransform(const MatrixType & matrix, const OutputVectorType & offset);
142  ScalableAffineTransform(unsigned int outputSpaceDimension, unsigned int parametersDimension);
143  ScalableAffineTransform(unsigned int parametersDimension);
146 
147  void
148  ComputeMatrix() override;
149 
151  ~ScalableAffineTransform() override = default;
152 
154  void
155  PrintSelf(std::ostream & s, Indent indent) const override;
156 
157  void
158  SetVarScale(const double * scale)
159  {
160  for (int i = 0; i < InputSpaceDimension; i++)
161  {
162  m_Scale[i] = scale[i];
163  }
164  }
165 
166 private:
167  double m_Scale[NDimensions];
169 }; // class ScalableAffineTransform
170 } // namespace itk
171 
172 #ifndef ITK_MANUAL_INSTANTIATION
173 # include "itkScalableAffineTransform.hxx"
174 #endif
175 
176 #endif /* itkScalableAffineTransform_h */
itk::AffineTransform::OffsetType
typename Superclass::OffsetType OffsetType
Definition: itkAffineTransform.h:144
itk::AffineTransform::OutputVnlVectorType
typename Superclass::OutputVnlVectorType OutputVnlVectorType
Definition: itkAffineTransform.h:138
itk::ScalableAffineTransform::SetVarScale
void SetVarScale(const double *scale)
Definition: itkScalableAffineTransform.h:158
itk::ScalableAffineTransform::SetScaleComponent
virtual void SetScaleComponent(const InputVectorType &scale)
Definition: itkScalableAffineTransform.h:97
itk::AffineTransform::CenterType
typename Superclass::CenterType CenterType
Definition: itkAffineTransform.h:143
itk::AffineTransform::ScalarType
typename Superclass::ScalarType ScalarType
Definition: itkAffineTransform.h:132
itk::AffineTransform::InverseMatrixType
typename Superclass::InverseMatrixType InverseMatrixType
Definition: itkAffineTransform.h:142
itk::AffineTransform::TranslationType
typename Superclass::TranslationType TranslationType
Definition: itkAffineTransform.h:145
itk::ScalableAffineTransform::ParametersValueType
typename Superclass::ParametersValueType ParametersValueType
Definition: itkScalableAffineTransform.h:59
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itkAffineTransform.h
itk::AffineTransform
Definition: itkAffineTransform.h:101
itk::ScalableAffineTransform::SetScaleComponent
virtual void SetScaleComponent(const double scale[NDimensions])
Definition: itkScalableAffineTransform.h:107
itk::AffineTransform::MatrixType
typename Superclass::MatrixType MatrixType
Definition: itkAffineTransform.h:141
itk::AffineTransform::InputVnlVectorType
typename Superclass::InputVnlVectorType InputVnlVectorType
Definition: itkAffineTransform.h:137
itk::AffineTransform::ParametersType
typename Superclass::ParametersType ParametersType
Definition: itkAffineTransform.h:127
itk::AffineTransform::OutputVectorType
typename Superclass::OutputVectorType OutputVectorType
Definition: itkAffineTransform.h:136
itk::ScalableAffineTransform
Affine transformation with a specified center of rotation.
Definition: itkScalableAffineTransform.h:34
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::AffineTransform::FixedParametersType
typename Superclass::FixedParametersType FixedParametersType
Definition: itkAffineTransform.h:128
itk::ScalableAffineTransform::m_MatrixScale
InputVectorType m_MatrixScale
Definition: itkScalableAffineTransform.h:168
itk::AffineTransform::InputCovariantVectorType
typename Superclass::InputCovariantVectorType InputCovariantVectorType
Definition: itkAffineTransform.h:139
itk::AffineTransform::InverseJacobianPositionType
typename Superclass::InverseJacobianPositionType InverseJacobianPositionType
Definition: itkAffineTransform.h:131
itk::AffineTransform::InverseTransformBasePointer
typename InverseTransformBaseType::Pointer InverseTransformBasePointer
Definition: itkAffineTransform.h:150
itk::ScalableAffineTransform::FixedParametersValueType
typename Superclass::FixedParametersValueType FixedParametersValueType
Definition: itkScalableAffineTransform.h:61
itk::AffineTransform::JacobianPositionType
typename Superclass::JacobianPositionType JacobianPositionType
Definition: itkAffineTransform.h:130
itk::AffineTransform::InverseTransformBaseType
typename Superclass::InverseTransformBaseType InverseTransformBaseType
Definition: itkAffineTransform.h:149
itk::AffineTransform::OutputCovariantVectorType
typename Superclass::OutputCovariantVectorType OutputCovariantVectorType
Definition: itkAffineTransform.h:140
itk::ScalableAffineTransform::GetScale
virtual const double * GetScale() const
Definition: itkScalableAffineTransform.h:114
itk::ScalableAffineTransform::GetScaleComponent
virtual const double * GetScaleComponent() const
Definition: itkScalableAffineTransform.h:119
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::ScalableAffineTransform::MatrixValueType
typename Superclass::MatrixValueType MatrixValueType
Definition: itkScalableAffineTransform.h:75
itk::AffineTransform::OutputPointType
typename Superclass::OutputPointType OutputPointType
Definition: itkAffineTransform.h:134
itk::AffineTransform::InputPointType
typename Superclass::InputPointType InputPointType
Definition: itkAffineTransform.h:133
itk::AffineTransform::InputVectorType
typename Superclass::InputVectorType InputVectorType
Definition: itkAffineTransform.h:135
itk::AffineTransform::JacobianType
typename Superclass::JacobianType JacobianType
Definition: itkAffineTransform.h:129