[Insight-users] GradientRecursiveGaussianImageFilter

Luis Ibanez luis . ibanez at kitware . com
Tue, 07 Oct 2003 10:22:40 -0400


Hi Zein,

If you are using the GradientRecursiveGaussianImageFilter
you don't need to pre-smooth the image. This filter does
the equivalent of convolving the image with the derivatives
of a Gaussian. So you get the smoothing for free. Simply
select a Sigma value that you consider appropriate for your
data.

The resulting vector image *should* have positive and
negative vector components, as you already pointed out.

How are you checking on the values of the vector components ?
There may be a flaw in the mechanism you use for testing...

[For example, it may be that you are using a non-signed
  data type in one of your intermediate steps...]



Regards



   Luis


------------------------------
salah wrote:
> Hello,
> 
> I am using the  GradientRecursiveGaussianImageFilter to produce
> a vector image that represents the gradient of the input image. 
> The input to the filter is a binary image containing one segmented 
> connected component.  I want to compute the gradient vectors of
> the points at the surface of the seg. object. I smoothed the image 
> a littel bit using the RecursiveGaussianImageFilter, and then applied
> the GradientRecursiveGaussianImageFilter on it. 
>  
>  Since the (white) object is surrounded with a black background from 
> all sides, I suppose the gradient vectors will point in almost all 
> directions. In other words, they will have positive and negative 
> component values at the different locations at the surface. The strange 
> thing is that all vectors have positive components.
> 
> Could anybody guess what is going on? 
> 
> Many thanks,
> 
> Zein
> 
> 
> 
>>>Hi Zein
>>>
>>>1) Yes, the output of the GradientRecursiveGaussian filter
>>>   is an image of vectors representing the gradient of the
>>>   intensity values in the image. (covariant vectors to be
>>>   precise).
>>>
>>>http://www . itk . org/Insight/Doxygen/html/classitk_1_1GradientRecursiveGaussianImageFilter . html
>>>
>>>
>>>2) Yes, this filter take the spacing into account. The gradient
>>>   is reported as the variation of intensity per unit of spacing.
>>>   e.g.   graylevel / millimeters.
>>>
>>>  This means that if we have two images A and B with the same
>>>  intensity pattern, and image A has double the spacing of
>>>  image B, then the gradients computed from A will have half the
>>>  value of the equivalent gradients computed from B.
>>>
>>>  That's the reason why the gradient must be represented by
>>>  itk::CovariantVectors instead of itk::Vectors.
>>>
>>>
>>>
>>>Regards,
>>>
>>>
>>>
>>>  Luis
>>>
>>>
>>>
>>>
>>>------------------
>>>
>>>salah wrote:
>>>
>>>
>>>>Hello all,
>>>>
>>>>The output of the GradientRecursiveGaussianImageFilter is a vector
>>>>image that represents the gradient of the input image. Is this true?
>>>>
>>>>Does this filter take image spacings into account? In other 
>>>
>>>words, are
>>>
>>>
>>>>the gradient values measured in pixel units or real distance units?
>>>>
>>>>Many thanks,
>>>>Zein
>>>>
>>>
>>>
>>>
>>>
>>>
> 
> 
> 
> 
> "{"?n??왨??x%??H?Ƞ?۬z?"?J+?m?????????f??f??X??)ߣ?(!??rs==