ITK  5.2.0
Insight Toolkit
itkScaleTransform.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 itkScaleTransform_h
19 #define itkScaleTransform_h
20 
22 #include "itkMacro.h"
23 #include "itkMatrix.h"
24 
25 namespace itk
26 {
40 template <typename TParametersValueType = float, unsigned int NDimensions = 3>
41 class ITK_TEMPLATE_EXPORT ScaleTransform
42  : public MatrixOffsetTransformBase<TParametersValueType, NDimensions, NDimensions>
43 {
44 public:
45  ITK_DISALLOW_COPY_AND_ASSIGN(ScaleTransform);
46 
52 
54  itkNewMacro(Self);
55 
57  itkTypeMacro(ScaleTransform, Transform);
58 
60  static constexpr unsigned int SpaceDimension = NDimensions;
61  static constexpr unsigned int ParametersDimension = NDimensions;
62 
64  using ScalarType = typename Superclass::ScalarType;
65 
67  using FixedParametersType = typename Superclass::FixedParametersType;
68  using ParametersType = typename Superclass::ParametersType;
69 
71  using JacobianType = typename Superclass::JacobianType;
72  using JacobianPositionType = typename Superclass::JacobianPositionType;
73  using InverseJacobianPositionType = typename Superclass::InverseJacobianPositionType;
74 
77 
81 
85 
87  using InputVnlVectorType = vnl_vector_fixed<TParametersValueType, NDimensions>;
88  using OutputVnlVectorType = vnl_vector_fixed<TParametersValueType, NDimensions>;
89 
93 
96  using InverseTransformBaseType = typename Superclass::InverseTransformBaseType;
97  using InverseTransformBasePointer = typename InverseTransformBaseType::Pointer;
98 
99  using MatrixType = typename Superclass::MatrixType;
100 
105  void
106  SetParameters(const ParametersType & parameters) override;
107 
112  const ParametersType &
113  GetParameters() const override;
114 
116  void
117  ComputeJacobianWithRespectToParameters(const InputPointType & point, JacobianType & j) const override;
118 
123  void
124  ComputeJacobianWithRespectToPosition(const InputPointType & x, JacobianPositionType & jac) const override;
125  using Superclass::ComputeJacobianWithRespectToPosition;
126 
135  void
136  SetScale(const ScaleType & scale);
137 
138  void
139  ComputeMatrix() override;
140 
142  void
143  Compose(const Self * other, bool pre = false);
144 
148  void
149  Scale(const ScaleType & scale, bool pre = false);
150 
156  TransformPoint(const InputPointType & point) const override;
157 
158  using Superclass::TransformVector;
160  TransformVector(const InputVectorType & vector) const override;
161 
163  TransformVector(const InputVnlVectorType & vector) const override;
164 
165  using Superclass::TransformCovariantVector;
167  TransformCovariantVector(const InputCovariantVectorType & vector) const override;
168 
173  inline InputPointType
174  BackTransform(const OutputPointType & point) const;
175 
176  inline InputVectorType
177  BackTransform(const OutputVectorType & vector) const;
178 
179  inline InputVnlVectorType
180  BackTransform(const OutputVnlVectorType & vector) const;
181 
183  BackTransform(const OutputCovariantVectorType & vector) const;
184 
189  bool
190  GetInverse(Self * inverse) const;
191 
194  GetInverseTransform() const override;
195 
199  void
200  SetIdentity() override;
201 
203  itkGetConstReferenceMacro(Scale, ScaleType);
204 
205 protected:
207  ScaleTransform();
208 
210  ~ScaleTransform() override = default;
211 
213  void
214  PrintSelf(std::ostream & os, Indent indent) const override;
215 
216 private:
217  ScaleType m_Scale; // Scales of the transformation
218 
219 }; // class ScaleTransform
220 
221 } // end namespace itk
222 
223 #ifndef ITK_MANUAL_INSTANTIATION
224 # include "itkScaleTransform.hxx"
225 #endif
226 
227 #endif /* itkScaleTransform_h */
itk::ScaleTransform::InverseJacobianPositionType
typename Superclass::InverseJacobianPositionType InverseJacobianPositionType
Definition: itkScaleTransform.h:73
itk::ScaleTransform::JacobianType
typename Superclass::JacobianType JacobianType
Definition: itkScaleTransform.h:71
itk::ScaleTransform::InputVnlVectorType
vnl_vector_fixed< TParametersValueType, NDimensions > InputVnlVectorType
Definition: itkScaleTransform.h:87
itkMatrix.h
itk::ScaleTransform::ScalarType
typename Superclass::ScalarType ScalarType
Definition: itkScaleTransform.h:64
itk::ScaleTransform::InverseTransformBasePointer
typename InverseTransformBaseType::Pointer InverseTransformBasePointer
Definition: itkScaleTransform.h:97
itk::ScaleTransform::m_Scale
ScaleType m_Scale
Definition: itkScaleTransform.h:217
itk::Vector< TParametersValueType, NDimensions >
itk::MatrixOffsetTransformBase
Matrix and Offset transformation of a vector space (e.g. space coordinates)
Definition: itkMatrixOffsetTransformBase.h:106
itk::ScaleTransform::InverseTransformBaseType
typename Superclass::InverseTransformBaseType InverseTransformBaseType
Definition: itkScaleTransform.h:96
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::ScaleTransform
Scale transformation of a vector space (e.g. space coordinates)
Definition: itkScaleTransform.h:41
itk::ScaleTransform::MatrixType
typename Superclass::MatrixType MatrixType
Definition: itkScaleTransform.h:99
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itkMacro.h
itkMatrixOffsetTransformBase.h
itk::FixedArray< TParametersValueType, NDimensions >
itk::CovariantVector
A templated class holding a n-Dimensional covariant vector.
Definition: itkCovariantVector.h:70
itk::ScaleTransform::ParametersType
typename Superclass::ParametersType ParametersType
Definition: itkScaleTransform.h:68
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::Point
A templated class holding a geometric point in n-Dimensional space.
Definition: itkPoint.h:53
itk::Transform
Transform points and vectors from an input space to an output space.
Definition: itkTransform.h:82
itk::ScaleTransform::OutputVnlVectorType
vnl_vector_fixed< TParametersValueType, NDimensions > OutputVnlVectorType
Definition: itkScaleTransform.h:88
itk::ScaleTransform::FixedParametersType
typename Superclass::FixedParametersType FixedParametersType
Definition: itkScaleTransform.h:67
itk::ScaleTransform::JacobianPositionType
typename Superclass::JacobianPositionType JacobianPositionType
Definition: itkScaleTransform.h:72