18 #ifndef itkWienerDeconvolutionImageFilter_h
19 #define itkWienerDeconvolutionImageFilter_h
76 template <
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);
137 GenerateData()
override;
140 PrintSelf(std::ostream & os,
Indent indent)
const override;
143 double m_NoiseVariance{};
148 template <
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"