go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkAdvancedIdentityTransform.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Insight Segmentation & Registration Toolkit
4  Module: $RCSfile: itkIdentityTransform.h,v $
5  Language: C++
6  Date: $Date: 2009-06-28 14:41:47 $
7  Version: $Revision: 1.19 $
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 __itkAdvancedIdentityTransform_h
18 #define __itkAdvancedIdentityTransform_h
19 
20 #include "itkObject.h"
21 #include "itkPoint.h"
22 #include "itkVector.h"
23 #include "itkCovariantVector.h"
24 #include "vnl/vnl_vector_fixed.h"
25 #include "itkArray.h"
26 #include "itkArray2D.h"
27 #include "itkAdvancedTransform.h"
28 
29 #include "itkObjectFactory.h"
30 
31 
32 namespace itk
33 {
34 
54 template <class TScalarType,
55  unsigned int NDimensions=3>
56 class ITK_EXPORT AdvancedIdentityTransform
57  : public AdvancedTransform<TScalarType,NDimensions,NDimensions>
58 {
59 public:
62  typedef AdvancedTransform<
63  TScalarType,NDimensions,NDimensions> Superclass;
64  typedef SmartPointer< Self > Pointer;
65  typedef SmartPointer< const Self > ConstPointer;
66 
68  itkNewMacro( Self );
69 
72 
74  itkStaticConstMacro( InputSpaceDimension, unsigned int, NDimensions );
75  itkStaticConstMacro( OutputSpaceDimension, unsigned int, NDimensions );
76  itkStaticConstMacro( ParametersDimension, unsigned int, 1 );
77 
79  typedef TScalarType ScalarType;
80 
83 
86 
88  typedef Vector<TScalarType,
89  itkGetStaticConstMacro(InputSpaceDimension)> InputVectorType;
90  typedef Vector<TScalarType,
91  itkGetStaticConstMacro(OutputSpaceDimension)> OutputVectorType;
92 
94  typedef CovariantVector<TScalarType,
95  itkGetStaticConstMacro(InputSpaceDimension)> InputCovariantVectorType;
96  typedef CovariantVector<TScalarType,
97  itkGetStaticConstMacro(OutputSpaceDimension)> OutputCovariantVectorType;
98 
100  typedef vnl_vector_fixed<TScalarType,
101  itkGetStaticConstMacro(InputSpaceDimension)> InputVnlVectorType;
102  typedef vnl_vector_fixed<TScalarType,
103  itkGetStaticConstMacro(OutputSpaceDimension)> OutputVnlVectorType;
104 
106  typedef Point<TScalarType,
107  itkGetStaticConstMacro(InputSpaceDimension)> InputPointType;
108  typedef Point<TScalarType,
109  itkGetStaticConstMacro(OutputSpaceDimension)> OutputPointType;
110 
113  typedef typename Superclass::InverseTransformBaseType InverseTransformBaseType;
114  typedef typename InverseTransformBaseType::Pointer InverseTransformBasePointer;
115 
117  typedef typename Superclass
120  typedef typename Superclass
123  typedef typename Superclass
126 
128  virtual OutputPointType TransformPoint( const InputPointType &point ) const
129  { return point; }
130 
132  virtual OutputVectorType TransformVector( const InputVectorType &vector ) const
133  { return vector; }
134 
137  { return vector; }
138 
141  const InputCovariantVectorType &vector ) const
142  { return vector; }
143 
148  void SetIdentity( void ) { }
149 
178  virtual const JacobianType & GetJacobian( const InputPointType & ) const
179  {
180  return this->m_Jacobian;
181  }
182 
185  {
186  return this->New().GetPointer();
187  }
188 
194  virtual bool IsLinear() const { return true; }
195 
197  virtual const ParametersType& GetFixedParameters( void ) const
198  {
199  return this->m_FixedParameters;
200  }
201 
203  virtual void SetFixedParameters( const ParametersType & ) {}
204 
206  virtual const ParametersType& GetParameters( void ) const
207  {
208  return this->m_Parameters;
209  }
210 
212  virtual void SetParameters( const ParametersType & ) {}
213 
215  virtual void GetJacobian(
216  const InputPointType &,
217  JacobianType & j,
218  NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const
219  {
220  j = this->m_Jacobian;
221  nonZeroJacobianIndices = this->m_NonZeroJacobianIndices;
222  }
223 
224 
226  virtual void GetSpatialJacobian(
227  const InputPointType &,
228  SpatialJacobianType & sj ) const
229  {
230  sj = this->m_SpatialJacobian;
231  }
232 
234  virtual void GetSpatialHessian(
235  const InputPointType &,
236  SpatialHessianType & sh ) const
237  {
238  sh = this->m_SpatialHessian;
239  }
240 
243  const InputPointType &,
245  NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const
246  {
247  jsj = this->m_JacobianOfSpatialJacobian;
248  nonZeroJacobianIndices = this->m_NonZeroJacobianIndices;
249  }
250 
253  const InputPointType &,
254  SpatialJacobianType & sj,
256  NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const
257  {
258  sj = this->m_SpatialJacobian;
259  jsj = this->m_JacobianOfSpatialJacobian;
260  nonZeroJacobianIndices = this->m_NonZeroJacobianIndices;
261  }
262 
265  const InputPointType &,
267  NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const
268  {
269  jsh = this->m_JacobianOfSpatialHessian;
270  nonZeroJacobianIndices = this->m_NonZeroJacobianIndices;
271  }
272 
277  const InputPointType &,
278  SpatialHessianType & sh,
280  NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const
281  {
282  sh = this->m_SpatialHessian;
283  jsh = this->m_JacobianOfSpatialHessian;
284  nonZeroJacobianIndices = this->m_NonZeroJacobianIndices;
285  }
286 
287 protected:
289  : AdvancedTransform<TScalarType,NDimensions,NDimensions>( NDimensions, 1 )
290  {
291  // The Jacobian is constant, therefore it can be initialized in the constructor.
292  this->m_Jacobian = JacobianType( NDimensions, 1 );
293  this->m_Jacobian.Fill( 0.0 );
294 
296  this->m_SpatialJacobian.SetIdentity();
297 
299  this->m_NonZeroJacobianIndices.resize( ParametersDimension );
300  for ( unsigned int i = 0; i < ParametersDimension; ++i )
301  {
302  this->m_NonZeroJacobianIndices[ i ] = i;
303  }
304 
306  this->m_HasNonZeroSpatialHessian = false;
307  this->m_HasNonZeroJacobianOfSpatialHessian = false;
308  this->m_JacobianOfSpatialJacobian.resize( ParametersDimension );
309  this->m_JacobianOfSpatialHessian.resize( ParametersDimension );
310 
312  }
314 
315 private:
316  AdvancedIdentityTransform(const Self&); //purposely not implemented
317  void operator=(const Self&); //purposely not implemented
318 
324 
325 }; // end class AdvancedIdentityTransform
326 
327 } // end namespace itk
328 
329 #endif
330 
Matrix< ScalarType, OutputSpaceDimension, InputSpaceDimension > SpatialJacobianType
JacobianOfSpatialHessianType m_JacobianOfSpatialHessian
Superclass::ParametersType ParametersType
NonZeroJacobianIndicesType m_NonZeroJacobianIndices
virtual const ParametersType & GetParameters(void) const
Point< TScalarType, itkGetStaticConstMacro(OutputSpaceDimension)> OutputPointType
virtual void GetJacobianOfSpatialJacobian(const InputPointType &, SpatialJacobianType &sj, JacobianOfSpatialJacobianType &jsj, NonZeroJacobianIndicesType &nonZeroJacobianIndices) const
Superclass::JacobianOfSpatialHessianType JacobianOfSpatialHessianType
virtual OutputPointType TransformPoint(const InputPointType &point) const
CovariantVector< TScalarType, itkGetStaticConstMacro(InputSpaceDimension)> InputCovariantVectorType
Vector< TScalarType, itkGetStaticConstMacro(OutputSpaceDimension)> OutputVectorType
virtual InverseTransformBasePointer GetInverseTransform(void) const
virtual const JacobianType & GetJacobian(const InputPointType &) const
Superclass::InverseTransformBaseType InverseTransformBaseType
virtual void GetJacobianOfSpatialHessian(const InputPointType &, SpatialHessianType &sh, JacobianOfSpatialHessianType &jsh, NonZeroJacobianIndicesType &nonZeroJacobianIndices) const
CovariantVector< TScalarType, itkGetStaticConstMacro(OutputSpaceDimension)> OutputCovariantVectorType
virtual const ParametersType & GetFixedParameters(void) const
virtual void GetSpatialJacobian(const InputPointType &, SpatialJacobianType &sj) const
JacobianOfSpatialJacobianType m_JacobianOfSpatialJacobian
virtual void GetSpatialHessian(const InputPointType &, SpatialHessianType &sh) const
virtual OutputCovariantVectorType TransformCovariantVector(const InputCovariantVectorType &vector) const
Superclass::SpatialJacobianType SpatialJacobianType
InverseTransformBaseType::Pointer InverseTransformBasePointer
Transform maps points, vectors and covariant vectors from an input space to an output space...
Vector< TScalarType, itkGetStaticConstMacro(InputSpaceDimension)> InputVectorType
virtual void GetJacobianOfSpatialJacobian(const InputPointType &, JacobianOfSpatialJacobianType &jsj, NonZeroJacobianIndicesType &nonZeroJacobianIndices) const
virtual void SetParameters(const ParametersType &)
virtual void SetFixedParameters(const ParametersType &)
Superclass::InternalMatrixType InternalMatrixType
Superclass::NonZeroJacobianIndicesType NonZeroJacobianIndicesType
Superclass::JacobianOfSpatialJacobianType JacobianOfSpatialJacobianType
vnl_vector_fixed< TScalarType, itkGetStaticConstMacro(InputSpaceDimension)> InputVnlVectorType
virtual OutputVectorType TransformVector(const InputVectorType &vector) const
Superclass::SpatialHessianType SpatialHessianType
vnl_vector_fixed< TScalarType, itkGetStaticConstMacro(OutputSpaceDimension)> OutputVnlVectorType
Point< TScalarType, itkGetStaticConstMacro(InputSpaceDimension)> InputPointType
virtual void GetJacobian(const InputPointType &, JacobianType &j, NonZeroJacobianIndicesType &nonZeroJacobianIndices) const
FixedArray< Matrix< ScalarType, InputSpaceDimension, InputSpaceDimension >, OutputSpaceDimension > SpatialHessianType
Implementation of an Identity Transform.
AdvancedTransform< TScalarType, NDimensions, NDimensions > Superclass
virtual OutputVnlVectorType TransformVector(const InputVnlVectorType &vector) const
virtual void GetJacobianOfSpatialHessian(const InputPointType &, JacobianOfSpatialHessianType &jsh, NonZeroJacobianIndicesType &nonZeroJacobianIndices) const


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