ITK  4.3.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 
221 private:
222  Similarity2DTransform(const Self &); // purposely not implemented
223  void operator=(const Self &); // purposely not implemented
224 
226 }; // class Similarity2DTransform
227 } // namespace itk
228 
229 #ifndef ITK_MANUAL_INSTANTIATION
230 #include "itkSimilarity2DTransform.hxx"
231 #endif
232 
233 #endif /* __itkSimilarity2DTransform_h */
234