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 
68 
70  typedef typename Superclass::JacobianType JacobianType;
71 
73  typedef Vector<TScalarType, itkGetStaticConstMacro(SpaceDimension)> InputVectorType;
74  typedef Vector<TScalarType, itkGetStaticConstMacro(SpaceDimension)> OutputVectorType;
75 
77  typedef CovariantVector<TScalarType, itkGetStaticConstMacro(SpaceDimension)> InputCovariantVectorType;
78  typedef CovariantVector<TScalarType, itkGetStaticConstMacro(SpaceDimension)> OutputCovariantVectorType;
79 
81  typedef vnl_vector_fixed<TScalarType, itkGetStaticConstMacro(SpaceDimension)> InputVnlVectorType;
82  typedef vnl_vector_fixed<TScalarType, itkGetStaticConstMacro(SpaceDimension)> OutputVnlVectorType;
83 
85  typedef Point<TScalarType, itkGetStaticConstMacro(SpaceDimension)> InputPointType;
86  typedef Point<TScalarType, itkGetStaticConstMacro(SpaceDimension)> OutputPointType;
87 
89  typedef typename Superclass
90  ::NonZeroJacobianIndicesType NonZeroJacobianIndicesType;
91  typedef typename Superclass::SpatialJacobianType SpatialJacobianType;
92  typedef typename Superclass
93  ::JacobianOfSpatialJacobianType JacobianOfSpatialJacobianType;
94  typedef typename Superclass::SpatialHessianType SpatialHessianType;
95  typedef typename Superclass
96  ::JacobianOfSpatialHessianType JacobianOfSpatialHessianType;
98 
102  const OutputVectorType & GetOffset(void) const
103  { return m_Offset; }
104 
107  void SetParameters(const ParametersType & parameters);
108 
110  virtual const ParametersType& GetParameters(void) const;
111 
115  void SetOffset(const OutputVectorType &offset)
116  { m_Offset = offset; return; }
117 
119  void Compose(const Self * other, bool pre=0);
120 
125  void Translate(const OutputVectorType &offset, bool pre=0);
126 
131  OutputPointType TransformPoint(const InputPointType &point ) const;
132  OutputVectorType TransformVector(const InputVectorType &vector) const;
133  OutputVnlVectorType TransformVector(const InputVnlVectorType &vector) const;
134  OutputCovariantVectorType TransformCovariantVector(
135  const InputCovariantVectorType &vector) const;
136 
140  inline InputPointType BackTransform(const OutputPointType &point ) const;
141  inline InputVectorType BackTransform(const OutputVectorType &vector) const;
142  inline InputVnlVectorType BackTransform(const OutputVnlVectorType &vector) const;
143  inline InputCovariantVectorType BackTransform(
144  const OutputCovariantVectorType &vector) const;
145 
150  bool GetInverse(Self* inverse) const;
151 
153  virtual void GetJacobian(
154  const InputPointType &,
155  JacobianType &,
156  NonZeroJacobianIndicesType & ) const;
157 
159  virtual void GetSpatialJacobian(
160  const InputPointType &,
161  SpatialJacobianType & ) const;
162 
164  virtual void GetSpatialHessian(
165  const InputPointType &,
166  SpatialHessianType & ) const;
167 
169  virtual void GetJacobianOfSpatialJacobian(
170  const InputPointType &,
171  JacobianOfSpatialJacobianType &,
172  NonZeroJacobianIndicesType & ) const;
173 
175  virtual void GetJacobianOfSpatialJacobian(
176  const InputPointType &,
177  SpatialJacobianType &,
178  JacobianOfSpatialJacobianType &,
179  NonZeroJacobianIndicesType & ) const;
180 
182  virtual void GetJacobianOfSpatialHessian(
183  const InputPointType &,
184  JacobianOfSpatialHessianType &,
185  NonZeroJacobianIndicesType & ) const;
186 
190  virtual void GetJacobianOfSpatialHessian(
191  const InputPointType & ipp,
192  SpatialHessianType & sh,
193  JacobianOfSpatialHessianType & jsh,
194  NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const;
195 
197  void SetIdentity(void);
198 
201  { return NDimensions; }
202 
208  virtual bool IsLinear() const { return true; }
209 
213  virtual void SetFixedParameters( const ParametersType & )
214  { /* purposely blank */ };
215 
219  virtual const ParametersType& GetFixedParameters(void) const
220  {
221  this->m_FixedParameters.SetSize(0);
222  return this->m_FixedParameters;
223  };
224 
225 protected:
229  void PrintSelf(std::ostream &os, Indent indent) const;
230 
231 private:
232  AdvancedTranslationTransform(const Self&); //purposely not implemented
233  void operator=(const Self&); //purposely not implemented
234 
235  OutputVectorType m_Offset; // Offset of the transformation
236 
243 
244 }; //class AdvancedTranslationTransform
245 
246 
247 // Back transform a point
248 template<class TScalarType, unsigned int NDimensions>
249 inline
252 BackTransform(const OutputPointType &point) const {
253  return point - m_Offset;
254 }
255 
256 
257 
258 
259 // Back transform a vector
260 template<class TScalarType, unsigned int NDimensions>
261 inline
264 BackTransform(const OutputVectorType &vect ) const
265 {
266  return vect;
267 }
268 
269 
270 
271 
272 // Back transform a vnl_vector
273 template<class TScalarType, unsigned int NDimensions>
274 inline
278 {
279  return vect;
280 }
281 
282 
283 // Back Transform a CovariantVector
284 template<class TScalarType, unsigned int NDimensions>
285 inline
289 {
290  return vect;
291 }
292 
293 } // namespace itk
294 
295 // Define instantiation macro for this template.
296 #define ITK_TEMPLATE_AdvancedTranslationTransform(_, EXPORT, x, y) namespace itk { \
297  _(2(class EXPORT AdvancedTranslationTransform< ITK_TEMPLATE_2 x >)) \
298  namespace Templates { typedef AdvancedTranslationTransform< ITK_TEMPLATE_2 x > AdvancedTranslationTransform##y; } \
299  }
300 
301 #if ITK_TEMPLATE_EXPLICIT
302 # include "Templates/itkAdvancedTranslationTransform+-.h"
303 #endif
304 
305 #if ITK_TEMPLATE_TXX
306 # include "itkAdvancedTranslationTransform.txx"
307 #endif
308 
309 #endif /* __itkAdvancedTranslationTransform_h */
JacobianOfSpatialHessianType m_JacobianOfSpatialHessian
Superclass::JacobianOfSpatialJacobianType JacobianOfSpatialJacobianType
Superclass::NumberOfParametersType NumberOfParametersType
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
virtual NumberOfParametersType GetNumberOfParameters(void) const


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