ITK  4.13.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:
71 
73  itkNewMacro(Self);
74 
77 
79  itkStaticConstMacro(SpaceDimension, unsigned int, 2);
80  itkStaticConstMacro(InputSpaceDimension, unsigned int, 2);
81  itkStaticConstMacro(OutputSpaceDimension, unsigned int, 2);
82  itkStaticConstMacro(ParametersDimension, unsigned int, 4);
84 
85  typedef typename Superclass::ScalarType ScalarType;
86  typedef TParametersValueType ScaleType;
87 
89  typedef typename Superclass::ParametersType ParametersType;
90  typedef typename Superclass::ParametersValueType ParametersValueType;
91  typedef typename Superclass::FixedParametersType FixedParametersType;
92  typedef typename Superclass::FixedParametersValueType FixedParametersValueType;
93 
95  typedef typename Superclass::JacobianType JacobianType;
96 
98  typedef typename Superclass::OffsetType OffsetType;
100 
102  typedef typename Superclass::MatrixType MatrixType;
103  typedef typename Superclass::MatrixValueType MatrixValueType;
104 
106  typedef typename Superclass::InputPointType InputPointType;
107  typedef typename Superclass::OutputPointType OutputPointType;
108 
110  typedef typename Superclass::InputVectorType InputVectorType;
111  typedef typename Superclass::OutputVectorType OutputVectorType;
112 
114  typedef typename Superclass::InputCovariantVectorType InputCovariantVectorType;
115  typedef typename Superclass::OutputCovariantVectorType OutputCovariantVectorType;
116 
118  typedef typename Superclass::InputVnlVectorType InputVnlVectorType;
119  typedef typename Superclass::OutputVnlVectorType OutputVnlVectorType;
120 
123  typedef typename Superclass::InverseTransformBaseType InverseTransformBaseType;
124  typedef typename InverseTransformBaseType::Pointer InverseTransformBasePointer;
125 
127  void SetScale(ScaleType scale);
128 
129  itkGetConstReferenceMacro(Scale, ScaleType);
130 
140  virtual void SetParameters(const ParametersType & parameters) ITK_OVERRIDE;
141 
151  virtual const ParametersType & GetParameters() const ITK_OVERRIDE;
152 
156  virtual void ComputeJacobianWithRespectToParameters( const InputPointType & p, JacobianType & jacobian) const ITK_OVERRIDE;
157 
159  virtual void SetIdentity() ITK_OVERRIDE;
160 
165  void CloneInverseTo(Pointer & newinverse) const;
166 
168  bool GetInverse(Self *inverse) const;
169 
171  virtual InverseTransformBasePointer GetInverseTransform() const ITK_OVERRIDE;
172 
177  void CloneTo(Pointer & clone) const;
178 
192  virtual void SetMatrix(const MatrixType & matrix) ITK_OVERRIDE;
193 
207  virtual void SetMatrix(const MatrixType & matrix, const TParametersValueType tolerance) ITK_OVERRIDE;
208 
209 protected:
210  Similarity2DTransform(unsigned int outputSpaceDimension, unsigned int parametersDimension);
211  Similarity2DTransform(unsigned int parametersDimension);
213 
214  ~Similarity2DTransform() ITK_OVERRIDE {}
215  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
216 
220  virtual void ComputeMatrix(void) ITK_OVERRIDE;
221 
226  virtual void ComputeMatrixParameters(void) ITK_OVERRIDE;
227 
229  void SetVarScale(ScaleType scale)
230  {
231  m_Scale = scale;
232  }
233 
234 private:
235  ITK_DISALLOW_COPY_AND_ASSIGN(Similarity2DTransform);
236 
238 }; // class Similarity2DTransform
239 } // namespace itk
240 
241 #ifndef ITK_MANUAL_INSTANTIATION
242 #include "itkSimilarity2DTransform.hxx"
243 #endif
244 
245 #endif /* itkSimilarity2DTransform_h */
Light weight base class for most itk classes.
Similarity2DTransform of a vector space (e.g. space coordinates)
Rigid2DTransform< TParametersValueType > Superclass
InverseTransformBaseType::Pointer InverseTransformBasePointer
Superclass::InputPointType InputPointType
SmartPointer< const Self > ConstPointer
signed long OffsetValueType
Definition: itkIntTypes.h:154
Superclass::InputPointType InputPointType
Superclass::OutputCovariantVectorType OutputCovariantVectorType
Superclass::InputCovariantVectorType InputCovariantVectorType
Superclass::MatrixValueType MatrixValueType
Superclass::ScalarType ScalarType
Superclass::ParametersType ParametersType
Superclass::OffsetType OffsetType
Superclass::JacobianType JacobianType
Superclass::FixedParametersValueType FixedParametersValueType
Superclass::FixedParametersType FixedParametersType
Superclass::ParametersValueType ParametersValueType
InverseTransformBaseType::Pointer InverseTransformBasePointer
Superclass::InverseTransformBaseType InverseTransformBaseType
Superclass::ParametersType ParametersType
Superclass::OutputPointType OutputPointType
Superclass::OffsetValueType OffsetValueType
Superclass::InputVectorType InputVectorType
Rigid2DTransform of a vector space (e.g. space coordinates)
Superclass::OutputVectorType OutputVectorType
Superclass::OutputVnlVectorType OutputVnlVectorType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Superclass::MatrixType MatrixType
Superclass::JacobianType JacobianType
Superclass::InputVnlVectorType InputVnlVectorType