22 #ifndef otbSurfaceAdjacencyEffectCorrectionSchemeFilter_h
23 #define otbSurfaceAdjacencyEffectCorrectionSchemeFilter_h
25 #include "itkNumericTraits.h"
28 #include "itkVariableSizeMatrix.h"
45 template <
class TNeighIter,
class TOutput>
88 unsigned int neighborhoodSize = it.Size();
89 double contribution = 0.;
91 outPixel.SetSize(it.GetCenterPixel().Size());
94 const unsigned int size = outPixel.GetSize();
95 for (
unsigned int j = 0; j < size; ++j)
101 for (
unsigned int i = 0; i < neighborhoodSize; ++i)
104 unsigned int RowIdx = 0;
105 unsigned int ColIdx = 0;
106 RowIdx = i / TempChannelWeighting.Cols();
107 ColIdx = i - RowIdx * TempChannelWeighting.Cols();
110 double idVal = TempChannelWeighting(RowIdx, ColIdx);
112 TOutput tempPix = it.GetPixel(i);
114 contribution +=
static_cast<double>(tempPix[j]) * idVal;
141 template <
class TInputImage,
class TOutputImage>
144 itk::ConstNeighborhoodIterator<TInputImage>, typename TOutputImage::PixelType>>
167 itkStaticConstMacro(InputImageDimension,
unsigned int, TInputImage::ImageDimension);
168 itkStaticConstMacro(OutputImageDimension,
unsigned int, TOutputImage::ImageDimension);
175 typedef typename InputImageType::SizeType
SizeType;
211 this->SetRadius(rad);
212 m_WindowRadius = rad;
215 itkGetConstReferenceMacro(WindowRadius,
unsigned int);
219 itkSetMacro(PixelSpacingInKilometers,
double);
220 itkGetMacro(PixelSpacingInKilometers,
double);
223 itkSetMacro(ZenithalViewingAngle,
double);
224 itkGetMacro(ZenithalViewingAngle,
double);
231 m_AtmosphericRadiativeTerms = atmoRadTerms;
232 this->SetNthInput(1, m_AtmosphericRadiativeTerms);
233 m_IsSetAtmosphericRadiativeTerms =
true;
242 m_AtmoCorrectionParameters = atmoCorrTerms;
243 this->SetNthInput(2, m_AtmoCorrectionParameters);
244 m_IsSetAtmoCorrectionParameters =
true;
247 itkGetObjectMacro(AtmoCorrectionParameters, AtmoCorrectionParametersType);
253 m_AcquiCorrectionParameters = acquiCorrTerms;
254 this->SetNthInput(3, m_AcquiCorrectionParameters);
255 m_IsSetAcquiCorrectionParameters =
true;
258 itkGetObjectMacro(AcquiCorrectionParameters, AcquiCorrectionParametersType);
263 void GenerateParameters();
267 itkSetMacro(IsSetAtmosphericRadiativeTerms,
bool);
268 itkGetMacro(IsSetAtmosphericRadiativeTerms,
bool);
269 itkBooleanMacro(IsSetAtmosphericRadiativeTerms);
277 void PrintSelf(std::ostream& os, itk::Indent indent)
const override;
280 void BeforeThreadedGenerateData()
override;
283 void UpdateAtmosphericRadiativeTerms();
286 void UpdateFunctors();
289 void Modified()
const override;
319 #ifndef OTB_MANUAL_INSTANTIATION