ITK  6.0.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 {
44 template <typename TParametersValueType = float, unsigned int VDimension = 3>
45 class ITK_TEMPLATE_EXPORT ScaleTransform
46  : public MatrixOffsetTransformBase<TParametersValueType, VDimension, VDimension>
47 {
48 public:
49  ITK_DISALLOW_COPY_AND_MOVE(ScaleTransform);
50 
56 
58  itkNewMacro(Self);
59 
61  itkOverrideGetNameOfClassMacro(ScaleTransform);
62 
64  static constexpr unsigned int SpaceDimension = VDimension;
65  static constexpr unsigned int ParametersDimension = VDimension;
66 
68  using typename Superclass::ScalarType;
69 
71  using typename Superclass::FixedParametersType;
72  using typename Superclass::ParametersType;
73 
75  using typename Superclass::JacobianType;
76  using typename Superclass::JacobianPositionType;
78 
81 
85 
89 
91  using InputVnlVectorType = vnl_vector_fixed<TParametersValueType, VDimension>;
92  using OutputVnlVectorType = vnl_vector_fixed<TParametersValueType, VDimension>;
93 
97 
102 
103  using typename Superclass::MatrixType;
104 
109  void
110  SetParameters(const ParametersType & parameters) override;
111 
116  const ParametersType &
117  GetParameters() const override;
118 
120  void
121  ComputeJacobianWithRespectToParameters(const InputPointType & p, JacobianType & j) const override;
122 
127  void
128  ComputeJacobianWithRespectToPosition(const InputPointType & x, JacobianPositionType & jac) const override;
129  using Superclass::ComputeJacobianWithRespectToPosition;
130 
139  void
140  SetScale(const ScaleType & scale);
141 
142  void
143  ComputeMatrix() override;
144 
146  void
147  Compose(const Self * other, bool pre = false);
148 
152  void
153  Scale(const ScaleType & scale, bool pre = false);
154 
160  TransformPoint(const InputPointType & point) const override;
161 
162  using Superclass::TransformVector;
164  TransformVector(const InputVectorType & vect) const override;
165 
167  TransformVector(const InputVnlVectorType & vect) const override;
168 
169  using Superclass::TransformCovariantVector;
171  TransformCovariantVector(const InputCovariantVectorType & vect) const override;
172 
177  inline InputPointType
178  BackTransform(const OutputPointType & point) const;
179 
180  inline InputVectorType
181  BackTransform(const OutputVectorType & vect) const;
182 
183  inline InputVnlVectorType
184  BackTransform(const OutputVnlVectorType & vect) const;
185 
187  BackTransform(const OutputCovariantVectorType & vect) const;
188 
193  bool
194  GetInverse(Self * inverse) const;
195 
198  GetInverseTransform() const override;
199 
203  void
204  SetIdentity() override;
205 
207  itkGetConstReferenceMacro(Scale, ScaleType);
208 
209 protected:
211  ScaleTransform();
212 
214  ~ScaleTransform() override = default;
215 
217  void
218  PrintSelf(std::ostream & os, Indent indent) const override;
219 
220 private:
221  ScaleType m_Scale{}; // Scales of the transformation
222 
223 }; // class ScaleTransform
224 
225 } // end namespace itk
226 
227 #ifndef ITK_MANUAL_INSTANTIATION
228 # include "itkScaleTransform.hxx"
229 #endif
230 
231 #endif /* itkScaleTransform_h */
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
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::MatrixOffsetTransformBase< TParametersValueType, VDimension, VDimension >::InverseJacobianPositionType
vnl_matrix_fixed< ParametersValueType, VInputDimension, VOutputDimension > InverseJacobianPositionType
Definition: itkTransform.h:132
itk::ScaleTransform
Scale transformation of a vector space (e.g. space coordinates)
Definition: itkScaleTransform.h:45
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::ScaleTransform::InverseTransformBaseType
typename Superclass::InverseTransformBaseType InverseTransformBaseType
Definition: itkScaleTransform.h:100
itk::ScaleTransform::InputVnlVectorType
vnl_vector_fixed< TParametersValueType, VDimension > InputVnlVectorType
Definition: itkScaleTransform.h:91
itk::MatrixOffsetTransformBase< TParametersValueType, VDimension, VDimension >::InverseTransformBaseType
typename Superclass::InverseTransformBaseType InverseTransformBaseType
Definition: itkMatrixOffsetTransformBase.h:197
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::Matrix< TParametersValueType, Self::OutputSpaceDimension, Self::InputSpaceDimension >
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:131
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
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:101
itk::Array2D
Array2D class representing a 2D array.
Definition: itkArray2D.h:42
itk::ScaleTransform::OutputVnlVectorType
vnl_vector_fixed< TParametersValueType, VDimension > OutputVnlVectorType
Definition: itkScaleTransform.h:92