[Insight-users] itkDiscreteGaussianImageFIlter

Luis Ibanez luis.ibanez at kitware.com
Thu May 15 20:50:26 EDT 2008


Hi Bert,


1) Yes, you should use the DiscreteGaussianImageFilter with
    signed pixel types.

    Alternatively you may want to use the
    SmoothingRecursiveGaussianImageFilter
http://www.itk.org/Insight/Doxygen/html/classitk_1_1SmoothingRecursiveGaussianImageFilter.html



2) The DiscreteGaussianImageFilter computes, based on your
    variance, the size of the Kernel that will be required
    to approximate up to a certain error/tolerance the
    convolution of the data with a Gaussian (that of course
    have infinite support).

    You will understand better the process if you look at
    the code in:

       Insight/Code/Common/itkGaussianOperator.txx

    in particular lines 47-57, in the implementation of
    the GenerateCoefficients() method.

    In short:
    The way you approximate a Gaussian is by

          a) setting the value of the Variance

          b) defining your tolerance for error

          c) computing for that variance how many
             coefficients you need (the size of the
             kernel support) to satisfy that error
             tolerance.

     In this context, it is to be expected that, the larger
     you set the variance, the larger you should expect to
     the kernel size to be, and therefore you have to set
     the maximum kernel size to a larger value... or you have
     to give up on the error tolerance and accept a less
     perfect approximation to the Gaussian.



You may want to look at the document recommended in the documentation
of this class:

  * The Gaussian kernel contained in this operator was described
  * by Tony Lindeberg (Discrete Scale-Space Theory and the Scale-Space
  * Primal Sketch.  Dissertation. Royal Institute of Technology,
  * Stockholm, Sweden. May 1991.).
  *




    Regards,



        Luis




-----------
Bert wrote:
> Dear all,
> 
> When I run the itkDiscreteGaussianImageFilter with *unsigned char* 
> pixels, I get this error:
> 
> d:\itk\source\insighttoolkit-3.4.0\code\basicfilters\itkNeighborhoodOperatorImageFilter.txx:96:
> itk::ERROR: NeighborhoodOperatorImageFilter(017D9CF0): This filter can 
> only create images
> of signed data type.
> 
> I also get a warning when I set the variance to 1 and the 
> MaximumKernelWidth is set to 2. The warning
> says that the dimensions of the Kernel are excedeed, but if the 
> variance=5 and the Kerne=10, I don't get
> any error. The image size is: 45x45x35x10.
> 
> Could anybody help me?
> Best regards
> Bert
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users


More information about the Insight-users mailing list