17 #ifndef _itkCompactlySupportedRBFSparseKernelTransform_txx 18 #define _itkCompactlySupportedRBFSparseKernelTransform_txx 19 #include "itkCompactlySupportedRBFSparseKernelTransform.h" 23 template<
class TScalarType,
unsigned int NDimensions>
24 void CompactlySupportedRBFSparseKernelTransform<
25 TScalarType, NDimensions>::ComputeJacobianWithRespectToParameters(
26 const InputPointType & in, JacobianType & jacobian)
const { }
28 template <
class TScalarType,
unsigned int NDimensions>
33 double a = 3.0 * sqrt(3.14/2.0) * this->Sigma;
35 const TScalarType r = (x.GetNorm())/a;
36 this->m_GMatrix = GMatrixType::Zero();
42 TScalarType val = pow(1-r, 4.0) * (4.0*r + 1);
43 for(
unsigned int i=0; i<NDimensions; i++)
45 this->m_GMatrix(i,i) = val;
50 return this->m_GMatrix;
54 template <
class TScalarType,
unsigned int NDimensions>
58 OutputPointType & result )
const 61 double a = 3.0 * sqrt(3.14/2.0) * this->Sigma;
63 unsigned long numberOfLandmarks = this->m_SourceLandmarks->GetNumberOfPoints();
65 PointsIterator sp = this->m_SourceLandmarks->GetPoints()->Begin();
67 for(
unsigned int lnd=0; lnd < numberOfLandmarks; lnd++ )
69 InputVectorType position = thisPoint - sp->Value();
70 const TScalarType r = (position.GetNorm())/a;
72 TScalarType val = 0.0;
74 val = pow(1-r, 4.0) * (4.0*r + 1);
76 for(
unsigned int odim=0; odim < NDimensions; odim++ )
78 result[ odim ] += val * this->m_DMatrix(odim,lnd);