go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkAdvancedTranslationTransform.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Insight Segmentation & Registration Toolkit
4  Module: $RCSfile: itkAdvancedTranslationTransform.h,v $
5  Language: C++
6  Date: $Date: 2007-07-15 16:38:25 $
7  Version: $Revision: 1.36 $
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 __itkAdvancedTranslationTransform_h
19 #define __itkAdvancedTranslationTransform_h
20 
21 #include <iostream>
22 #include "itkAdvancedTransform.h"
23 #include "itkExceptionObject.h"
24 #include "itkMatrix.h"
25 
26 
27 
28 
29 namespace itk
30 {
31 
39 template <
40  class TScalarType=double, // Data type for scalars (float or double)
41  unsigned int NDimensions=3> // Number of dimensions
42 class ITK_EXPORT AdvancedTranslationTransform :
43  public AdvancedTransform< TScalarType, NDimensions, NDimensions >
44 {
45 public:
49  typedef SmartPointer<Self> Pointer;
50  typedef SmartPointer<const Self> ConstPointer;
51 
53  itkNewMacro( Self );
54 
57 
59  itkStaticConstMacro(SpaceDimension, unsigned int, NDimensions);
60  itkStaticConstMacro(ParametersDimension, unsigned int, NDimensions);
61 
64 
67 
70 
72  typedef Vector<TScalarType, itkGetStaticConstMacro(SpaceDimension)> InputVectorType;
73  typedef Vector<TScalarType, itkGetStaticConstMacro(SpaceDimension)> OutputVectorType;
74 
76  typedef CovariantVector<TScalarType, itkGetStaticConstMacro(SpaceDimension)> InputCovariantVectorType;
77  typedef CovariantVector<TScalarType, itkGetStaticConstMacro(SpaceDimension)> OutputCovariantVectorType;
78 
80  typedef vnl_vector_fixed<TScalarType, itkGetStaticConstMacro(SpaceDimension)> InputVnlVectorType;
81  typedef vnl_vector_fixed<TScalarType, itkGetStaticConstMacro(SpaceDimension)> OutputVnlVectorType;
82 
84  typedef Point<TScalarType, itkGetStaticConstMacro(SpaceDimension)> InputPointType;
85  typedef Point<TScalarType, itkGetStaticConstMacro(SpaceDimension)> OutputPointType;
86 
88  typedef typename Superclass
89  ::NonZeroJacobianIndicesType NonZeroJacobianIndicesType;
90  typedef typename Superclass::SpatialJacobianType SpatialJacobianType;
91  typedef typename Superclass
92  ::JacobianOfSpatialJacobianType JacobianOfSpatialJacobianType;
93  typedef typename Superclass::SpatialHessianType SpatialHessianType;
94  typedef typename Superclass
95  ::JacobianOfSpatialHessianType JacobianOfSpatialHessianType;
97 
101  const OutputVectorType & GetOffset(void) const
102  { return m_Offset; }
103 
106  void SetParameters(const ParametersType & parameters);
107 
109  virtual const ParametersType& GetParameters(void) const;
110 
114  void SetOffset(const OutputVectorType &offset)
115  { m_Offset = offset; return; }
116 
118  void Compose(const Self * other, bool pre=0);
119 
124  void Translate(const OutputVectorType &offset, bool pre=0);
125 
130  OutputPointType TransformPoint(const InputPointType &point ) const;
131  OutputVectorType TransformVector(const InputVectorType &vector) const;
132  OutputVnlVectorType TransformVector(const InputVnlVectorType &vector) const;
133  OutputCovariantVectorType TransformCovariantVector(
134  const InputCovariantVectorType &vector) const;
135 
139  inline InputPointType BackTransform(const OutputPointType &point ) const;
140  inline InputVectorType BackTransform(const OutputVectorType &vector) const;
141  inline InputVnlVectorType BackTransform(const OutputVnlVectorType &vector) const;
142  inline InputCovariantVectorType BackTransform(
143  const OutputCovariantVectorType &vector) const;
144 
149  bool GetInverse(Self* inverse) const;
150 
152  virtual const JacobianType & GetJacobian(const InputPointType &point ) const;
153 
155  virtual void GetJacobian(
156  const InputPointType &,
157  JacobianType &,
158  NonZeroJacobianIndicesType & ) const;
159 
161  virtual void GetSpatialJacobian(
162  const InputPointType &,
163  SpatialJacobianType & ) const;
164 
166  virtual void GetSpatialHessian(
167  const InputPointType &,
168  SpatialHessianType & ) const;
169 
171  virtual void GetJacobianOfSpatialJacobian(
172  const InputPointType &,
173  JacobianOfSpatialJacobianType &,
174  NonZeroJacobianIndicesType & ) const;
175 
177  virtual void GetJacobianOfSpatialJacobian(
178  const InputPointType &,
179  SpatialJacobianType &,
180  JacobianOfSpatialJacobianType &,
181  NonZeroJacobianIndicesType & ) const;
182 
184  virtual void GetJacobianOfSpatialHessian(
185  const InputPointType &,
186  JacobianOfSpatialHessianType &,
187  NonZeroJacobianIndicesType & ) const;
188 
192  virtual void GetJacobianOfSpatialHessian(
193  const InputPointType & ipp,
194  SpatialHessianType & sh,
195  JacobianOfSpatialHessianType & jsh,
196  NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const;
197 
199  void SetIdentity(void);
200 
202  virtual unsigned int GetNumberOfParameters(void) const
203  { return NDimensions; }
204 
210  virtual bool IsLinear() const { return true; }
211 
215  virtual void SetFixedParameters( const ParametersType & )
216  { /* purposely blank */ };
217 
221  virtual const ParametersType& GetFixedParameters(void) const
222  {
223  this->m_FixedParameters.SetSize(0);
224  return this->m_FixedParameters;
225  };
226 
227 protected:
231  void PrintSelf(std::ostream &os, Indent indent) const;
232 
233 private:
234  AdvancedTranslationTransform(const Self&); //purposely not implemented
235  void operator=(const Self&); //purposely not implemented
236 
237  OutputVectorType m_Offset; // Offset of the transformation
238 
244 
245 }; //class AdvancedTranslationTransform
246 
247 
248 // Back transform a point
249 template<class TScalarType, unsigned int NDimensions>
250 inline
253 BackTransform(const OutputPointType &point) const {
254  return point - m_Offset;
255 }
256 
257 
258 
259 
260 // Back transform a vector
261 template<class TScalarType, unsigned int NDimensions>
262 inline
265 BackTransform(const OutputVectorType &vect ) const
266 {
267  return vect;
268 }
269 
270 
271 
272 
273 // Back transform a vnl_vector
274 template<class TScalarType, unsigned int NDimensions>
275 inline
279 {
280  return vect;
281 }
282 
283 
284 // Back Transform a CovariantVector
285 template<class TScalarType, unsigned int NDimensions>
286 inline
290 {
291  return vect;
292 }
293 
294 } // namespace itk
295 
296 // Define instantiation macro for this template.
297 #define ITK_TEMPLATE_AdvancedTranslationTransform(_, EXPORT, x, y) namespace itk { \
298  _(2(class EXPORT AdvancedTranslationTransform< ITK_TEMPLATE_2 x >)) \
299  namespace Templates { typedef AdvancedTranslationTransform< ITK_TEMPLATE_2 x > AdvancedTranslationTransform##y; } \
300  }
301 
302 #if ITK_TEMPLATE_EXPLICIT
303 # include "Templates/itkAdvancedTranslationTransform+-.h"
304 #endif
305 
306 #if ITK_TEMPLATE_TXX
307 # include "itkAdvancedTranslationTransform.txx"
308 #endif
309 
310 #endif /* __itkAdvancedTranslationTransform_h */
JacobianOfSpatialHessianType m_JacobianOfSpatialHessian
Superclass::JacobianOfSpatialJacobianType JacobianOfSpatialJacobianType
virtual unsigned int GetNumberOfParameters(void) const
Point< TScalarType, itkGetStaticConstMacro(SpaceDimension)> OutputPointType
Vector< TScalarType, itkGetStaticConstMacro(SpaceDimension)> InputVectorType
vnl_vector_fixed< TScalarType, itkGetStaticConstMacro(SpaceDimension)> InputVnlVectorType
CovariantVector< TScalarType, itkGetStaticConstMacro(SpaceDimension)> OutputCovariantVectorType
Superclass::NonZeroJacobianIndicesType NonZeroJacobianIndicesType
Superclass::JacobianOfSpatialHessianType JacobianOfSpatialHessianType
virtual void SetFixedParameters(const ParametersType &)
JacobianOfSpatialJacobianType m_JacobianOfSpatialJacobian
void SetOffset(const OutputVectorType &offset)
Vector< TScalarType, itkGetStaticConstMacro(SpaceDimension)> OutputVectorType
Superclass::SpatialJacobianType SpatialJacobianType
Transform maps points, vectors and covariant vectors from an input space to an output space...
const OutputVectorType & GetOffset(void) const
virtual const ParametersType & GetFixedParameters(void) const
Point< TScalarType, itkGetStaticConstMacro(SpaceDimension)> InputPointType
InputPointType BackTransform(const OutputPointType &point) const
CovariantVector< TScalarType, itkGetStaticConstMacro(SpaceDimension)> InputCovariantVectorType
Translation transformation of a vector space (e.g. space coordinates)
Superclass::InternalMatrixType InternalMatrixType
Superclass::SpatialHessianType SpatialHessianType
AdvancedTransform< TScalarType, NDimensions, NDimensions > Superclass
vnl_vector_fixed< TScalarType, itkGetStaticConstMacro(SpaceDimension)> OutputVnlVectorType


Generated on 06-12-2013 for elastix by doxygen 1.8.5 elastix logo