Skip to content
Snippets Groups Projects
Commit b02d5679 authored by Emmanuel Christophe's avatar Emmanuel Christophe
Browse files

ENH: clean up useless stuff

parent 79b51c72
No related branches found
No related tags found
No related merge requests found
......@@ -20,14 +20,14 @@
#include "otbPointSetFunction.h"
#include "itkPoint.h"
#include "itkProcessObject.h"
namespace otb
{
/**
* \class PointSetDensityFunction
* \brief Calculate the density in the neighborhood of a pixel
* \brief Calculate the density in the neighborhood of a pixel using a simple cut off method
*
*
* \ingroup PointSetFunctions
*/
......@@ -64,7 +64,7 @@ public:
virtual OutputType Evaluate(const InputType& input ) const;
protected:
PointSetDensityFunction();
PointSetDensityFunction(): m_Radius(1) {};
virtual ~PointSetDensityFunction() {};
void PrintSelf(std::ostream& os, itk::Indent indent) const;
......
......@@ -19,26 +19,12 @@
#define __otbPointSetDensityFunction_txx
#include "otbPointSetDensityFunction.h"
#include "otbImage.h"
#include "otbMath.h"
namespace otb
{
/**
* Constructor
*/
template <class TPointSet, class TOutput >
PointSetDensityFunction< TPointSet, TOutput>
::PointSetDensityFunction()
{
m_Radius = 1;
}
/**
*
* Evaluate
*/
template <class TPointSet, class TOutput >
typename PointSetDensityFunction< TPointSet, TOutput>
......@@ -46,11 +32,6 @@ typename PointSetDensityFunction< TPointSet, TOutput>
PointSetDensityFunction< TPointSet, TOutput>
::Evaluate(const InputType& input ) const
{
typename otb::Image<OutputType,2>::IndexType index;
index[0] = static_cast<long int>(input[0]);
index[1] = static_cast<long int>(input[1]);
int accu = 0;
double surface = CONST_PI*m_Radius*m_Radius;
......@@ -61,8 +42,8 @@ PointSetDensityFunction< TPointSet, TOutput>
while ( it != this->GetPointSet()->GetPoints()->End())
{
float distX = index[0]-it.Value()[0];
float distY = index[1]-it.Value()[1];
float distX = input[0]-it.Value()[0];
float distY = input[1]-it.Value()[1];
float distsq = distX*distX + distY*distY;
if (distsq <= m_Radius*m_Radius)
......@@ -81,9 +62,8 @@ PointSetDensityFunction< TPointSet, TOutput>
return static_cast<float>(accu/surface);
}
/**
*
* PrintSelf
*/
template <class TPointSet, class TOutput >
void
......@@ -93,7 +73,6 @@ PointSetDensityFunction< TPointSet, TOutput>
this->Superclass::PrintSelf(os,indent);
}
} // end namespace otb
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment