Orfeo Toolbox  3.16
itkVolumeSplineKernelTransform.txx
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Insight Segmentation & Registration Toolkit
4  Module: $RCSfile: itkVolumeSplineKernelTransform.txx,v $
5  Language: C++
6  Date: $Date: 2007-10-25 03:55:09 $
7  Version: $Revision: 1.12 $
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 __itkVolumeSplineKernelTransform_txx
18 #define __itkVolumeSplineKernelTransform_txx
20 
21 namespace itk
22 {
23 
28 #if !defined(ITK_LEGACY_REMOVE)
29 template <class TScalarType, unsigned int NDimensions>
30 const typename VolumeSplineKernelTransform<TScalarType, NDimensions>::GMatrixType &
32 ComputeG( const InputVectorType & ) const
33 {
34  itkLegacyReplaceBodyMacro(itkVolumeSplineKernelTransform::ComputeG_vector,
35  3.6,itkVolumeSplineKernelTransform::ComputeG_vector_gmatrix);
36  return this->m_GMatrix;
37 }
38 #endif
39 
40 template <class TScalarType, unsigned int NDimensions>
41 void
43 ComputeG(const InputVectorType & x, GMatrixType & gmatrix) const
44 {
45 
46  const TScalarType r = x.GetNorm();
47  gmatrix.fill( NumericTraits< TScalarType >::Zero );
48  const TScalarType r3 = r * r * r;
49  for(unsigned int i=0; i<NDimensions; i++)
50  {
51  gmatrix[i][i] = r3;
52  }
53 }
54 
55 
56 template <class TScalarType, unsigned int NDimensions>
57 void
60  OutputPointType & result ) const
61 {
62 
63  unsigned long numberOfLandmarks =
64  this->m_SourceLandmarks->GetNumberOfPoints();
65 
66  PointsIterator sp = this->m_SourceLandmarks->GetPoints()->Begin();
67 
68  for(unsigned int lnd=0; lnd < numberOfLandmarks; lnd++ )
69  {
70  InputVectorType position = thisPoint - sp->Value();
71  const TScalarType r = position.GetNorm();
72  const TScalarType r3 = r * r * r;
73 
74  for(unsigned int odim=0; odim < NDimensions; odim++ )
75  {
76  result[ odim ] += r3 * this->m_DMatrix(odim,lnd);
77  }
78  ++sp;
79  }
80 
81 }
82 
83 
84 } // namespace itk
85 #endif

Generated at Sun Feb 3 2013 00:13:29 for Orfeo Toolbox with doxygen 1.8.1.1