00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
#ifndef __itkTranslationTransform_h
00019
#define __itkTranslationTransform_h
00020
00021
#include <iostream>
00022
#include "itkTransform.h"
00023
#include "itkExceptionObject.h"
00024
#include "itkMatrix.h"
00025
00026
00027
00028
00029
namespace itk
00030 {
00031
00039
template <
00040
class TScalarType=
double,
00041
unsigned int NDimensions=3>
00042 class ITK_EXPORT TranslationTransform :
00043
public Transform< TScalarType, NDimensions, NDimensions >
00044 {
00045
public:
00047 typedef TranslationTransform
Self;
00048 typedef Transform< TScalarType, NDimensions, NDimensions > Superclass;
00049 typedef SmartPointer<Self> Pointer;
00050 typedef SmartPointer<const Self> ConstPointer;
00051
00053
itkNewMacro(
Self );
00054
00056
itkTypeMacro( TranslationTransform,
Transform );
00057
00059
itkStaticConstMacro(SpaceDimension,
unsigned int, NDimensions);
00060
itkStaticConstMacro(ParametersDimension,
unsigned int, NDimensions);
00061
00063
typedef typename Superclass::ScalarType
ScalarType;
00064
00066
typedef typename Superclass::ParametersType
ParametersType;
00067
00069
typedef typename Superclass::JacobianType
JacobianType;
00070
00072
typedef Vector<TScalarType, itkGetStaticConstMacro(SpaceDimension)> InputVectorType;
00073 typedef Vector<TScalarType, itkGetStaticConstMacro(SpaceDimension)> OutputVectorType;
00074
00076
typedef CovariantVector<TScalarType, itkGetStaticConstMacro(SpaceDimension)> InputCovariantVectorType;
00077
typedef CovariantVector<TScalarType, itkGetStaticConstMacro(SpaceDimension)> OutputCovariantVectorType;
00078
00080
typedef vnl_vector_fixed<TScalarType, itkGetStaticConstMacro(SpaceDimension)>
InputVnlVectorType;
00081
typedef vnl_vector_fixed<TScalarType, itkGetStaticConstMacro(SpaceDimension)>
OutputVnlVectorType;
00082
00084 typedef Point<TScalarType, itkGetStaticConstMacro(SpaceDimension)> InputPointType;
00085
typedef Point<TScalarType, itkGetStaticConstMacro(SpaceDimension)> OutputPointType;
00086
00089 const OutputVectorType & GetOffset(
void)
const
00090
{
return m_Offset; }
00091
00094 void SetParameters(
const ParametersType & parameters);
00095
00097
virtual const ParametersType& GetParameters(
void) const;
00098
00102
void SetOffset(const
OutputVectorType &offset)
00103 { m_Offset = offset;
return; }
00104
00106
void Compose(
const Self * other,
bool pre=0);
00107
00112
void Translate(
const OutputVectorType &offset,
bool pre=0);
00113
00118
OutputPointType TransformPoint(
const InputPointType &point )
const;
00119
OutputVectorType TransformVector(
const InputVectorType &
vector)
const;
00120
OutputVnlVectorType TransformVector(
const InputVnlVectorType &
vector)
const;
00121
OutputCovariantVectorType TransformCovariantVector(
00122
const InputCovariantVectorType &
vector)
const;
00123
00127
inline InputPointType BackTransform(
const OutputPointType &point )
const;
00128
inline InputVectorType BackTransform(
const OutputVectorType &
vector)
const;
00129
inline InputVnlVectorType BackTransform(
const OutputVnlVectorType &
vector)
const;
00130
inline InputCovariantVectorType BackTransform(
00131
const OutputCovariantVectorType &
vector)
const;
00132
00137
typename TranslationTransform::Pointer Inverse(
void) const;
00138
00140 virtual const
JacobianType & GetJacobian(const
InputPointType &point ) const;
00141
00143
void SetIdentity(
void);
00144
00146 virtual
unsigned int GetNumberOfParameters(
void)
const
00147
{
return NDimensions; }
00148
00149
00150
protected:
00151 TranslationTransform();
00152 ~TranslationTransform();
00154
void PrintSelf(std::ostream &os,
Indent indent)
const;
00155
00156
private:
00157 TranslationTransform(
const Self&);
00158
void operator=(
const Self&);
00159
00160 OutputVectorType m_Offset;
00161
00162
00163 };
00164
00165
00166 }
00167
00168
00169
#ifndef ITK_MANUAL_INSTANTIATION
00170
#include "itkTranslationTransform.txx"
00171
#endif
00172
00173
#endif