ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkScaleTransform.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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,
41  unsigned int NDimensions=3>
42 class ITK_TEMPLATE_EXPORT ScaleTransform : public MatrixOffsetTransformBase<TParametersValueType,
43  NDimensions,
44  NDimensions>
45 {
46 public:
47  ITK_DISALLOW_COPY_AND_ASSIGN(ScaleTransform);
48 
54 
56  itkNewMacro(Self);
57 
59  itkTypeMacro(ScaleTransform, Transform);
60 
62  static constexpr unsigned int SpaceDimension = NDimensions;
63  static constexpr unsigned int ParametersDimension = NDimensions;
64 
66  using ScalarType = typename Superclass::ScalarType;
67 
69  using FixedParametersType = typename Superclass::FixedParametersType;
70  using ParametersType = typename Superclass::ParametersType;
71 
73  using JacobianType = typename Superclass::JacobianType;
74  using JacobianPositionType = typename Superclass::JacobianPositionType;
75  using InverseJacobianPositionType = typename Superclass::InverseJacobianPositionType;
76 
79 
83 
87 
89  using InputVnlVectorType = vnl_vector_fixed<TParametersValueType, NDimensions>;
90  using OutputVnlVectorType = vnl_vector_fixed<TParametersValueType, NDimensions>;
91 
95 
98  using InverseTransformBaseType = typename Superclass::InverseTransformBaseType;
99  using InverseTransformBasePointer = typename InverseTransformBaseType::Pointer;
100 
101  using MatrixType = typename Superclass::MatrixType;
102 
107  void SetParameters(const ParametersType & parameters) override;
108 
113  const ParametersType & GetParameters() const override;
114 
116  void ComputeJacobianWithRespectToParameters(const InputPointType & point, JacobianType & j) const override;
117 
122  void ComputeJacobianWithRespectToPosition(const InputPointType & x, JacobianPositionType & jac) const override;
123  using Superclass::ComputeJacobianWithRespectToPosition;
124 
133  void SetScale(const ScaleType & scale);
134 
135  void ComputeMatrix() override;
136 
138  void Compose(const Self *other, bool pre = false);
139 
143  void Scale(const ScaleType & scale, bool pre = false);
144 
149  OutputPointType TransformPoint(const InputPointType & point) const override;
150 
151  using Superclass::TransformVector;
152  OutputVectorType TransformVector(const InputVectorType & vector) const override;
153 
154  OutputVnlVectorType TransformVector(const InputVnlVectorType & vector) const override;
155 
156  using Superclass::TransformCovariantVector;
157  OutputCovariantVectorType TransformCovariantVector(const InputCovariantVectorType & vector) const override;
158 
163  inline InputPointType BackTransform(const OutputPointType & point) const;
164 
165  inline InputVectorType BackTransform(const OutputVectorType & vector) const;
166 
167  inline InputVnlVectorType BackTransform(const OutputVnlVectorType & vector) const;
168 
169  inline InputCovariantVectorType BackTransform(const OutputCovariantVectorType & vector) const;
170 
175  bool GetInverse(Self *inverse) const;
176 
178  InverseTransformBasePointer GetInverseTransform() const override;
179 
183  void SetIdentity() override;
184 
186  itkGetConstReferenceMacro(Scale, ScaleType);
187 
188 protected:
190  ScaleTransform();
191 
193  ~ScaleTransform() override = default;
194 
196  void PrintSelf(std::ostream & os, Indent indent) const override;
197 
198 private:
199  ScaleType m_Scale; // Scales of the transformation
200 
201 }; // class ScaleTransform
202 
203 } // end namespace itk
204 
205 #ifndef ITK_MANUAL_INSTANTIATION
206 #include "itkScaleTransform.hxx"
207 #endif
208 
209 #endif /* itkScaleTransform_h */
typename Superclass::ScalarType ScalarType
Light weight base class for most itk classes.
typename Superclass::FixedParametersType FixedParametersType
Matrix and Offset transformation of a vector space (e.g. space coordinates)
vnl_vector_fixed< TParametersValueType, NDimensions > OutputVnlVectorType
typename Superclass::MatrixType MatrixType
typename Superclass::JacobianType JacobianType
typename Superclass::JacobianPositionType JacobianPositionType
Transform points and vectors from an input space to an output space.
Definition: itkTransform.h:83
typename Superclass::ParametersType ParametersType
Scale transformation of a vector space (e.g. space coordinates)
typename Superclass::InverseTransformBaseType InverseTransformBaseType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
typename Superclass::InverseJacobianPositionType InverseJacobianPositionType
vnl_vector_fixed< TParametersValueType, NDimensions > InputVnlVectorType
A templated class holding a geometric point in n-Dimensional space.
Definition: itkPoint.h:52
A templated class holding a n-Dimensional covariant vector.
typename InverseTransformBaseType::Pointer InverseTransformBasePointer