ITK  5.4.0
Insight Toolkit
itkSimilarity2DTransform.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 itkSimilarity2DTransform_h
19 #define itkSimilarity2DTransform_h
20 
21 #include <iostream>
22 #include "itkRigid2DTransform.h"
23 
24 namespace itk
25 {
61 template <typename TParametersValueType = double>
62 class ITK_TEMPLATE_EXPORT Similarity2DTransform : public Rigid2DTransform<TParametersValueType>
63 {
64 public:
65  ITK_DISALLOW_COPY_AND_MOVE(Similarity2DTransform);
66 
72 
74  itkNewMacro(Self);
75 
77  itkOverrideGetNameOfClassMacro(Similarity2DTransform);
78 
80  static constexpr unsigned int SpaceDimension = 2;
81  static constexpr unsigned int InputSpaceDimension = 2;
82  static constexpr unsigned int OutputSpaceDimension = 2;
83  static constexpr unsigned int ParametersDimension = 4;
84 
85  using typename Superclass::ScalarType;
86  using ScaleType = TParametersValueType;
87 
89  using typename Superclass::ParametersType;
90  using typename Superclass::ParametersValueType;
91  using typename Superclass::FixedParametersType;
92  using typename Superclass::FixedParametersValueType;
93 
95  using typename Superclass::JacobianType;
96  using typename Superclass::JacobianPositionType;
97  using typename Superclass::InverseJacobianPositionType;
98 
100  using typename Superclass::OffsetType;
101  using typename Superclass::OffsetValueType;
102 
104  using typename Superclass::MatrixType;
105  using typename Superclass::MatrixValueType;
106 
108  using typename Superclass::InputPointType;
109  using typename Superclass::OutputPointType;
110 
112  using typename Superclass::InputVectorType;
113  using typename Superclass::OutputVectorType;
114 
116  using typename Superclass::InputCovariantVectorType;
117  using typename Superclass::OutputCovariantVectorType;
118 
120  using typename Superclass::InputVnlVectorType;
121  using typename Superclass::OutputVnlVectorType;
122 
125  using InverseTransformBaseType = typename Superclass::InverseTransformBaseType;
127 
129  void
130  SetScale(ScaleType scale);
131 
132  itkGetConstReferenceMacro(Scale, ScaleType);
133 
143  void
144  SetParameters(const ParametersType & parameters) override;
145 
155  const ParametersType &
156  GetParameters() const override;
157 
161  void
162  ComputeJacobianWithRespectToParameters(const InputPointType & p, JacobianType & jacobian) const override;
163 
165  void
166  SetIdentity() override;
167 
172  void
173  CloneInverseTo(Pointer & result) const;
174 
176  bool
177  GetInverse(Self * inverse) const;
178 
181  GetInverseTransform() const override;
182 
187  void
188  CloneTo(Pointer & result) const;
189 
203  void
204  SetMatrix(const MatrixType & matrix) override;
205 
219  void
220  SetMatrix(const MatrixType & matrix, const TParametersValueType tolerance) override;
221 
222 protected:
223  Similarity2DTransform(unsigned int outputSpaceDimension, unsigned int parametersDimension);
224  Similarity2DTransform(unsigned int parametersDimension);
226 
227  ~Similarity2DTransform() override = default;
228  void
229  PrintSelf(std::ostream & os, Indent indent) const override;
230 
234  void
235  ComputeMatrix() override;
236 
241  void
242  ComputeMatrixParameters() override;
243 
245  void
247  {
248  m_Scale = scale;
249  }
250 
251 private:
252  ScaleType m_Scale{};
253 }; // class Similarity2DTransform
254 } // namespace itk
255 
256 #ifndef ITK_MANUAL_INSTANTIATION
257 # include "itkSimilarity2DTransform.hxx"
258 #endif
259 
260 #endif /* itkSimilarity2DTransform_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
itkRigid2DTransform.h
itk::Similarity2DTransform::ScaleType
TParametersValueType ScaleType
Definition: itkSimilarity2DTransform.h:86
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::Rigid2DTransform
Rigid2DTransform of a vector space (e.g. space coordinates)
Definition: itkRigid2DTransform.h:56
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itk::Similarity2DTransform
Similarity2DTransform of a vector space (e.g. space coordinates)
Definition: itkSimilarity2DTransform.h:62
itk::Similarity2DTransform::SetVarScale
void SetVarScale(ScaleType scale)
Definition: itkSimilarity2DTransform.h:246
itk::OffsetValueType
long OffsetValueType
Definition: itkIntTypes.h:94
itk::Matrix< TParametersValueType, Self::OutputSpaceDimension, Self::InputSpaceDimension >
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::Rigid2DTransform::InverseTransformBasePointer
typename InverseTransformBaseType::Pointer InverseTransformBasePointer
Definition: itkRigid2DTransform.h:120
itk::Array2D
Array2D class representing a 2D array.
Definition: itkArray2D.h:42
itk::Rigid2DTransform::InverseTransformBaseType
typename Superclass::InverseTransformBaseType InverseTransformBaseType
Definition: itkRigid2DTransform.h:119