18#ifndef itkWienerDeconvolutionImageFilter_h
19#define itkWienerDeconvolutionImageFilter_h
76template <
typename TInputImage,
77 typename TKernelImage = TInputImage,
78 typename TOutputImage = TInputImage,
79 typename TInternalPrecision =
double>
99 static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
104 using typename Superclass::InputPixelType;
105 using typename Superclass::OutputPixelType;
106 using typename Superclass::KernelPixelType;
107 using typename Superclass::InputIndexType;
108 using typename Superclass::OutputIndexType;
109 using typename Superclass::KernelIndexType;
110 using typename Superclass::InputSizeType;
111 using typename Superclass::OutputSizeType;
112 using typename Superclass::KernelSizeType;
114 using typename Superclass::InputRegionType;
115 using typename Superclass::OutputRegionType;
116 using typename Superclass::KernelRegionType;
119 using typename Superclass::InternalImageType;
120 using typename Superclass::InternalImagePointerType;
121 using typename Superclass::InternalComplexType;
122 using typename Superclass::InternalComplexImageType;
123 using typename Superclass::InternalComplexImagePointerType;
127 itkSetMacro(NoiseVariance,
double);
128 itkGetConstMacro(NoiseVariance,
double);
143 double m_NoiseVariance{};
148template <
typename TPixel>
155 : m_NoisePowerSpectralDensityConstant(f.m_NoisePowerSpectralDensityConstant)
156 , m_KernelZeroMagnitudeThreshold(f.m_KernelZeroMagnitudeThreshold)
170 TPixel Pn = m_NoisePowerSpectralDensityConstant;
175 TPixel Pf = std::norm(I);
177 TPixel denominator = std::norm(H) + (Pn / (Pf - Pn));
179 if (
itk::Math::abs(denominator) >= m_KernelZeroMagnitudeThreshold)
181 value = I * (std::conj(H) / denominator);
192 m_NoisePowerSpectralDensityConstant = constant;
197 return m_NoisePowerSpectralDensityConstant;
206 m_KernelZeroMagnitudeThreshold = mu;
211 return m_KernelZeroMagnitudeThreshold;
216 double m_NoisePowerSpectralDensityConstant = 0.0;
217 double m_KernelZeroMagnitudeThreshold = 0.0;
223#ifndef ITK_MANUAL_INSTANTIATION
224# include "itkWienerDeconvolutionImageFilter.hxx"
WienerDeconvolutionFunctor()=default
double GetKernelZeroMagnitudeThreshold() const
double GetNoisePowerSpectralDensityConstant() const
bool operator==(const WienerDeconvolutionFunctor &) const
void SetKernelZeroMagnitudeThreshold(double mu)
WienerDeconvolutionFunctor(const WienerDeconvolutionFunctor &f)
~WienerDeconvolutionFunctor()=default
TPixel operator()(const TPixel &I, const TPixel &H) const
void SetNoisePowerSpectralDensityConstant(double constant)
ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION(WienerDeconvolutionFunctor)
Control indentation during Print() invocation.
The direct linear inverse deconvolution filter.
Light weight base class for most itk classes.
The Wiener deconvolution image filter is designed to restore an image convolved with a blurring kerne...
void GenerateData() override
~WienerDeconvolutionImageFilter() override=default
void PrintSelf(std::ostream &os, Indent indent) const override
WienerDeconvolutionImageFilter()
TKernelImage KernelImageType
TInputImage InputImageType
TOutputImage OutputImageType
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
unsigned long SizeValueType