22 #ifndef __otbBinaryImageDensityFunction_txx
23 #define __otbBinaryImageDensityFunction_txx
27 #include "itkNumericTraits.h"
36 template <
class TInputImage,
class TCoordRep>
40 m_NeighborhoodRadius.Fill(1);
46 template <
class TInputImage,
class TCoordRep>
51 this->Superclass::PrintSelf(os, indent);
52 os << indent <<
"NeighborhoodRadius: " << m_NeighborhoodRadius << std::endl;
58 template <
class TInputImage,
class TCoordRep>
67 sum = itk::NumericTraits<RealType>::Zero;
69 if (!this->GetInputImage())
71 return (itk::NumericTraits<RealType>::max());
74 if (!this->IsInsideBuffer(index))
76 return (itk::NumericTraits<RealType>::max());
80 typename InputImageType::SizeType kernelSize = m_NeighborhoodRadius;
83 it(kernelSize, this->GetInputImage(), this->GetInputImage()->GetBufferedRegion());
89 const unsigned int size = it.
Size();
90 for (
unsigned int i = 0; i < size; ++i)