Discussion:
[ITK-users] sitk.DiscreteGaussianImageFilter with different variances per direction
Jonas Teuwen
2017-05-04 16:48:55 UTC
Permalink
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
Dženan Zukić
2017-05-04 17:18:43 UTC
Permalink
Hi Jonas,

I don't know whether that is possible with SimpleITK, but with regular ITK
you just pass an array of variances (each corresponding to one spatial
dimension). Make sure that (last) one is 0.

Regards,
DÅŸenan Zukić, PhD, Senior R&D Engineer, Kitware (Carrboro, N.C.)
Post by Jonas Teuwen
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
_____________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
http://www.kitware.com/products/protraining.php
http://www.itk.org/Wiki/ITK_FAQ
http://public.kitware.com/mailman/listinfo/insight-users
Yaniv, Ziv Rafael (NIH/NLM/LHC) [C]
2017-05-04 18:16:55 UTC
Permalink
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 <***@gmail.com>
Date: Thursday, May 4, 2017 at 12:48 PM
To: "insight-***@itk.org" <insight-***@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

Loading...