ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkSimilarity2DTransform.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 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 :
63  public Rigid2DTransform<TParametersValueType>
64 {
65 public:
66  ITK_DISALLOW_COPY_AND_ASSIGN(Similarity2DTransform);
67 
73 
75  itkNewMacro(Self);
76 
79 
81  static constexpr unsigned int SpaceDimension = 2;
82  static constexpr unsigned int InputSpaceDimension = 2;
83  static constexpr unsigned int OutputSpaceDimension = 2;
84  static constexpr unsigned int ParametersDimension = 4;
85 
86  using ScalarType = typename Superclass::ScalarType;
87  using ScaleType = TParametersValueType;
88 
90  using ParametersType = typename Superclass::ParametersType;
91  using ParametersValueType = typename Superclass::ParametersValueType;
92  using FixedParametersType = typename Superclass::FixedParametersType;
93  using FixedParametersValueType = typename Superclass::FixedParametersValueType;
94 
96  using JacobianType = typename Superclass::JacobianType;
97  using JacobianPositionType = typename Superclass::JacobianPositionType;
98  using InverseJacobianPositionType = typename Superclass::InverseJacobianPositionType;
99 
101  using OffsetType = typename Superclass::OffsetType;
103 
105  using MatrixType = typename Superclass::MatrixType;
106  using MatrixValueType = typename Superclass::MatrixValueType;
107 
109  using InputPointType = typename Superclass::InputPointType;
110  using OutputPointType = typename Superclass::OutputPointType;
111 
113  using InputVectorType = typename Superclass::InputVectorType;
114  using OutputVectorType = typename Superclass::OutputVectorType;
115 
117  using InputCovariantVectorType = typename Superclass::InputCovariantVectorType;
118  using OutputCovariantVectorType = typename Superclass::OutputCovariantVectorType;
119 
121  using InputVnlVectorType = typename Superclass::InputVnlVectorType;
122  using OutputVnlVectorType = typename Superclass::OutputVnlVectorType;
123 
126  using InverseTransformBaseType = typename Superclass::InverseTransformBaseType;
127  using InverseTransformBasePointer = typename InverseTransformBaseType::Pointer;
128 
130  void SetScale(ScaleType scale);
131 
132  itkGetConstReferenceMacro(Scale, ScaleType);
133 
143  void SetParameters(const ParametersType & parameters) override;
144 
154  const ParametersType & GetParameters() const override;
155 
159  void ComputeJacobianWithRespectToParameters( const InputPointType & p, JacobianType & jacobian) const override;
160 
162  void SetIdentity() override;
163 
168  void CloneInverseTo(Pointer & newinverse) const;
169 
171  bool GetInverse(Self *inverse) const;
172 
174  InverseTransformBasePointer GetInverseTransform() const override;
175 
180  void CloneTo(Pointer & clone) const;
181 
195  void SetMatrix(const MatrixType & matrix) override;
196 
210  void SetMatrix(const MatrixType & matrix, const TParametersValueType tolerance) override;
211 
212 protected:
213  Similarity2DTransform(unsigned int outputSpaceDimension, unsigned int parametersDimension);
214  Similarity2DTransform(unsigned int parametersDimension);
216 
217  ~Similarity2DTransform() override = default;
218  void PrintSelf(std::ostream & os, Indent indent) const override;
219 
223  void ComputeMatrix() override;
224 
229  void ComputeMatrixParameters() override;
230 
232  void SetVarScale(ScaleType scale)
233  {
234  m_Scale = scale;
235  }
236 
237 private:
239 }; // class Similarity2DTransform
240 } // namespace itk
241 
242 #ifndef ITK_MANUAL_INSTANTIATION
243 #include "itkSimilarity2DTransform.hxx"
244 #endif
245 
246 #endif /* itkSimilarity2DTransform_h */
typename Superclass::OffsetValueType OffsetValueType
Light weight base class for most itk classes.
Similarity2DTransform of a vector space (e.g. space coordinates)
typename Superclass::InputPointType InputPointType
typename Superclass::ParametersType ParametersType
typename Superclass::InverseTransformBaseType InverseTransformBaseType
typename Superclass::InputVnlVectorType InputVnlVectorType
typename Superclass::FixedParametersValueType FixedParametersValueType
typename Superclass::MatrixType MatrixType
typename Superclass::InputVectorType InputVectorType
typename Superclass::OutputPointType OutputPointType
typename Superclass::MatrixValueType MatrixValueType
typename Superclass::JacobianType JacobianType
typename Superclass::ScalarType ScalarType
typename Superclass::ParametersValueType ParametersValueType
typename Superclass::InverseJacobianPositionType InverseJacobianPositionType
typename Superclass::OutputVectorType OutputVectorType
typename Superclass::OffsetType OffsetType
typename Superclass::FixedParametersType FixedParametersType
Rigid2DTransform of a vector space (e.g. space coordinates)
Control indentation during Print() invocation.
Definition: itkIndent.h:49
typename Superclass::OutputCovariantVectorType OutputCovariantVectorType
typename Superclass::OutputVnlVectorType OutputVnlVectorType
typename InverseTransformBaseType::Pointer InverseTransformBasePointer
typename Superclass::JacobianPositionType JacobianPositionType
signed long OffsetValueType
Definition: itkIntTypes.h:94
typename Superclass::InputCovariantVectorType InputCovariantVectorType