[Insight-users] Questions about ITK Gradient Filters
cagatay bilgin
bilgincc at gmail.com
Fri Sep 23 20:34:53 EDT 2011
Hello everybody,
0) From what I understood, there are three (main) ways
one can calculate the gradient of an image in ITK:
a) Use itkGradientImageFilter
b) Use itkRecursiveGaussianImageFilter that
approximates the gradient
c) Use DiscreteGaussianImageFilter which is slower
but more accurate for ``smaller" sigma values
I will start with the RecurssiveGaussianImageFilter
given here:
http://www.itk.org/Doxygen/html/classitk_1_1RecursiveGaussianImageFilter.html#details
1) Here It says "it can take the derivative of the blurred image in one
step"
and there is no SetDirection function listed on this page as expected from
the previous sentence. However, if you follow the examples link, there you
see that SetDirection is being used. The itk manual also has SetDirection
method. From my toy example, without using SetDirection, the
default behavior
looks like the filter is using the X direction.
1.a) Assuming that this filter is going to work in all the directions
without the need of a different filter for each and every other
direction, how would one go with images having different
resolution in a dimension? If my x-y spacing is 1micron
and z spacing is 2micron, how would the filter behave
and what flags should be turned on for correct behavior?
1.b) Assuming that this filter will need the dimension that it is
going to work, I guess it is the user's responsibility to set the
sigma values accordingly to match with my image spacing?
2) Similar questions can be asked about GradientRecursiveGaussianImageFilter
given here:
http://www.itk.org/Doxygen/html/classitk_1_1GradientRecursiveGaussianImageFilter.html#details
The page does not list any SetDirection function and
this time the given examples are matching. My question
is whether the filter is compensating for my z spacing issue.
Do I need to use resample filter and interpolate my image
prior to using this filter ? The same question arises for the
HessianRecursiveGaussianImageFilter.
3) For the case of DiscreteGaussianImageFilter given here
http://www.itk.org/Doxygen/html/classitk_1_1DiscreteGaussianImageFilter.html#details
it looks like I can use SetUseImageSpacing to solve my
problem about the spacing. The submission also states
"The analytical approach results in increased accuracy and speed
with respect to convolution with the itk::DerivativeOperator, which
can lead to numerical problems with large values of σ."
4) DiscreteGaussianDerivativeImageFilter expects an array
for SetOrder function(eg [0,2,0] for Iyy), the rest of the derivative
classes expects just a number. Some of these filters use
SetSigma some use SetVariance which makes it harder to
just change the DerivativeType and compare results. It might
be handy to have a common API
I guess there are many different ways which made me a little
bit confused. I would appreciate any help
Thank you,
Cagatay Bilgin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20110923/9ae5d349/attachment.htm>
More information about the Insight-users
mailing list