22 #ifndef otbWaveletOperatorBase_h
23 #define otbWaveletOperatorBase_h
26 #include "itkNeighborhoodOperator.h"
75 template <Wavelet::Wavelet TMotherWaveletOperator,
class TPixel,
unsigned int VDimension,
class TAllocator = itk::NeighborhoodAllocator<TPixel>>
76 class ITK_EXPORT
WaveletOperatorBase :
public itk::NeighborhoodOperator<TPixel, VDimension, TAllocator>
82 typedef itk::NeighborhoodOperator<TPixel, VDimension, TAllocator>
Superclass;
86 typedef typename Superclass::SizeType
SizeType;
88 itkStaticConstMacro(MotherWaveletOperator, MotherWaveletOperatorEnumType, TMotherWaveletOperator);
98 itk::NeighborhoodOperator<TPixel, VDimension, TAllocator>(other),
99 m_UpSampleFactor(other.GetUpSampleFactor()),
110 Superclass::operator=(other);
121 return this->m_UpSampleFactor;
129 this->m_UpSampleFactor = upSampleFactor;
137 return this->m_WaveletGenerator->GetWaveletName();
144 void PrintSelf(std::ostream& os, itk::Indent i)
const override;
195 this->FillCenteredDirectional(coeff);
204 void GetHighPassFilterFromQuadratureLowPassFilter(CoefficientVector& coeff)
206 unsigned int length = coeff.size();
208 CoefficientVector highPassCoeff (length);
209 int medianPosition =
static_cast<int>(length) / 2;
211 highPassCoeff[medianPosition] = -coeff[medianPosition];
214 for (
int i = 1; i <= medianPosition; ++i)
216 highPassCoeff[medianPosition + i] = sign * coeff[medianPosition - i];
217 highPassCoeff[medianPosition - i] = sign * coeff[medianPosition + i];
221 coeff = highPassCoeff;
229 void GetInverseHighPassFilterFromForwardLowPassFilter(CoefficientVector& coeff)
231 unsigned long length =
static_cast<unsigned long>(coeff.size());
232 unsigned long medianPosition = length / 2;
236 coeff[medianPosition] *= -1.;
237 for (
unsigned int i = 2; i <= medianPosition; i += 2)
239 coeff[medianPosition + i] *= -1.;
240 coeff[medianPosition - i] *= -1.;
250 void GetInverseLowPassFilterFromForwardHighPassFilter(CoefficientVector& coeff)
252 unsigned long length =
static_cast<unsigned long>(coeff.size());
253 unsigned long medianPosition = length / 2;
257 for (
unsigned int i = 1; i <= medianPosition; i += 2)
259 coeff[medianPosition + i] *= -1.;
260 coeff[medianPosition - i] *= -1.;
271 void GetForwardHighPassFilterFromInverseLowPassFilter(CoefficientVector& coeff)
273 GetInverseLowPassFilterFromForwardHighPassFilter(coeff);
284 #ifndef OTB_MANUAL_INSTANTIATION