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 #ifndef __itkAdvancedTranslationTransform_h
18 #define __itkAdvancedTranslationTransform_h
19 
20 #include <iostream>
21 #include "itkAdvancedTransform.h"
22 #include "itkExceptionObject.h"
23 #include "itkMatrix.h"
24 
25 namespace itk
26 {
27 
35 template<
36 class TScalarType = double, // Data type for scalars (float or double)
37 unsigned int NDimensions = 3 >
38 // Number of dimensions
39 class ITK_EXPORT AdvancedTranslationTransform :
40  public AdvancedTransform< TScalarType, NDimensions, NDimensions >
41 {
42 public:
43 
47  typedef SmartPointer< Self > Pointer;
48  typedef SmartPointer< const Self > ConstPointer;
49 
51  itkNewMacro( Self );
52 
55 
57  itkStaticConstMacro( SpaceDimension, unsigned int, NDimensions );
58  itkStaticConstMacro( ParametersDimension, unsigned int, NDimensions );
59 
62 
66  typedef typename Superclass::TransformCategoryType TransformCategoryType;
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
91  typedef typename Superclass
94  typedef typename Superclass
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 
132  OutputVectorType TransformVector( const InputVectorType & vector ) const;
133 
134  OutputVnlVectorType TransformVector( const InputVnlVectorType & vector ) const;
135 
136  OutputCovariantVectorType TransformCovariantVector(
137  const InputCovariantVectorType & vector ) const;
138 
142  inline InputPointType BackTransform( const OutputPointType & point ) const;
143 
144  inline InputVectorType BackTransform( const OutputVectorType & vector ) const;
145 
146  inline InputVnlVectorType BackTransform( const OutputVnlVectorType & vector ) const;
147 
148  inline InputCovariantVectorType BackTransform(
149  const OutputCovariantVectorType & vector ) const;
150 
155  bool GetInverse( Self * inverse ) const;
156 
158  virtual void GetJacobian(
159  const InputPointType &,
160  JacobianType &,
161  NonZeroJacobianIndicesType & ) const;
162 
164  virtual void GetSpatialJacobian(
165  const InputPointType &,
166  SpatialJacobianType & ) const;
167 
169  virtual void GetSpatialHessian(
170  const InputPointType &,
171  SpatialHessianType & ) const;
172 
174  virtual void GetJacobianOfSpatialJacobian(
175  const InputPointType &,
176  JacobianOfSpatialJacobianType &,
177  NonZeroJacobianIndicesType & ) const;
178 
180  virtual void GetJacobianOfSpatialJacobian(
181  const InputPointType &,
182  SpatialJacobianType &,
183  JacobianOfSpatialJacobianType &,
184  NonZeroJacobianIndicesType & ) const;
185 
187  virtual void GetJacobianOfSpatialHessian(
188  const InputPointType &,
189  JacobianOfSpatialHessianType &,
190  NonZeroJacobianIndicesType & ) const;
191 
195  virtual void GetJacobianOfSpatialHessian(
196  const InputPointType & ipp,
197  SpatialHessianType & sh,
198  JacobianOfSpatialHessianType & jsh,
199  NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const;
200 
202  void SetIdentity( void );
203 
206  { return NDimensions; }
207 
213  virtual bool IsLinear() const { return true; }
214 
219  {
220  return Self::Linear;
221  }
222 
223 
227  virtual void SetFixedParameters( const ParametersType & )
228  { /* purposely blank */ }
229 
233  virtual const ParametersType & GetFixedParameters( void ) const
234  {
235  this->m_FixedParameters.SetSize( 0 );
236  return this->m_FixedParameters;
237  }
238 
239 
240 protected:
241 
245  void PrintSelf( std::ostream & os, Indent indent ) const;
246 
247 private:
248 
249  AdvancedTranslationTransform( const Self & ); //purposely not implemented
250  void operator=( const Self & ); //purposely not implemented
251 
252  OutputVectorType m_Offset; // Offset of the transformation
253 
260 
261 };
262 
263 //class AdvancedTranslationTransform
264 
265 // Back transform a point
266 template< class TScalarType, unsigned int NDimensions >
267 inline
270 {
271  return point - m_Offset;
272 }
273 
274 
275 // Back transform a vector
276 template< class TScalarType, unsigned int NDimensions >
277 inline
280 {
281  return vect;
282 }
283 
284 
285 // Back transform a vnl_vector
286 template< class TScalarType, unsigned int NDimensions >
287 inline
290 {
291  return vect;
292 }
293 
294 
295 // Back Transform a CovariantVector
296 template< class TScalarType, unsigned int NDimensions >
297 inline
300 {
301  return vect;
302 }
303 
304 
305 } // namespace itk
306 
307 #ifndef ITK_MANUAL_INSTANTIATION
308 #include "itkAdvancedTranslationTransform.hxx"
309 #endif
310 
311 #endif /* __itkAdvancedTranslationTransform_h */
JacobianOfSpatialHessianType m_JacobianOfSpatialHessian
Superclass::JacobianOfSpatialJacobianType JacobianOfSpatialJacobianType
Matrix< ScalarType, OutputSpaceDimension, InputSpaceDimension > SpatialJacobianType
Superclass::NumberOfParametersType NumberOfParametersType
virtual TransformCategoryType GetTransformCategory() const
Vector< TScalarType, itkGetStaticConstMacro(SpaceDimension) > OutputVectorType
Vector< TScalarType, itkGetStaticConstMacro(SpaceDimension) > InputVectorType
Superclass::NonZeroJacobianIndicesType NonZeroJacobianIndicesType
Superclass::JacobianOfSpatialHessianType JacobianOfSpatialHessianType
virtual void SetFixedParameters(const ParametersType &)
Superclass::TransformCategoryType TransformCategoryType
JacobianOfSpatialJacobianType m_JacobianOfSpatialJacobian
void SetOffset(const OutputVectorType &offset)
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
InputPointType BackTransform(const OutputPointType &point) const
vnl_vector_fixed< TScalarType, itkGetStaticConstMacro(SpaceDimension) > InputVnlVectorType
CovariantVector< TScalarType, itkGetStaticConstMacro(SpaceDimension) > InputCovariantVectorType
Translation transformation of a vector space (e.g. space coordinates)
Superclass::InternalMatrixType InternalMatrixType
CovariantVector< TScalarType, itkGetStaticConstMacro(SpaceDimension) > OutputCovariantVectorType
Superclass::SpatialHessianType SpatialHessianType
AdvancedTransform< TScalarType, NDimensions, NDimensions > Superclass
vnl_vector_fixed< TScalarType, itkGetStaticConstMacro(SpaceDimension) > OutputVnlVectorType
FixedArray< Matrix< ScalarType, InputSpaceDimension, InputSpaceDimension >, OutputSpaceDimension > SpatialHessianType
Point< TScalarType, itkGetStaticConstMacro(SpaceDimension) > InputPointType
Point< TScalarType, itkGetStaticConstMacro(SpaceDimension) > OutputPointType
virtual NumberOfParametersType GetNumberOfParameters(void) const


Generated on 27-04-2014 for elastix by doxygen 1.8.6 elastix logo