InsightSoftwareConsortium / itk_cucim

ITK Python filters accelerated with cuCIM
Apache License 2.0
3 stars 3 forks source link

add discrete_gaussian_image_filter and discrete_gaussian_derivative_image_filter #15

Closed grlee77 closed 1 year ago

grlee77 commented 2 years ago

closes #5

Unlike the median filter, this specific discrete Gaussian kernel is not already present in cuCIM. Given that, Python code to generate the kernel coefficients and perform the filtering has been added in _discrete_gaussian.py. The code in that file could also potentially be moved within cuCIM itself, perhaps somewhere under cucim.core.operations.

I have expanded the unit tests to run for both 8-bit unsigned integer and 32-bit floating point data types. There are two current issues with the integer-valued filtering:

1.) There appears to be some difference in rounding behavior, leading to a difference of 1 at an isolated number of voxels in the DiscreteGaussianImageFilter case. 2.) DiscreteGaussianDerivativeImageFilter tests for unsigned integer inputs are currently omitted due to failure to give a result within a difference of 1.