[ITK-users] sitk.DiscreteGaussianImageFilter with different variances per direction

Yaniv, Ziv Rafael (NIH/NLM/LHC) [C] zivrafael.yaniv at nih.gov
Thu May 4 14:16:55 EDT 2017


Hello Jonas,

Unfortunately, this is currently not supported by the Discrete Gaussian filter in SimpleITK.

I would recommend doing it with the recursive Gaussian filter which will let you independently filter along each dimension:

img = sitk.ReadImage("sphere.mha")

# directions are 0,1,2 (x,y,z), as you only want to blur in x and y
x_blurred = sitk.RecursiveGaussian(img, sigma = 2, direction = 0)
xy_blurred = sitk.RecursiveGaussian(x_blurred, sigma = 4, direction = 1)

Please also add this as a feature request for the Discrete Gaussian filter on our github issue tracker (https://github.com/SimpleITK/SimpleITK/issues).

        regards
            Ziv


From: Jonas Teuwen <jonasteuwen at gmail.com>
Date: Thursday, May 4, 2017 at 12:48 PM
To: "insight-users at itk.org" <insight-users at itk.org>
Subject: [ITK-users] sitk.DiscreteGaussianImageFilter with different variances per direction

Dear all,

I am downsampling an image in the in-plane resolution (3D) and I want to apply a Gaussian filter beforehand. I want to have a different variance (0) in depth as I do not downsample in this direction. https://itk.org/SimpleITKDoxygen/html/classitk_1_1simple_1_1DiscreteGaussianImageFilter.html#details mentions that the 'variance can be set independently in each dimension'. How would I do this with SetVariance()?

Best Regards,
Jonas Teuwen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/insight-users/attachments/20170504/b9ee7d46/attachment.html>


More information about the Insight-users mailing list