go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkAdvancedRigid2DTransform.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Insight Segmentation & Registration Toolkit
4  Module: $RCSfile: itkAdvancedRigid2DTransform.h,v $
5  Language: C++
6  Date: $Date: 2009-01-14 18:39:05 $
7  Version: $Revision: 1.22 $
8 
9  Copyright (c) Insight Software Consortium. All rights reserved.
10  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
11 
12  This software is distributed WITHOUT ANY WARRANTY; without even
13  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14  PURPOSE. See the above copyright notices for more information.
15 
16 =========================================================================*/
17 #ifndef __itkAdvancedRigid2DTransform_h
18 #define __itkAdvancedRigid2DTransform_h
19 
20 #include <iostream>
22 #include "itkExceptionObject.h"
23 
24 namespace itk
25 {
26 
57 template < class TScalarType=double > // Data type for scalars (float or double)
58 class ITK_EXPORT AdvancedRigid2DTransform :
59  public AdvancedMatrixOffsetTransformBase< TScalarType, 2, 2> // Dimensions of input and output spaces
60 {
61 public:
65  typedef SmartPointer<Self> Pointer;
66  typedef SmartPointer<const Self> ConstPointer;
67 
70 
72  itkNewMacro( Self );
73 
75  itkStaticConstMacro(InputSpaceDimension, unsigned int, 2);
76  itkStaticConstMacro(OutputSpaceDimension, unsigned int, 2);
77  itkStaticConstMacro(ParametersDimension, unsigned int, 3);
78 
81 
85 
88 
91 
94 
98 
102 
106 
110 
111  typedef typename Superclass
114  typedef typename Superclass
117  typedef typename Superclass
120 
133  virtual void SetMatrix( const MatrixType & matrix );
134 
140  virtual void SetRotationMatrix(const MatrixType &matrix)
141  { this->SetMatrix( matrix ); }
143  { return this->GetMatrix(); }
144 
145 
153  void Translate(const OffsetType &offset, bool pre=false);
154 
163  inline InputPointType BackTransform(const OutputPointType &point ) const;
164  inline InputVectorType BackTransform(const OutputVectorType &vector) const;
165  inline InputVnlVectorType BackTransform(const OutputVnlVectorType &vector) const;
166 
167  inline InputCovariantVectorType BackTransform(
168  const OutputCovariantVectorType &vector) const;
169 
171  void SetAngle(TScalarType angle);
172  itkGetConstReferenceMacro( Angle, TScalarType );
173 
175  void SetAngleInDegrees(TScalarType angle);
176 
180  void SetRotation(TScalarType angle)
181  { this->SetAngle(angle); }
182  virtual const TScalarType & GetRotation() const
183  { return m_Angle; }
184 
193  void SetParameters( const ParametersType & parameters );
194 
203  const ParametersType & GetParameters( void ) const;
204 
209  virtual void GetJacobian(
210  const InputPointType &,
211  JacobianType &,
212  NonZeroJacobianIndicesType & ) const;
213 
218  void CloneInverseTo( Pointer & newinverse ) const;
219 
224  void CloneTo( Pointer & clone ) const;
225 
227  virtual void SetIdentity(void);
228 
229 
230 protected:
232  AdvancedRigid2DTransform( unsigned int parametersDimension );
233  AdvancedRigid2DTransform( unsigned int outputSpaceDimension, unsigned int parametersDimension );
234 
236 
240  void PrintSelf(std::ostream &os, Indent indent) const;
241 
246  virtual void ComputeMatrix(void);
247 
252  virtual void ComputeMatrixParameters(void);
253 
255  void SetVarAngle( TScalarType angle )
256  { m_Angle = angle; }
257 
259  virtual void PrecomputeJacobianOfSpatialJacobian(void);
260 
261 
262 private:
263  AdvancedRigid2DTransform(const Self&); //purposely not implemented
264  void operator=(const Self&); //purposely not implemented
265 
266  TScalarType m_Angle;
267 
268 }; //class AdvancedRigid2DTransform
269 
270 
271 // Back transform a point
272 template<class TScalarType>
273 inline
276 BackTransform(const OutputPointType &point) const
277 {
278  itkWarningMacro(
279  <<"BackTransform(): This method is slated to be removed from ITK. Instead, please use GetInverse() to generate an inverse transform and then perform the transform using that inverted transform."
280  );
281  return this->GetInverseMatrix() * (point - this->GetOffset());
282 }
283 
284 // Back transform a vector
285 template<class TScalarType>
286 inline
289 BackTransform(const OutputVectorType &vect ) const
290 {
291  itkWarningMacro(
292  <<"BackTransform(): This method is slated to be removed from ITK. Instead, please use GetInverse() to generate an inverse transform and then perform the transform using that inverted transform."
293  );
294  return this->GetInverseMatrix() * vect;
295 }
296 
297 // Back transform a vnl_vector
298 template<class TScalarType>
299 inline
303 {
304  itkWarningMacro(
305  <<"BackTransform(): This method is slated to be removed from ITK. Instead, please use GetInverse() to generate an inverse transform and then perform the transform using that inverted transform."
306  );
307  return this->GetInverseMatrix() * vect;
308 }
309 
310 
311 // Back Transform a CovariantVector
312 template<class TScalarType>
313 inline
317 {
318  itkWarningMacro(
319  <<"BackTransform(): This method is slated to be removed from ITK. Instead, please use GetInverse() to generate an inverse transform and then perform the transform using that inverted transform."
320  );
321  return this->GetMatrix() * vect;
322 }
323 
324 } // namespace itk
325 
326 
327 // Define instantiation macro for this template.
328 #define ITK_TEMPLATE_AdvancedRigid2DTransform(_, EXPORT, x, y) namespace itk { \
329  _(1(class EXPORT AdvancedRigid2DTransform< ITK_TEMPLATE_1 x >)) \
330  namespace Templates { typedef AdvancedRigid2DTransform< ITK_TEMPLATE_1 x > AdvancedRigid2DTransform##y; } \
331  }
332 
333 #if ITK_TEMPLATE_EXPLICIT
334 # include "Templates/itkAdvancedRigid2DTransform+-.h"
335 #endif
336 
337 #if ITK_TEMPLATE_TXX
338 # include "itkAdvancedRigid2DTransform.txx"
339 #endif
340 
341 #endif /* __itkAdvancedRigid2DTransform_h */
Superclass::NumberOfParametersType NumberOfParametersType
const MatrixType & GetRotationMatrix() const
SmartPointer< const Self > ConstPointer
Superclass::JacobianOfSpatialHessianType JacobianOfSpatialHessianType
AdvancedMatrixOffsetTransformBase< TScalarType, 2, 2 > Superclass
Superclass::InputVnlVectorType InputVnlVectorType
Standard vnl_vector type for this class.
Superclass::InputCovariantVectorType InputCovariantVectorType
Standard covariant vector type for this class.
Superclass::SpatialJacobianType SpatialJacobianType
Superclass::OutputCovariantVectorType OutputCovariantVectorType
Superclass::OutputPointType OutputPointType
InputPointType BackTransform(const OutputPointType &point) const
Superclass::OutputVnlVectorType OutputVnlVectorType
virtual const TScalarType & GetRotation() const
Superclass::MatrixType MatrixType
Standard matrix type for this class.
Superclass::NonZeroJacobianIndicesType NonZeroJacobianIndicesType
virtual void SetRotationMatrix(const MatrixType &matrix)
Superclass::InternalMatrixType InternalMatrixType
Superclass::ParametersType ParametersType
AdvancedRigid2DTransform of a vector space (e.g. space coordinates)
Superclass::InputVectorType InputVectorType
Standard vector type for this class.
Superclass::InputPointType InputPointType
Standard coordinate point type for this class.
Superclass::SpatialHessianType SpatialHessianType
Superclass::JacobianOfSpatialJacobianType JacobianOfSpatialJacobianType
Superclass::OffsetType OffsetType
Standard vector type for this class.
Superclass::OutputVectorType OutputVectorType


Generated on 04-01-2014 for elastix by doxygen 1.8.5 elastix logo