Hi all,<br>I would appreciate your input regarding the following issue. I&nbsp; am trying to visualize the 2D vector field corresponding to an image gradient, using vtkImageGradient, vtkAssignAttribute, and vtkGlyph3D. I've seen the scalar components out of vtkImageGradient and the gradient looks fine, however, the arrow glyphs are always parallel to the &quot;x&quot; axis (direction and scale seem to be right at least), even though there are several nonzero components in the &quot;y&quot; gradient direction. Unfortunately, the online documentation is not helping that much. Thanks in advance! (what I think are the relevant portions of tcl code follow)
<br>...<br># placing the image gradient components (a subsample of them) in the point data VECTORS <br><br>vtkImageGradient hgrd<br>&nbsp;&nbsp; hgrd SetInput [ himg GetOutput ]<br>&nbsp;&nbsp; hgrd SetDimensionality 3<br>&nbsp;&nbsp; hgrd HandleBoundariesOn
<br>vtkImageShrink3D hgsub <br>&nbsp;&nbsp; hgsub SetInput [ hgrd GetOutput ]<br>&nbsp;&nbsp; hgsub SetShrinkFactors 5 5 1<br>vtkAssignAttribute hg <br>&nbsp;&nbsp; hg SetInput [ hgsub GetOutput ]<br>&nbsp;&nbsp; hg Assign SCALARS VECTORS POINT_DATA<br>...<br># building the glyph
<br><br>vtkGlyphSource2D arrow<br>&nbsp;&nbsp; arrow SetGlyphTypeToArrow<br>&nbsp;&nbsp; arrow SetScale 0.2<br>vtkGlyph3D field<br>&nbsp;&nbsp; field SetInput [ hg GetOutput ]<br>&nbsp;&nbsp; field SetSource [ arrow GetOutput ]<br>&nbsp;&nbsp; field ScalingOn<br>&nbsp;&nbsp; field OrientOn
<br>&nbsp;&nbsp; field SetScaleFactor 0.05<br clear="all">...<br><br><br><br>-- <br>Oscar Yanez Suarez<br>Laboratorio de Neuroimagenologia<br>Departamento de Ingenieria Electrica<br>UAM - Iztapalapa<br><a href="http://docencia.izt.uam.mx/oys">
http://docencia.izt.uam.mx/oys</a>