AW: [Insight-users] GradientRecursiveGaussianImageFilter : Selecting Sigma.

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


Hi Zein,

It depends on what you want to do with the vectors...

That is, how far from the edge of the binary object
do you want to have information about the edges ?

Note that the larger the sigma is, the wider will be
the region around the edge where you will get traces
of the gradient vector field.

The easy way to find good value is to use the
application:

      InsightApplications/GaussianFilter,

Load your image, get some coffee and play with the
Gaussian values while you look at the output of
the gradient magnitude using the button labeled
with "Modulus".

NOTE THAT SIGMA IS GIVEN IN MILLIMETERS, not PIXELS.

For your data spacings I would start with Sigma=0.5mm
and  go from there...



Regards,



   Luis



--------------
salah wrote:
> Thanks Luis,
> 
> what value of sigma would you suggest for a binary 
> image of spacing  (0.2  0.2  1)  ?
> 
> best regards,
> 
> Zein
> 
> 
>>-----Ursprüngliche Nachricht-----
>>Von: Luis Ibanez [mailto:luis . ibanez at kitware . com]
>>Gesendet: Dienstag, 7. Oktober 2003 16:23
>>An: salah
>>Cc: ITK Users (E-Mail)
>>Betreff: Re: [Insight-users] GradientRecursiveGaussianImageFilter
>>
>>
>>
>>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_1Gradien
>>>>
>>tRecursiveGaussianImageFilter.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==
>>
>>
>>
>>
>>