22 #ifndef __otbSurfaceAdjacencyEffect6SCorrectionSchemeFilter_h
23 #define __otbSurfaceAdjacencyEffect6SCorrectionSchemeFilter_h
25 #include "itkNumericTraits.h"
45 template <
class TNeighIter,
class TOutput>
84 unsigned int neighborhoodSize = it.Size();
85 double contribution = 0.;
87 outPixel.SetSize(it.GetCenterPixel().Size());
88 std::ostringstream oss;
89 oss << std::fixed << std::setprecision(3);
92 const unsigned int size = outPixel.GetSize();
93 for (
unsigned int j = 0; j < size; ++j)
100 for (
unsigned int i = 0; i < neighborhoodSize; ++i)
103 unsigned int RowIdx = 0;
104 unsigned int ColIdx = 0;
105 RowIdx = i / TempChannelWeighting.
Cols();
108 ColIdx = (i + 1) - RowIdx*TempChannelWeighting.
Cols() - 1;
115 double idVal = TempChannelWeighting(RowIdx, ColIdx);
117 TOutput tempPix = it.GetPixel(i);
119 contribution +=
static_cast<double>(tempPix[j]) * idVal;
125 outPixel[j] =
static_cast<RealValueType>(atof(oss.str().c_str()));
150 template <
class TInputImage,
class TOutputImage>
154 typename Functor::ComputeNeighborhoodContributionFunctor<itk::
155 ConstNeighborhoodIterator
183 itkStaticConstMacro(InputImageDimension,
unsigned int, TInputImage::ImageDimension);
184 itkStaticConstMacro(OutputImageDimension,
unsigned int, TOutputImage::ImageDimension);
190 typedef typename InputImageType::SizeType
SizeType;
215 void SetWindowRadius(
unsigned int rad)
217 this->SetRadius(rad);
218 m_WindowRadius = rad;
221 itkGetConstReferenceMacro(WindowRadius,
unsigned int);
224 itkSetMacro(PixelSpacingInKilometers,
double);
225 itkGetMacro(PixelSpacingInKilometers,
double);
227 itkSetMacro(ZenithalViewingAngle,
double);
228 itkGetMacro(ZenithalViewingAngle,
double);
233 m_AtmosphericRadiativeTerms = atmo;
234 this->SetNthInput(1, m_AtmosphericRadiativeTerms);
235 m_IsSetAtmosphericRadiativeTerms =
true;
245 itkSetMacro(AeronetFileName, std::string);
246 itkGetMacro(AeronetFileName, std::string);
249 itkSetMacro(FilterFunctionValuesFileName, std::string);
250 itkGetMacro(FilterFunctionValuesFileName, std::string);
255 m_FilterFunctionCoef = vect;
260 return m_FilterFunctionCoef;
264 void ComputeParameters();
266 void GenerateParameters();
268 void UpdateAtmosphericRadiativeTerms();
273 void PrintSelf(std::ostream& os,
itk::Indent indent)
const;
276 virtual void GenerateOutputInformation();
282 virtual void Modified();
314 #ifndef OTB_MANUAL_INSTANTIATION