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;
253 m_AcquiCorrectionParameters = acquiCorrTerms;
254 this->SetNthInput(3, m_AcquiCorrectionParameters);
255 m_IsSetAcquiCorrectionParameters =
true;
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
This class contains all atmospheric correction parameters.
itk::SmartPointer< Self > Pointer
This class is a vector of AtmosphericRadiativeTermsSingleChannel, it contains all atmospheric radiati...
itk::SmartPointer< Self > Pointer
This class contains the values of the filter function for the processed spectral band.
std::vector< WavelengthSpectralBandType > ValuesVectorType
float WavelengthSpectralBandType
Unary neighborhood functor to compute the value of a pixel which is a sum of the surrounding pixels v...
TOutput::RealValueType RealValueType
virtual ~ComputeNeighborhoodContributionFunctor()
DoubleContainerType m_UpwardTransmittanceRatio
std::vector< double > DoubleContainerType
WeightingValuesContainerType GetWeightingValues()
std::vector< WeightingMatrixType > WeightingValuesContainerType
itk::VariableSizeMatrix< double > WeightingMatrixType
void SetWeightingValues(const WeightingValuesContainerType &cont)
TOutput operator()(const TNeighIter &it)
void SetUpwardTransmittanceRatio(DoubleContainerType &upwardTransmittanceRatio)
void SetDiffuseRatio(DoubleContainerType &diffuseRatio)
DoubleContainerType GetUpwardTransmittanceRatio()
DoubleContainerType GetDiffuseRatio()
DoubleContainerType m_DiffuseRatio
WeightingValuesContainerType m_WeightingValues
ComputeNeighborhoodContributionFunctor()
Correct the scheme taking care of the surrounding pixels.
void SetAtmoCorrectionParameters(AtmoCorrectionParametersPointerType atmoCorrTerms)
double m_ZenithalViewingAngle
Superclass::InputImageType InputImageType
bool m_FunctorParametersHaveBeenComputed
otb::FilterFunctionValues FilterFunctionValuesType
void SetAtmosphericRadiativeTerms(AtmosphericRadiativeTermsPointerType atmoRadTerms)
itk::SmartPointer< Self > Pointer
unsigned int m_WindowRadius
OutputImageType::PixelType OutputPixelType
FilterFunctionValuesType::WavelengthSpectralBandType ValueType
otb::RadiometryCorrectionParametersToAtmosphericRadiativeTerms CorrectionParametersToRadiativeTermsType
SurfaceAdjacencyEffectCorrectionSchemeFilter Self
std::vector< double > DoubleContainerType
itkGetObjectMacro(AcquiCorrectionParameters, AcquiCorrectionParametersType)
itkGetObjectMacro(AtmoCorrectionParameters, AtmoCorrectionParametersType)
AcquiCorrectionParametersPointerType m_AcquiCorrectionParameters
otb::AtmosphericRadiativeTerms AtmosphericRadiativeTermsType
itk::SmartPointer< const Self > ConstPointer
~SurfaceAdjacencyEffectCorrectionSchemeFilter() override
double m_PixelSpacingInKilometers
Functor::ComputeNeighborhoodContributionFunctor< itk::ConstNeighborhoodIterator< TInputImage >, typename TOutputImage::PixelType > FunctorType
Superclass::OutputImageType OutputImageType
InputImageType::InternalPixelType InputInternalPixelType
AtmoCorrectionParametersType::Pointer AtmoCorrectionParametersPointerType
void SetAcquiCorrectionParameters(AcquiCorrectionParametersPointerType acquiCorrTerms)
bool m_IsSetAcquiCorrectionParameters
itk::VariableSizeMatrix< double > WeightingMatrixType
AcquiCorrectionParametersType::Pointer AcquiCorrectionParametersPointerType
std::vector< WeightingMatrixType > WeightingValuesContainerType
InputImageType::SizeType SizeType
InputImageType::PixelType InputPixelType
OutputImageType::InternalPixelType OutputInternalPixelType
OutputImageType::RegionType OutputImageRegionType
UnaryFunctorNeighborhoodImageFilter< TInputImage, TOutputImage, FunctorType > Superclass
itk::MetaDataDictionary MetaDataDictionaryType
InputImageType::RegionType InputImageRegionType
itk::ConstNeighborhoodIterator< InputImageType > NeighborIterType
WeightingValuesContainerType m_WeightingValues
bool m_IsSetAtmoCorrectionParameters
bool m_IsSetAtmosphericRadiativeTerms
otb::AtmosphericCorrectionParameters AtmoCorrectionParametersType
void SetWindowRadius(unsigned int rad)
AtmosphericRadiativeTermsType::Pointer AtmosphericRadiativeTermsPointerType
otb::ImageMetadataCorrectionParameters AcquiCorrectionParametersType
itkGetObjectMacro(AtmosphericRadiativeTerms, AtmosphericRadiativeTermsType)
FilterFunctionValuesType::ValuesVectorType ValuesVectorType
AtmoCorrectionParametersPointerType m_AtmoCorrectionParameters
AcquiCorrectionParametersType::WavelengthSpectralBandVectorType WavelengthSpectralBandVectorType
AtmosphericRadiativeTermsPointerType m_AtmosphericRadiativeTerms
Implements neighborhood-wise generic operation on image.
Superclass::OutputImageType OutputImageType
Superclass::InputImageType InputImageType
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.