ITK  6.0.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  * 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 itkScalableAffineTransform_h
19 #define itkScalableAffineTransform_h
20 
21 #include "itkAffineTransform.h"
22 
23 namespace itk
24 {
33 template <typename TParametersValueType = double, unsigned int VDimension = 3>
34 class ITK_TEMPLATE_EXPORT ScalableAffineTransform : public AffineTransform<TParametersValueType, VDimension>
35 {
36 public:
37  ITK_DISALLOW_COPY_AND_MOVE(ScalableAffineTransform);
38 
44 
46  itkOverrideGetNameOfClassMacro(ScalableAffineTransform);
47 
49  itkNewMacro(Self);
50 
52  static constexpr unsigned int InputSpaceDimension = VDimension;
53  static constexpr unsigned int OutputSpaceDimension = VDimension;
54  static constexpr unsigned int SpaceDimension = VDimension;
55  static constexpr unsigned int ParametersDimension = VDimension * (VDimension + 1);
56 
58  using typename Superclass::ParametersType;
59  using typename Superclass::ParametersValueType;
60  using typename Superclass::FixedParametersType;
61  using typename Superclass::FixedParametersValueType;
62  using typename Superclass::JacobianType;
63  using typename Superclass::JacobianPositionType;
65  using typename Superclass::ScalarType;
66  using typename Superclass::InputVectorType;
67  using typename Superclass::OutputVectorType;
70  using typename Superclass::InputVnlVectorType;
71  using typename Superclass::OutputVnlVectorType;
72  using typename Superclass::InputPointType;
73  using typename Superclass::OutputPointType;
74  using typename Superclass::MatrixType;
75  using typename Superclass::MatrixValueType;
76  using typename Superclass::InverseMatrixType;
77  using typename Superclass::CenterType;
78  using typename Superclass::OffsetType;
79  using typename Superclass::TranslationType;
80 
85 
88  void
89  SetIdentity() override;
90 
92  virtual void
93  SetScale(const InputVectorType & scale);
94 
95  virtual void
97  {
98  this->SetScale(scale);
99  }
100 
102  virtual void
103  SetScale(const double scale[VDimension]);
104 
105  virtual void
106  SetScaleComponent(const double scale[VDimension])
107  {
108  this->SetScale(scale);
109  }
110 
112  virtual const double *
113  GetScale() const
114  {
115  return m_Scale;
116  }
117  virtual const double *
119  {
120  return m_Scale;
121  }
125  bool
126  GetInverse(Self * inverse) const;
127 
129  InverseTransformBasePointer
130  GetInverseTransform() const override;
131 
132 protected:
140 #if !defined(ITK_LEGACY_REMOVE)
141  [[deprecated("Removed unused constructor")]] ScalableAffineTransform(const MatrixType & matrix,
142  const OutputVectorType & offset);
143 #endif
144  ScalableAffineTransform(unsigned int outputSpaceDimension, unsigned int parametersDimension);
145  ScalableAffineTransform(unsigned int parametersDimension);
150  void
151  ComputeMatrix() override;
152 
153  ~ScalableAffineTransform() override = default;
154 
155  void
156  PrintSelf(std::ostream & os, Indent indent) const override;
157 
158  void
159  SetVarScale(const double * scale)
160  {
161  for (int i = 0; i < InputSpaceDimension; ++i)
162  {
163  m_Scale[i] = scale[i];
164  }
165  }
166 
167 private:
168  double m_Scale[VDimension]{};
169  InputVectorType m_MatrixScale{};
170 }; // class ScalableAffineTransform
171 } // namespace itk
172 
173 #ifndef ITK_MANUAL_INSTANTIATION
174 # include "itkScalableAffineTransform.hxx"
175 #endif
176 
177 #endif /* itkScalableAffineTransform_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< TParametersValueType, VDimension, VDimension >::MatrixValueType
typename MatrixType::ValueType MatrixValueType
Definition: itkMatrixOffsetTransformBase.h:181
itk::MatrixOffsetTransformBase< TParametersValueType, VDimension, VDimension >
itk::ScalableAffineTransform::SetVarScale
void SetVarScale(const double *scale)
Definition: itkScalableAffineTransform.h:159
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::ScalableAffineTransform::SetScaleComponent
virtual void SetScaleComponent(const InputVectorType &scale)
Definition: itkScalableAffineTransform.h:96
itk::MatrixOffsetTransformBase< TParametersValueType, VDimension, VDimension >::InverseJacobianPositionType
vnl_matrix_fixed< ParametersValueType, VInputDimension, VOutputDimension > InverseJacobianPositionType
Definition: itkTransform.h:132
itkAffineTransform.h
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::ScalableAffineTransform
Affine transformation with a specified center of rotation.
Definition: itkScalableAffineTransform.h:34
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
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::ScalableAffineTransform::GetScale
virtual const double * GetScale() const
Definition: itkScalableAffineTransform.h:113
AddImageFilter
Definition: itkAddImageFilter.h:81
itk::Array2D
Array2D class representing a 2D array.
Definition: itkArray2D.h:42
itk::AffineTransform::InverseTransformBaseType
typename Superclass::InverseTransformBaseType InverseTransformBaseType
Definition: itkAffineTransform.h:149
itk::ScalableAffineTransform::SetScaleComponent
virtual void SetScaleComponent(const double scale[VDimension])
Definition: itkScalableAffineTransform.h:106
itk::ScalableAffineTransform::GetScaleComponent
virtual const double * GetScaleComponent() const
Definition: itkScalableAffineTransform.h:118