21 #ifndef otbSFSTexturesImageFilter_h
22 #define otbSFSTexturesImageFilter_h
25 #include "itkImageToImageFilter.h"
26 #include "itkImageRegionIteratorWithIndex.h"
27 #include "itkConstNeighborhoodIterator.h"
57 template <
class TInputImage,
class TOutputImage>
65 typedef itk::ImageToImageFilter<TInputImage, TOutputImage>
Superclass;
84 typedef typename NeighborhoodIteratorType::RadiusType
RadiusType;
90 itkGetMacro(Radius,
unsigned int);
111 this->GetFunctor().SetSpatialThreshold(thresh);
117 return this->GetFunctor().GetSpatialThreshold();
123 this->GetFunctor().SetSpectralThreshold(thresh);
127 return this->GetFunctor().GetSpectralThreshold();
133 this->GetFunctor().SetRatioMaxConsiderationNumber(value);
137 return this->GetFunctor().GetRatioMaxConsiderationNumber();
144 this->GetFunctor().SetAlpha(alpha);
148 return this->GetFunctor().GetAlpha();
155 this->GetFunctor().SetNumberOfDirections(D);
156 double step =
CONST_PI /
static_cast<double>(D);
157 this->GetFunctor().SetDirectionStep(step);
161 return this->GetFunctor().GetNumberOfDirections();
174 typedef enum { LENGTH = 1, WIDTH, PSI,
WMEAN, RATIO, SD } FeatureType;
178 if (
static_cast<unsigned int>(
id) > this->GetTexturesStatus().size() ||
id == 0)
180 itkExceptionMacro(<<
"Invalid texture index " <<
id <<
", must be in [1;" << this->GetTexturesStatus().size() <<
"]");
184 this->GetFunctor().SetTextureStatus(
id - 1, isSelected);
190 return this->GetFunctor().GetTexturesStatus();
193 void InitFeatureStatus(
bool status);
196 const OutputImageType* GetLengthOutput()
const;
197 OutputImageType* GetLengthOutput();
201 const OutputImageType* GetWidthOutput()
const;
202 OutputImageType* GetWidthOutput();
206 const OutputImageType* GetPSIOutput()
const;
207 OutputImageType* GetPSIOutput();
211 const OutputImageType* GetWMeanOutput()
const;
212 OutputImageType* GetWMeanOutput();
216 const OutputImageType* GetRatioOutput()
const;
217 OutputImageType* GetRatioOutput();
221 const OutputImageType* GetSDOutput()
const;
222 OutputImageType* GetSDOutput();
225 void GenerateOutputInformation()
override;
233 void PrintSelf(std::ostream& os, itk::Indent indent)
const override;
235 void BeforeThreadedGenerateData()
override;
236 void ThreadedGenerateData(
const OutputImageRegionType& outputRegionForThread, itk::ThreadIdType threadId)
override;
238 void GenerateInputRequestedRegion(
void)
override;
242 void operator=(
const Self&) =
delete;
250 #ifndef OTB_MANUAL_INSTANTIATION