18 #ifndef __otbNonMaxRemovalByDirectionFilter_h
19 #define __otbNonMaxRemovalByDirectionFilter_h
35 template <
class TInput1,
class TInput2,
class TOutput>
41 inline TOutput
operator ()(
const TInput1& itA,
const TInput2& itB)
44 if (itA.GetCenterPixel() != 0)
46 typename TInput1::OffsetType offset1, offset2;
47 int neighborhoodNumber;
48 if (itB.GetCenterPixel() > 0)
50 neighborhoodNumber =
static_cast<int>(itB.GetCenterPixel() / (
CONST_PI_4) -1);
54 neighborhoodNumber =
static_cast<int>((itB.GetCenterPixel() +
CONST_PI) / (
CONST_PI_4) -1);
56 switch (neighborhoodNumber)
83 if ((itA.GetCenterPixel() > itA.GetPixel(offset1))
84 && (itA.GetCenterPixel() > itA.GetPixel(offset2)))
86 resp = itA.GetCenterPixel();
100 template <
class TInputModulus,
class TInputDirection,
class TOutputImage>
132 virtual void PrintSelf(std::ostream& os,
itk::Indent indent)
const
134 Superclass::PrintSelf(os, indent);
137 virtual void GenerateData(
void)
140 filter->SetInput1(this->GetInput());
141 filter->SetInput2(this->GetInputDirection());
142 filter->GraftOutput(this->GetOutput());
144 this->GraftOutput(filter->GetOutput());
149 void operator =(
const Self&);