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 namespace itk
32 {
33 
53 template< class TScalarType,
54 unsigned int NDimensions = 3 >
56  public AdvancedTransform< TScalarType, NDimensions, NDimensions >
57 {
58 public:
59 
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 
84  typedef typename Superclass::TransformCategoryType TransformCategoryType;
85 
88 
90  typedef Vector< TScalarType,
91  itkGetStaticConstMacro( InputSpaceDimension ) > InputVectorType;
92  typedef Vector< TScalarType,
93  itkGetStaticConstMacro( OutputSpaceDimension ) > OutputVectorType;
94 
96  typedef CovariantVector< TScalarType,
97  itkGetStaticConstMacro( InputSpaceDimension ) > InputCovariantVectorType;
98  typedef CovariantVector< TScalarType,
99  itkGetStaticConstMacro( OutputSpaceDimension ) > OutputCovariantVectorType;
100 
102  typedef vnl_vector_fixed< TScalarType,
103  itkGetStaticConstMacro( InputSpaceDimension ) > InputVnlVectorType;
104  typedef vnl_vector_fixed< TScalarType,
105  itkGetStaticConstMacro( OutputSpaceDimension ) > OutputVnlVectorType;
106 
108  typedef Point< TScalarType,
109  itkGetStaticConstMacro( InputSpaceDimension ) > InputPointType;
110  typedef Point< TScalarType,
111  itkGetStaticConstMacro( OutputSpaceDimension ) > OutputPointType;
112 
116  typedef typename InverseTransformBaseType::Pointer InverseTransformBasePointer;
117 
119  typedef typename Superclass
122  typedef typename Superclass
125  typedef typename Superclass
128 
130  virtual OutputPointType TransformPoint( const InputPointType & point ) const
131  { return point; }
132 
134  virtual OutputVectorType TransformVector( const InputVectorType & vector ) const
135  { return vector; }
136 
139  { return vector; }
140 
143  const InputCovariantVectorType & vector ) const
144  { return vector; }
145 
150  void SetIdentity( void ) {}
151 
154  {
155  return this->New().GetPointer();
156  }
157 
158 
164  virtual bool IsLinear() const { return true; }
165 
170  {
171  return Self::Linear;
172  }
173 
174 
176  virtual const ParametersType & GetFixedParameters( void ) const
177  {
178  return this->m_FixedParameters;
179  }
180 
181 
183  virtual void SetFixedParameters( const ParametersType & ) {}
184 
186  virtual const ParametersType & GetParameters( void ) const
187  {
188  return this->m_Parameters;
189  }
190 
191 
193  virtual void SetParameters( const ParametersType & ) {}
194 
196  virtual void GetJacobian(
197  const InputPointType &,
198  JacobianType & j,
199  NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const
200  {
201  j = this->m_LocalJacobian;
202  nonZeroJacobianIndices = this->m_NonZeroJacobianIndices;
203  }
204 
205 
207  virtual void GetSpatialJacobian(
208  const InputPointType &,
209  SpatialJacobianType & sj ) const
210  {
211  sj = this->m_SpatialJacobian;
212  }
213 
214 
216  virtual void GetSpatialHessian(
217  const InputPointType &,
218  SpatialHessianType & sh ) const
219  {
220  sh = this->m_SpatialHessian;
221  }
222 
223 
226  const InputPointType &,
228  NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const
229  {
230  jsj = this->m_JacobianOfSpatialJacobian;
231  nonZeroJacobianIndices = this->m_NonZeroJacobianIndices;
232  }
233 
234 
237  const InputPointType &,
238  SpatialJacobianType & sj,
240  NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const
241  {
242  sj = this->m_SpatialJacobian;
243  jsj = this->m_JacobianOfSpatialJacobian;
244  nonZeroJacobianIndices = this->m_NonZeroJacobianIndices;
245  }
246 
247 
250  const InputPointType &,
252  NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const
253  {
254  jsh = this->m_JacobianOfSpatialHessian;
255  nonZeroJacobianIndices = this->m_NonZeroJacobianIndices;
256  }
257 
258 
263  const InputPointType &,
264  SpatialHessianType & sh,
266  NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const
267  {
268  sh = this->m_SpatialHessian;
269  jsh = this->m_JacobianOfSpatialHessian;
270  nonZeroJacobianIndices = this->m_NonZeroJacobianIndices;
271  }
272 
273 
274 protected:
275 
277  AdvancedTransform< TScalarType, NDimensions, NDimensions >( NDimensions )
278  {
279  // The Jacobian is constant, therefore it can be initialized in the constructor.
280  this->m_LocalJacobian = JacobianType( NDimensions, 1 );
281  this->m_LocalJacobian.Fill( 0.0 );
282 
284  this->m_SpatialJacobian.SetIdentity();
285 
287  this->m_NonZeroJacobianIndices.resize( ParametersDimension );
288  for( unsigned int i = 0; i < ParametersDimension; ++i )
289  {
290  this->m_NonZeroJacobianIndices[ i ] = i;
291  }
292 
294  this->m_HasNonZeroSpatialHessian = false;
296  this->m_JacobianOfSpatialJacobian.resize( ParametersDimension );
297  this->m_JacobianOfSpatialHessian.resize( ParametersDimension );
298 
300  }
301 
302 
304 
305 private:
306 
307  AdvancedIdentityTransform( const Self & ); // purposely not implemented
308  void operator=( const Self & ); // purposely not implemented
309 
316 
317 };
318 
319 } // end namespace itk
320 
321 #endif
Matrix< ScalarType, OutputSpaceDimension, InputSpaceDimension > SpatialJacobianType
JacobianOfSpatialHessianType m_JacobianOfSpatialHessian
Superclass::ParametersType ParametersType
CovariantVector< TScalarType, itkGetStaticConstMacro(InputSpaceDimension) > InputCovariantVectorType
NonZeroJacobianIndicesType m_NonZeroJacobianIndices
virtual const ParametersType & GetParameters(void) const
virtual void GetJacobianOfSpatialJacobian(const InputPointType &, SpatialJacobianType &sj, JacobianOfSpatialJacobianType &jsj, NonZeroJacobianIndicesType &nonZeroJacobianIndices) const
Superclass::JacobianOfSpatialHessianType JacobianOfSpatialHessianType
vnl_vector_fixed< TScalarType, itkGetStaticConstMacro(InputSpaceDimension) > InputVnlVectorType
virtual OutputPointType TransformPoint(const InputPointType &point) const
virtual InverseTransformBasePointer GetInverseTransform(void) const
vnl_vector_fixed< TScalarType, itkGetStaticConstMacro(OutputSpaceDimension) > OutputVnlVectorType
Superclass::InverseTransformBaseType InverseTransformBaseType
virtual void GetJacobianOfSpatialHessian(const InputPointType &, SpatialHessianType &sh, JacobianOfSpatialHessianType &jsh, NonZeroJacobianIndicesType &nonZeroJacobianIndices) const
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...
virtual void GetJacobianOfSpatialJacobian(const InputPointType &, JacobianOfSpatialJacobianType &jsj, NonZeroJacobianIndicesType &nonZeroJacobianIndices) const
virtual void SetParameters(const ParametersType &)
AdvancedTransform< TScalarType, NDimensions, NDimensions > Superclass
itkStaticConstMacro(InputSpaceDimension, unsigned int, NDimensions)
virtual void SetFixedParameters(const ParametersType &)
Superclass::InternalMatrixType InternalMatrixType
CovariantVector< TScalarType, itkGetStaticConstMacro(OutputSpaceDimension) > OutputCovariantVectorType
Superclass::NonZeroJacobianIndicesType NonZeroJacobianIndicesType
void operator=(const Self &)
Point< TScalarType, itkGetStaticConstMacro(OutputSpaceDimension) > OutputPointType
Superclass::TransformCategoryType TransformCategoryType
Superclass::JacobianOfSpatialJacobianType JacobianOfSpatialJacobianType
virtual OutputVectorType TransformVector(const InputVectorType &vector) const
virtual TransformCategoryType GetTransformCategory() const
Superclass::SpatialHessianType SpatialHessianType
Vector< TScalarType, itkGetStaticConstMacro(OutputSpaceDimension) > OutputVectorType
Point< TScalarType, itkGetStaticConstMacro(InputSpaceDimension) > InputPointType
Vector< TScalarType, itkGetStaticConstMacro(InputSpaceDimension) > InputVectorType
virtual void GetJacobian(const InputPointType &, JacobianType &j, NonZeroJacobianIndicesType &nonZeroJacobianIndices) const
FixedArray< Matrix< ScalarType, InputSpaceDimension, InputSpaceDimension >, OutputSpaceDimension > SpatialHessianType
Implementation of an Identity Transform.
Superclass::NumberOfParametersType NumberOfParametersType
virtual OutputVnlVectorType TransformVector(const InputVnlVectorType &vector) const
virtual void GetJacobianOfSpatialHessian(const InputPointType &, JacobianOfSpatialHessianType &jsh, NonZeroJacobianIndicesType &nonZeroJacobianIndices) const


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