17 #ifndef __itkVolumeSplineKernelTransform_txx
18 #define __itkVolumeSplineKernelTransform_txx
28 #if !defined(ITK_LEGACY_REMOVE)
29 template <
class TScalarType,
unsigned int NDimensions>
30 const typename VolumeSplineKernelTransform<TScalarType, NDimensions>::GMatrixType &
34 itkLegacyReplaceBodyMacro(itkVolumeSplineKernelTransform::ComputeG_vector,
35 3.6,itkVolumeSplineKernelTransform::ComputeG_vector_gmatrix);
36 return this->m_GMatrix;
40 template <
class TScalarType,
unsigned int NDimensions>
43 ComputeG(
const InputVectorType & x, GMatrixType & gmatrix)
const
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++)
56 template <
class TScalarType,
unsigned int NDimensions>
63 unsigned long numberOfLandmarks =
64 this->m_SourceLandmarks->GetNumberOfPoints();
68 for(
unsigned int lnd=0; lnd < numberOfLandmarks; lnd++ )
71 const TScalarType r = position.
GetNorm();
72 const TScalarType r3 = r * r * r;
74 for(
unsigned int odim=0; odim < NDimensions; odim++ )
76 result[ odim ] += r3 * this->m_DMatrix(odim,lnd);