[Insight-users] setting parameters for GaussianBlurImageFunction
Luis Ibanez
luis.ibanez at kitware.com
Wed, 24 Dec 2003 09:13:49 -0500
Hi Phillip
This class approximates the Gaussian kernel based
on the value of Sigma and the number of pixels you
select for the Kernel.
The warning you are getting indicates that
for your value of sigma, the number of pixels
in your kernel is insufficient for representing
the Gaussian with acceptable precision.
The way to solve the warning is not to increase
the tolerance on the error, but to increase the
size (in pixels) of the kernel.
For that purpose you can use the method SetExtent():
http://www . itk . org/Insight/Doxygen/html/classitk_1_1GaussianBlurImageFunction . html#a6
The reason why the message contains a reference
to "SetMaximumKernelWidth" is that the warming
message is actually printed out by the GaussianOperator class
http://www . itk . org/Insight/Doxygen/html/classitk_1_1GaussianOperator . html
The GaussianBlurrImageFunction uses a GaussianOperator
for computing the value of the blurred pixel.
So, simply increase the extent allowed for your kernel.
Note that this will reflect in the computation time since
now you will be computing convolutions with a larger
kernel.
Just out of curiosity:
What is your criteria for selecting the sigma at each pixel ?
What you are doing is in some way a filtering with
variable conductance diffusion. The Gaussian is the solution
of the diffusion equation, and when you apply it with different
sigmas depending on the location, this may be equivalent to
one of the anisotropic diffusion filters existing in ITK.
Regards,
Luis
------------------------
Phillip Cheng wrote:
> Hello,
>
> I'm writing an experimental application to apply a Gaussian smoothing
> operator to an image, where the kernel sigma will vary in different
> segmented regions of the image. For this purpose I am iterating through the
> image and using GaussianBlurImageFunction with varying sigmas as I go.
>
> However, with larger sigmas I am getting lots of warnings like this:
>
> itkGaussianOperator (0xbfffecf0): Kernel size has exceeded the specified
> maximum width of 32 and has been truncated to 33 elements. You can raise
> the maximum width using the SetMaximumKernelWidth method.
>
> Yet I do not see any method in GaussianBlurImageFunction for changing either
> the MaximumKernelWidth or the MaximumError for the operator. In particular,
> I would like to increase the MaximumError; I notice that the default is
> 0.001 in each dimension, where in DiscreteGaussianImageFilter I think it is
> 0.01. Is there a better way to do this, or could this functionality be
> added? (Or as a quick fix, could the default max error be changed to 0.01?)
>
> Thanks,
>
> Phillip
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk . org
> http://www . itk . org/mailman/listinfo/insight-users
>