21 #ifndef otbPointSetToDensityImageFilter_hxx
22 #define otbPointSetToDensityImageFilter_hxx
25 #include "itkImageRegionIterator.h"
26 #include "itkProgressReporter.h"
33 template <
class TInputPo
intSet,
class TOutputImage,
class TDensityFunction>
42 template <
class TInputPo
intSet,
class TOutputImage,
class TDensityFunction>
46 Superclass::Superclass::GenerateData();
52 template <
class TInputPo
intSet,
class TOutputImage,
class TDensityFunction>
54 itk::ThreadIdType threadId)
60 itk::ProgressReporter progress(
this, threadId, outputRegionForThread.GetNumberOfPixels());
62 typename OutputImageType::Pointer outPtr = this->GetOutput();
65 densityComputeFunction->SetPointSet(this->GetInput());
66 densityComputeFunction->SetRadius(m_Radius);
71 itk::ImageRegionIterator<OutputImageType> itOut(outPtr, outputRegionForThread);
75 while (!itOut.IsAtEnd())
77 index = itOut.GetIndex();
78 outPtr->TransformIndexToPhysicalPoint(index, pCenter);
80 itOut.Set(densityComputeFunction->Evaluate(pCenter));
82 progress.CompletedPixel();
89 template <
class TInputPo
intSet,
class TOutputImage,
class TDensityFunction>
93 typename Superclass::OutputImagePointer outputPtr = this->GetOutput();
100 typename OutputImageType::RegionType region;
104 region.SetSize(this->GetSize());
105 region.SetIndex(start);
107 outputPtr->SetOrigin(this->GetOrigin());
108 outputPtr->SetSignedSpacing(this->GetSpacing());
109 outputPtr->SetRegions(region);
115 template <
class TInputPo
intSet,
class TOutputImage,
class TDensityFunction>
118 Superclass::PrintSelf(os, indent);