21 #ifndef otbKeyPointDensityImageFilter_hxx
22 #define otbKeyPointDensityImageFilter_hxx
25 #include "itkImageRegionIterator.h"
32 template <
class TInputImage,
class TOutputImage,
class TDetector>
35 this->SetNumberOfRequiredInputs(1);
36 m_NeighborhoodRadius = 1;
37 m_Detector = DetectorType::New();
38 m_PointSetToDensityImageFilter = PointSetToDensityImageType::New();
45 template <
class TInputImage,
class TOutputImage,
class TDetector>
57 template <
class TInputImage,
class TOutputImage,
class TDetector>
61 typename Superclass::OutputImagePointer outputImage = this->GetOutput();
62 InputImagePointerType ptr =
const_cast<InputImageType*
>(this->GetInput());
68 m_Detector->SetInput(ptr);
71 m_PointSetToDensityImageFilter->SetInput(m_Detector->GetOutput());
72 m_PointSetToDensityImageFilter->SetRadius(m_NeighborhoodRadius);
73 m_PointSetToDensityImageFilter->SetSpacing(ptr->GetSignedSpacing());
74 m_PointSetToDensityImageFilter->SetSize(ptr->GetLargestPossibleRegion().GetSize());
75 m_PointSetToDensityImageFilter->SetOrigin(ptr->GetOrigin());
76 m_PointSetToDensityImageFilter->Update();
80 this->GraftOutput(m_PointSetToDensityImageFilter->GetOutput());
86 template <
class TInputImage,
class TOutputImage,
class TDetector>
89 m_Detector = detector;
95 template <
class TInputImage,
class TOutputImage,
class TDetector>
105 template <
class TInputImage,
class TOutputImage,
class TDetector>
108 Superclass::PrintSelf(os, indent);
109 os << indent <<
"Neighborhood Radius " << m_NeighborhoodRadius << std::endl;