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 >
58 // Data type for scalars (float or double)
60  public AdvancedMatrixOffsetTransformBase< TScalarType, 2, 2 > // Dimensions of input and output spaces
61 {
62 public:
63 
67  typedef SmartPointer< Self > Pointer;
68  typedef SmartPointer< const Self > ConstPointer;
69 
72 
74  itkNewMacro( Self );
75 
77  itkStaticConstMacro( InputSpaceDimension, unsigned int, 2 );
78  itkStaticConstMacro( OutputSpaceDimension, unsigned int, 2 );
79  itkStaticConstMacro( ParametersDimension, unsigned int, 3 );
80 
83 
87 
90 
93 
96 
100 
104 
108 
112 
113  typedef typename Superclass
116  typedef typename Superclass
119  typedef typename Superclass
122 
135  virtual void SetMatrix( const MatrixType & matrix );
136 
142  virtual void SetRotationMatrix( const MatrixType & matrix )
143  { this->SetMatrix( matrix ); }
145  { return this->GetMatrix(); }
146 
154  void Translate( const OffsetType & offset, bool pre = false );
155 
164  inline InputPointType BackTransform( const OutputPointType & point ) const;
165 
166  inline InputVectorType BackTransform( const OutputVectorType & vector ) const;
167 
168  inline InputVnlVectorType BackTransform( const OutputVnlVectorType & vector ) const;
169 
171  const OutputCovariantVectorType & vector ) const;
172 
174  void SetAngle( TScalarType angle );
175 
176  itkGetConstReferenceMacro( Angle, TScalarType );
177 
179  void SetAngleInDegrees( TScalarType angle );
180 
184  void SetRotation( TScalarType angle )
185  { this->SetAngle( angle ); }
186  virtual const TScalarType & GetRotation() const
187  { return m_Angle; }
188 
197  void SetParameters( const ParametersType & parameters );
198 
207  const ParametersType & GetParameters( void ) const;
208 
213  virtual void GetJacobian(
214  const InputPointType &,
215  JacobianType &,
216  NonZeroJacobianIndicesType & ) const;
217 
222  void CloneInverseTo( Pointer & newinverse ) const;
223 
228  void CloneTo( Pointer & clone ) const;
229 
231  virtual void SetIdentity( void );
232 
233 protected:
234 
236  AdvancedRigid2DTransform( unsigned int parametersDimension );
237  AdvancedRigid2DTransform( unsigned int outputSpaceDimension, unsigned int parametersDimension );
238 
240 
244  void PrintSelf( std::ostream & os, Indent indent ) const;
245 
250  virtual void ComputeMatrix( void );
251 
256  virtual void ComputeMatrixParameters( void );
257 
259  void SetVarAngle( TScalarType angle )
260  { m_Angle = angle; }
261 
263  virtual void PrecomputeJacobianOfSpatialJacobian( void );
264 
265 private:
266 
267  AdvancedRigid2DTransform( const Self & ); // purposely not implemented
268  void operator=( const Self & ); // purposely not implemented
269 
270  TScalarType m_Angle;
271 
272 };
273 
274 // Back transform a point
275 template< class TScalarType >
276 inline
279 {
280  itkWarningMacro(
281  << "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."
282  );
283  return this->GetInverseMatrix() * ( point - this->GetOffset() );
284 }
285 
286 
287 // Back transform a vector
288 template< class TScalarType >
289 inline
292 ::BackTransform( const OutputVectorType & vect ) const
293 {
294  itkWarningMacro(
295  << "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."
296  );
297  return this->GetInverseMatrix() * vect;
298 }
299 
300 
301 // Back transform a vnl_vector
302 template< class TScalarType >
303 inline
307 {
308  itkWarningMacro(
309  << "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."
310  );
311  return this->GetInverseMatrix() * vect;
312 }
313 
314 
315 // Back Transform a CovariantVector
316 template< class TScalarType >
317 inline
321 {
322  itkWarningMacro(
323  << "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."
324  );
325  return this->GetMatrix() * vect;
326 }
327 
328 
329 } // namespace itk
330 
331 #ifndef ITK_MANUAL_INSTANTIATION
332 #include "itkAdvancedRigid2DTransform.hxx"
333 #endif
334 
335 #endif /* __itkAdvancedRigid2DTransform_h */
virtual void ComputeMatrixParameters(void)
Superclass::NumberOfParametersType NumberOfParametersType
SmartPointer< const Self > ConstPointer
void SetAngle(TScalarType angle)
const ParametersType & GetParameters(void) const
virtual void SetIdentity(void)
const MatrixType & GetRotationMatrix() const
void PrintSelf(std::ostream &os, Indent indent) const
Superclass::JacobianOfSpatialHessianType JacobianOfSpatialHessianType
AdvancedMatrixOffsetTransformBase< TScalarType, 2, 2 > Superclass
void SetParameters(const ParametersType &parameters)
Superclass::InputVnlVectorType InputVnlVectorType
Standard vnl_vector type for this class.
Superclass::InputCovariantVectorType InputCovariantVectorType
Standard covariant vector type for this class.
Superclass::SpatialJacobianType SpatialJacobianType
virtual void SetMatrix(const MatrixType &matrix)
void CloneInverseTo(Pointer &newinverse) const
Superclass::OutputCovariantVectorType OutputCovariantVectorType
virtual void PrecomputeJacobianOfSpatialJacobian(void)
Superclass::OutputPointType OutputPointType
InputPointType BackTransform(const OutputPointType &point) const
itkStaticConstMacro(InputSpaceDimension, unsigned int, 2)
Superclass::OutputVnlVectorType OutputVnlVectorType
virtual const TScalarType & GetRotation() const
Superclass::MatrixType MatrixType
Standard matrix type for this class.
virtual void ComputeMatrix(void)
void operator=(const Self &)
virtual void GetJacobian(const InputPointType &, JacobianType &, NonZeroJacobianIndicesType &) const
Superclass::NonZeroJacobianIndicesType NonZeroJacobianIndicesType
virtual void SetRotationMatrix(const MatrixType &matrix)
void Translate(const OffsetType &offset, bool pre=false)
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
void SetAngleInDegrees(TScalarType angle)
Superclass::OffsetType OffsetType
Standard vector type for this class.
void CloneTo(Pointer &clone) const
Superclass::OutputVectorType OutputVectorType


Generated on 11-03-2014 for elastix by doxygen 1.8.6 elastix logo