ITK  5.4.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  * 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 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 VDimension = 3>
41 class ITK_TEMPLATE_EXPORT ScaleTransform
42  : public MatrixOffsetTransformBase<TParametersValueType, VDimension, VDimension>
43 {
44 public:
45  ITK_DISALLOW_COPY_AND_MOVE(ScaleTransform);
46 
52 
54  itkNewMacro(Self);
55 
57  itkOverrideGetNameOfClassMacro(ScaleTransform);
58 
60  static constexpr unsigned int SpaceDimension = VDimension;
61  static constexpr unsigned int ParametersDimension = VDimension;
62 
64  using typename Superclass::ScalarType;
65 
67  using typename Superclass::FixedParametersType;
68  using typename Superclass::ParametersType;
69 
71  using typename Superclass::JacobianType;
72  using typename Superclass::JacobianPositionType;
73  using typename Superclass::InverseJacobianPositionType;
74 
77 
81 
85 
87  using InputVnlVectorType = vnl_vector_fixed<TParametersValueType, VDimension>;
88  using OutputVnlVectorType = vnl_vector_fixed<TParametersValueType, VDimension>;
89 
93 
96  using InverseTransformBaseType = typename Superclass::InverseTransformBaseType;
98 
99  using 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 & p, 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 & vect) const override;
161 
163  TransformVector(const InputVnlVectorType & vect) const override;
164 
165  using Superclass::TransformCovariantVector;
167  TransformCovariantVector(const InputCovariantVectorType & vect) const override;
168 
173  inline InputPointType
174  BackTransform(const OutputPointType & point) const;
175 
176  inline InputVectorType
177  BackTransform(const OutputVectorType & vect) const;
178 
179  inline InputVnlVectorType
180  BackTransform(const OutputVnlVectorType & vect) const;
181 
183  BackTransform(const OutputCovariantVectorType & vect) 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 */
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
itk::OptimizerParameters
Class to hold and manage different parameter types used during optimization.
Definition: itkOptimizerParameters.h:36
itkMatrix.h
itk::Vector< TParametersValueType, VDimension >
itk::MatrixOffsetTransformBase
Matrix and Offset transformation of a vector space (e.g. space coordinates)
Definition: itkMatrixOffsetTransformBase.h:106
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::InverseTransformBaseType
typename Superclass::InverseTransformBaseType InverseTransformBaseType
Definition: itkScaleTransform.h:96
itk::ScaleTransform::InputVnlVectorType
vnl_vector_fixed< TParametersValueType, VDimension > InputVnlVectorType
Definition: itkScaleTransform.h:87
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itkMacro.h
itk::point
*par Constraints *The filter requires an image with at least two dimensions and a vector *length of at least The theory supports extension to scalar but *the implementation of the itk vector classes do not **The template parameter TRealType must be floating point(float or double) or *a user-defined "real" numerical type with arithmetic operations defined *sufficient to compute derivatives. **\par Performance *This filter will automatically multithread if run with *SetUsePrincipleComponents
itkMatrixOffsetTransformBase.h
itk::FixedArray< TParametersValueType, VDimension >
itk::CovariantVector
A templated class holding a n-Dimensional covariant vector.
Definition: itkCovariantVector.h:70
itk::Transform::JacobianPositionType
vnl_matrix_fixed< ParametersValueType, VOutputDimension, VInputDimension > JacobianPositionType
Definition: itkTransform.h:145
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::ScaleTransform::InverseTransformBasePointer
typename InverseTransformBaseType::Pointer InverseTransformBasePointer
Definition: itkScaleTransform.h:97
itk::Array2D
Array2D class representing a 2D array.
Definition: itkArray2D.h:42
itk::ScaleTransform::OutputVnlVectorType
vnl_vector_fixed< TParametersValueType, VDimension > OutputVnlVectorType
Definition: itkScaleTransform.h:88