ITK  4.2.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 <class TScalarType = double>
62 // Data type for scalars (float or double)
63 class ITK_EXPORT Similarity2DTransform :
64  public Rigid2DTransform<TScalarType>
65 {
66 public:
72 
74  itkNewMacro(Self);
75 
78 
80  itkStaticConstMacro(SpaceDimension, unsigned int, 2);
81  itkStaticConstMacro(InputSpaceDimension, unsigned int, 2);
82  itkStaticConstMacro(OutputSpaceDimension, unsigned int, 2);
83  itkStaticConstMacro(ParametersDimension, unsigned int, 4);
85 
87  typedef typename Superclass::ScalarType ScalarType;
88  typedef TScalarType ScaleType;
89 
91  typedef typename Superclass::ParametersType ParametersType;
92  typedef typename Superclass::ParametersValueType ParametersValueType;
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  void SetParameters(const ParametersType & parameters);
141 
151  const ParametersType & GetParameters(void) const;
152 
156  virtual void ComputeJacobianWithRespectToParameters( const InputPointType & p, JacobianType & jacobian) const;
157 
159  virtual void SetIdentity(void);
160 
165  void CloneInverseTo(Pointer & newinverse) const;
166 
168  bool GetInverse(Self *inverse) const;
169 
171  virtual InverseTransformBasePointer GetInverseTransform() const;
172 
177  void CloneTo(Pointer & clone) const;
178 
192  virtual void SetMatrix(const MatrixType & matrix);
193 
194 protected:
195  Similarity2DTransform(unsigned int outputSpaceDimension, unsigned int parametersDimension);
196  Similarity2DTransform(unsigned int parametersDimension);
198 
200  {
201  }
202  void PrintSelf(std::ostream & os, Indent indent) const;
203 
207  virtual void ComputeMatrix(void);
208 
213  virtual void ComputeMatrixParameters(void);
214 
216  void SetVarScale(ScaleType scale)
217  {
218  m_Scale = scale;
219  }
220 private:
221  Similarity2DTransform(const Self &); // purposely not implemented
222  void operator=(const Self &); // purposely not implemented
224 
226 }; // class Similarity2DTransform
227 } // namespace itk
228 
229 // Define instantiation macro for this template.
230 #define ITK_TEMPLATE_Similarity2DTransform(_, EXPORT, TypeX, TypeY) \
231  namespace itk \
232  { \
233  _( 1 ( class EXPORT Similarity2DTransform<ITK_TEMPLATE_1 TypeX> ) ) \
234  namespace Templates \
235  { \
236  typedef Similarity2DTransform<ITK_TEMPLATE_1 TypeX> Similarity2DTransform##TypeY; \
237  } \
238  }
239 
240 #if ITK_TEMPLATE_EXPLICIT
241 #include "Templates/itkSimilarity2DTransform+-.h"
242 #endif
243 
244 #if ITK_TEMPLATE_TXX
245 #include "itkSimilarity2DTransform.hxx"
246 #endif
247 
248 #endif /* __itkSimilarity2DTransform_h */
249