| 1 |
|
/*========================================================================= |
| 2 |
|
|
| 3 |
|
Program: Insight Segmentation & Registration Toolkit |
| 4 |
|
Module: $RCSfile: itkCenteredAffineTransform.h.html,v $ |
| 5 |
|
Language: C++ |
| 6 |
|
Date: $Date: 2006/01/17 19:15:33 $ |
| 7 |
|
Version: $Revision: 1.4 $ |
| 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 |
|
|
| 18 |
|
#ifndef __itkCenteredAffineTransform_h |
| 19 |
|
#define __itkCenteredAffineTransform_h |
| 20 |
|
|
| 21 |
|
#include "itkAffineTransform.h" |
| 22 |
|
|
| 23 |
|
namespace itk |
| 24 |
|
{ |
| 25 |
|
|
| 26 |
|
|
| 27 |
|
/** |
| 28 |
|
* \brief Affine transformation with a specified center of rotation. |
| 29 |
|
* |
| 30 |
LEN |
* This class implements an Affine transform in which the rotation center can be explicitly selected. |
| 31 |
LEN |
* Note that the method "ComputeOffset()" must be called just before using the transform for mapping |
| 32 |
LEN |
* points, vectors or covariantvectors. This is necessary for updating the offset of the transform |
| 33 |
|
* taking into account the center of rotation. |
| 34 |
|
* |
| 35 |
|
* |
| 36 |
|
* \ingroup Transforms |
| 37 |
|
* |
| 38 |
|
* |
| 39 |
|
*/ |
| 40 |
|
|
| 41 |
|
template < |
| 42 |
LEN |
class TScalarType=double, // Data type for scalars (e.g. float or double) |
| 43 |
|
unsigned int NDimensions=3> // Number of dimensions in the input space |
| 44 |
LEN |
class ITK_EXPORT CenteredAffineTransform : public AffineTransform< TScalarType, NDimensions > |
| 45 |
|
{ |
| 46 |
|
public: |
| 47 |
|
/** Standard typedefs */ |
| 48 |
|
typedef CenteredAffineTransform Self; |
| 49 |
TDA |
typedef AffineTransform< TScalarType, NDimensions > Superclass; |
| 50 |
TDA |
typedef SmartPointer<Self> Pointer; |
| 51 |
TDA |
typedef SmartPointer<const Self> ConstPointer; |
| 52 |
|
|
| 53 |
|
/** Run-time type information (and related methods). */ |
| 54 |
|
itkTypeMacro( CenteredAffineTransform, AffineTransform ); |
| 55 |
|
|
| 56 |
|
/** New macro for creation of through a Smart Pointer */ |
| 57 |
|
itkNewMacro( Self ); |
| 58 |
|
|
| 59 |
|
/** Dimension of the domain space. */ |
| 60 |
|
itkStaticConstMacro(SpaceDimension, unsigned int, NDimensions); |
| 61 |
|
itkStaticConstMacro(ParametersDimension, unsigned int, |
| 62 |
|
NDimensions*(NDimensions+2)); |
| 63 |
|
|
| 64 |
|
|
| 65 |
|
/** Types taken from the Superclass */ |
| 66 |
|
typedef typename Superclass::ParametersType ParametersType; |
| 67 |
|
typedef typename Superclass::JacobianType JacobianType; |
| 68 |
|
typedef typename Superclass::ScalarType ScalarType; |
| 69 |
|
typedef typename Superclass::InputVectorType InputVectorType; |
| 70 |
|
typedef typename Superclass::OutputVectorType OutputVectorType; |
| 71 |
LEN |
typedef typename Superclass::InputCovariantVectorType InputCovariantVectorType; |
| 72 |
LEN |
typedef typename Superclass::OutputCovariantVectorType OutputCovariantVectorType; |
| 73 |
|
typedef typename Superclass::InputVnlVectorType InputVnlVectorType; |
| 74 |
|
typedef typename Superclass::OutputVnlVectorType OutputVnlVectorType; |
| 75 |
|
typedef typename Superclass::InputPointType InputPointType; |
| 76 |
|
typedef typename Superclass::OutputPointType OutputPointType; |
| 77 |
|
typedef typename Superclass::MatrixType MatrixType; |
| 78 |
|
typedef typename Superclass::OffsetType OffsetType; |
| 79 |
|
|
| 80 |
|
|
| 81 |
|
|
| 82 |
|
/** Set/Get the transformation from a container of parameters. |
| 83 |
|
* The first (NDimension x NDimension) parameters define the |
| 84 |
|
* matrix, the next N parameters define the center of rotation |
| 85 |
|
* and the last N parameters define the translation to be applied |
| 86 |
|
* after the coordinate system has been restored to the rotation center. |
| 87 |
|
* Note that the Offset of the superclass is no longer in the |
| 88 |
|
* parameters array since it is fully dependent on the rotation |
| 89 |
|
* center and the translation parameters. */ |
| 90 |
|
void SetParameters( const ParametersType & parameters ); |
| 91 |
|
const ParametersType& GetParameters(void) const; |
| 92 |
|
|
| 93 |
|
/** Compute the Jacobian of the transformation |
| 94 |
|
* |
| 95 |
|
* This method computes the Jacobian matrix of the transformation. |
| 96 |
|
* given point or vector, returning the transformed point or |
| 97 |
|
* vector. The rank of the Jacobian will also indicate if the transform |
| 98 |
|
* is invertible at this point. */ |
| 99 |
|
const JacobianType & GetJacobian(const InputPointType &point ) const; |
| 100 |
|
|
| 101 |
|
protected: |
| 102 |
|
/** Construct an CenteredAffineTransform object **/ |
| 103 |
IND |
*****CenteredAffineTransform(); |
| 104 |
|
|
| 105 |
|
/** Destroy an CenteredAffineTransform object **/ |
| 106 |
|
virtual ~CenteredAffineTransform(); |
| 107 |
|
|
| 108 |
|
private: |
| 109 |
|
CenteredAffineTransform(const Self & other); |
| 110 |
|
const Self & operator=( const Self & ); |
| 111 |
|
|
| 112 |
|
}; //class CenteredAffineTransform |
| 113 |
|
|
| 114 |
|
} // namespace itk |
| 115 |
|
|
| 116 |
|
|
| 117 |
|
#ifndef ITK_MANUAL_INSTANTIATION |
| 118 |
|
#include "itkCenteredAffineTransform.txx" |
| 119 |
|
#endif |
| 120 |
|
|
| 121 |
|
#endif /* __itkCenteredAffineTransform_h */ |
| 122 |
|
|
| 123 |
EOF |
|
| 124 |
EOF,EML |
|
| 125 |
EOF,EML |
|
| 126 |
EOF,EML |
|
| 127 |
EOF,EML |
|