18 #ifndef __itkPSMSurfaceNeighborhood_hxx 19 #define __itkPSMSurfaceNeighborhood_hxx 20 #include "itkPSMSurfaceNeighborhood.h" 24 template <
class TImage>
25 typename PSMSurfaceNeighborhood<TImage>::PointVectorType
28 std::vector<double> &weights,
double radius)
const 31 GradientVectorType posnormal = domain->SampleNormalVnl(center, 1.0e-10);
37 for (
unsigned int i = 0; i < Dimension; i++)
39 l[i] = center[i] - radius;
40 u[i] = center[i] + radius;
44 typename PointTreeType::PointIteratorListType pointlist
45 = Superclass::m_Tree->FindPointsInRegion(l, u);
49 ret.reserve(pointlist.size());
50 weights.reserve(pointlist.size());
52 std::vector<double> vec_dist;
53 std::vector<double> vec_cos;
58 for (
typename PointTreeType::PointIteratorListType::const_iterator it = pointlist.begin();
59 it != pointlist.end(); it++)
63 for (
unsigned int i = 0; i < Dimension; i++)
65 double q = center[i] - (*it)->Point[i];
70 if ( sum < radius && sum > 0.0 )
72 GradientVectorType pn = domain->SampleNormalVnl((*it)->Point, 1.0e-10);
73 double cosine = dot_product(posnormal,pn);
79 if ( cosine >= m_FlatCutoff)
83 weights.push_back(1.0);
89 weights.push_back(cos((m_FlatCutoff - cosine) / (1.0+m_FlatCutoff) * 1.5708));
97 ret.push_back( **it );
virtual PointVectorType FindNeighborhoodPointsWithWeights(const PointType &, std::vector< double > &, double) const
Base class for defining the domain in which a particle system exists.
std::vector< PSMPointIndexPair< VDimension > > PointVectorType