[Insight-users] Re: Discrete vs. RecursiveGaussianImageFilter?
Luis Ibanez
luis.ibanez at kitware.com
Sat Aug 4 18:37:21 EDT 2007
Hi Eve,
The DiscreteGaussian filter will compute the kernel size
that is appropriate for a given Sigma value of the Gaussian.
What you provide is only an upper limit to that Kernel size,
so that, if the kernel size computed by the filter is too
large, then it will get truncated.
Enjoy the greatness of Open Source !!
If you look at the implementation of the itkDiscreteGaussian.txx
file in the Insight/Code/BasicFilter, you will see that it uses
the itkGaussianOperator, whose files are located in Code/Common.
The computation of the kernel size, given a Variance, is made
in the method "GenerateCoefficients()" in lines 29-73 of the file
Insight/Code/Common/itkGaussianOperator.txx.
The size of the kernel depends on both the value of the Variance,
*and* the requirement that you set on the approximation error.
("MaximumError"), the more stringent the error requirement, the
more coefficients will be needed to fit the Gaussian to that
degree of precision, and therefore, the larger the Kernel will
be.
Note that in line 52-56, if the copmuted kernel size is larger
than the limit that you set (MaximumKernelWidth) then you will
receive a warning message.
Regards,
Luis
--------------------------------
evelyn_heyes at homeworking.org wrote:
> Thanks Luis.
>
> Could you please also explain the mathematical relationship between variance and kernel size so that one would not get a truncated Gaussian? i.e. given variance, how should we calculate kernel size in N-D?
>
> Thanks again,
> Evelyn
>
>
> Luis Ibanez wrote:
>
>>Hi Eve,
>>
>>These comments on the software guide were based on experiments that Paul
>>Yushkevich
>>ran several years ago comparing the multiple Gaussian smoothing filters
>>available in ITK.
>>
>>Unfortunately we made the mistake of not keeping the test as a permanent
>>part of
>>the toolkit, so we will have to repeat that experiment in order to answer
>>your question
>>properly.
>>
>>My recollection is that a small kernel was in the range of "5x5x5",... but
>>I
>>may be wrong.
>>
>>This is the kind of experiment that could make a very interesting paper
>>for
>>the
>>Insight Journal: take the two filters and compare their computation time
>>for
>>
>>equivalent sigmas in images of different sizes.
>>
>>You could setup this test by mixing the code of the two following
>>examples:
>>
>>
>> - SmoothingRecursiveGaussianImageFilter.cxx
>> - DiscreteGaussianImageFilter.cxx
>>
>>
>>that you will find in the directory
>>
>> Insight/Examples/Filtering
>>
>>In order to measure computation time you can use the class
>>
>>
>> - itkTimeProbesCollectorBase
>>
>>
>>Please let us know if you find any problems when setting up
>>this test.
>>
>>
>> Thanks,
>>
>>
>> Luis
>>
>>
>>------------------------------------------------------------------------------------
>>On 7/25/07, Eve <evelyn_heyes at homeworking.org> wrote:
>>
>>>
>>>Hello,
>>>
>>>According to ITK-Guide, "when the Gaussian kernel is small, the
>>>itk::DiscreteGaussianImageFilter filter tends to run faster than
>>>itk::RecursiveGaussianImageFilter". For a 200*20*200 volume, how small a
>>>kernel is consider "small"? i.e. what range is considered small? Also,
>>>what
>>>are the (different) effects of "SetUseImageSpacing()" if the spacing
>>>between
>>>slices is large vs. small?
>>>
>>>Thanks,
>>>Eve
>>>
>>>--
>>>View this message in context:
>>>http://www.nabble.com/Discrete-vs.-RecursiveGaussianImageFilter--tf4148711.html#a11802231
>>>Sent from the ITK - Users mailing list archive at Nabble.com.
>>>
>>>_______________________________________________
>>>Insight-users mailing list
>>>Insight-users at itk.org
>>>http://www.itk.org/mailman/listinfo/insight-users
>>>
>>
>>_______________________________________________
>>Insight-users mailing list
>>Insight-users at itk.org
>>http://www.itk.org/mailman/listinfo/insight-users
>>
>>
>
> Quoted from:
> http://www.nabble.com/Discrete-vs.-RecursiveGaussianImageFilter--tf4148711.html#a11808661
>
>
More information about the Insight-users
mailing list