[Insight-users] Computing the gradient of a vector image

Luis Ibanez luis.ibanez at kitware.com
Fri Dec 10 17:49:29 EST 2010


On Fri, Dec 10, 2010 at 8:30 AM, David Doria <daviddoria at gmail.com> wrote:
> On Fri, Dec 10, 2010 at 5:44 AM, Luis Ibanez <luis.ibanez at kitware.com> wrote:
>> Hi David,
>>
>> The gradient of a vector image could have different interpretations...
>>
>> The Gradient of a scalar image will be an image of covariant vectors.
>>
>> The Gradient of a vector image will be an image of Tensors
>> one of whose indices will be covariant and the other contravariant.
>>
>> Are you looking for a filter that will produce an image of
>> tensors as output ?
>
> Say there is a pixel like this (a itk::Image<itk::CovariantVector<int, 3>, 2> )
>
>           (0,0,0)
> (1,1,1) (3,3,3)
>
> (pixel of interest is (3,3,3) and its top and left neighbor are shown).
>
> If we used only these two neighbors to compute the gradient (backwards
> differencing), couldn't the gradient at the pixel of interested be
> computed/interpreted as:
>
> { (2,2,2), (3,3,3) }
>
> That is, a 2-vector of 3-vectors describing
> { the change in the the gradient vector moving along dimension 0, the
> change in the gradient vector moving along dimenson 1}
>


Yes,
this entity is a Tensor of second rank,
where both indexes are covariant.

That said,
the Tensor form may not be the one
that is convenient for your subsequent
processing.

In any case, coming back to your original
question, probably the best way to do it
is to loop through the components with the

http://public.kitware.com/Insight/Doxygen/html/classitk_1_1VectorIndexSelectionCastImageFilter.html

and at each time compute the gradient
of that component with the

http://public.kitware.com/Insight/Doxygen/html/classitk_1_1GradientRecursiveGaussianImageFilter.html


Note also that some of the RecursiveGaussian
filter have been converted to support VectorImages,
but I'm not sure if the Gradient one is one of them.


     Luis



> ?
>
> Thanks,
>
> David
>


More information about the Insight-users mailing list