Wiener deconvolution image filter

Hello,

I try to implement several filters in SITK for 3D images, but I do get an error with the Wiener deconvolution image filter. (The Gaussian, median and curvature flow are working :slight_smile: )
This is my function:

def calc_wiener(img, cond=2, var=0.2):
""" Wiener Deconvolution image filter. """
blurFilter = sitk.WienerDeconvolutionImageFilter()
blurFilter.SetBoundaryCondition(cond)
blurFilter.SetNoiseVariance(var)
imgSmooth = blurFilter.Execute(img)
return imgSmooth

And I do get this error:

NotImplementedError: Wrong number or type of arguments for overloaded function 'WienerDeconvolutionImageFilter_Execute'.

Possible C/C++ prototypes are:
itk::simple::WienerDeconvolutionImageFilter::Execute(itk::simple::Image const &,itk::simple::Image const &)
itk::simple::WienerDeconvolutionImageFilter::Execute(itk::simple::Image const &,itk::simple::Image const &,double,bool,itk::simple::WienerDeconvolutionImageFilter::BoundaryConditionType,itk::simple::WienerDeconvolutionImageFilter::OutputRegionModeType)

Does anyone know how to solve this error?

Hello @Romy_Meester,

You are missing the blurring kernel parameter in the Execute method. The documentation says that it expects “the image to be deconvolved and the blurring kernel”. This parameter is required in all versions of SimpleITK.

Also, based on the error message you are using an older toolkit version. We recommend upgrading to the latest version, 2.0, which was recently released.