[Insight-users] x&y component of the gradient of an image

Sergio Vera sergio.vera at alma3d.com
Thu Sep 22 11:56:13 EDT 2011


Hi Antonio

This example will show how to calculate the gradient
http://www.vtk.org/Wiki/ITK/Examples/EdgesAndGradients/GradientRecursiveGaussianImageFilter
While this one exemplifies how to traverse  a image with iterators:
http://www.vtk.org/Wiki/ITK/Examples/Iterators/ImageRegionIterator
In your app you should be traversing a covariant vector image and writing to
two different write iterators associated to the gradient component images
that you are generating
(so one iterators is to traverse the source covariant vector image while two
additional iterators write the component images)
This other toy example shows how to access the separate components of the
covariant vector http://www.vtk.org/Wiki/ITK/Examples/Math/CovariantVector

Hope to help, best regards
Sergio

2011/9/22 Antonio Gómez Barquero <agb1 at alu.upct.es>

> ** **
>
> Thanks Sergio!****
>
> ** **
>
> I would like to generate separated x and y component as are given in the
> calculation of the gradient in Matlab. So I would try the second option, but
> I don’t fully understand “to transverse the convariance vector image”, can
> anyone give a example with pseudocode or something, please?****
>
> ** **
>
> Thanks, merci!****
>
> ** **
>
> Antonio****
>
> ** **
>
> *De:* Sergio Vera [mailto:sergio.vera at alma3d.com]
> *Enviado el:* jueves, 22 de septiembre de 2011 10:37
> *Para:* Antonio Gómez Barquero; itk Users
> *Asunto:* Re: [Insight-users] x&y component of the gradient of an image***
> *
>
> ** **
> Hello!****With  itk::GradientImageFilter you obtain a output image
> consisting of a covariant vector image with the x and y components...****
>
> If you want to generate separated x and y components in two different
> images you can use iterators to traverse the covariant vector image and just
> copy the x and y values into different images****
> regards****
>
> ** **
>
> 2011/9/22 Antonio Gómez Barquero <agb1 at alu.upct.es>****
>
>  ****
>
>  ****
>
> Hello!****
>
> I would like to calculate the *x* and *y* component of the gradient of a
> 2D image. As in MATLAB is calculated with [dT2,dT1] = gradient(T);****
>
>  ****
>
> ReaderType::Pointer T_g            // image ****
>
>                 FilterType::Pointer gradientFilter = FilterType::New();***
> *
>
>                 gradientFilter->SetInput( T_g->GetOutput());****
>
>                 gradientFilter->Update();****
>
> With this sentence, I get the result, but I want to have the x-component
> and the y-component****
>
> gradientFilter->GetOutput()****
>
> Is there any method to extract it? I am looking for it but I have no
> positive result!****
>
>  ****
>
> Thanks so much****
>
>  ****
>
> Antonio****
>
>  ****
>
>  ****
>
> Ingeniero de Telecomunicaciones -Becario Investigador asociado a
> Actividades de I+D+I ****
>
> GTTS ( Grupo de Tratamiento y Teoría de la Señal)[ http://gtts.upct.es/]**
> **
>
> UPCT (Universidad Politécnica de Cartagena)[ http://www.upct.es/]****
>
>  ****
>
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users****
>
>
>
> ****
>
> ** **
>
> --
> Sergio Vera
>
>  Alma IT Systems
>  C/ Vilana, 4B, 4º 1ª
>  08022 Barcelona
>  T. (+34) 932 380 592
>  www.alma3d.com****
>



-- 
Sergio Vera

 Alma IT Systems
 C/ Vilana, 4B, 4º 1ª
 08022 Barcelona
 T. (+34) 932 380 592
 www.alma3d.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20110922/8ef0f3c9/attachment.htm>


More information about the Insight-users mailing list