[vtkusers] StreamTracer input Attribute
Berk Geveci
berk.geveci at kitware.com
Thu Nov 29 21:04:53 EST 2007
I do. vtkImageGradient by default produces a scalar attribute. The
stream tracer does not know that you want it to use that array. You
need to use a vtkAssignAttribute or use the SetInputArrayToProcess()
method.
-berk
On 11/29/07, Kevin H. Hobbs <hobbsk at ohiou.edu> wrote:
> On Thu, 2007-11-29 at 13:25 -0500, Kevin H. Hobbs wrote:
> > I've been having difficulty producing streamlines. So far my pipeline
> > looks like this:
> > ImageData to ImageGradient to StreamTracer to XMLPolyDataWriter. The
> > polydata this produces is empty.
> >
> > Do I need to use AssignAttribute between ImageGradient and StreamTracer?
> > How should I set the attributes?
> > Am I missing something else?
>
> To be very specific I don't see why this doesn't work:
>
> package require vtk
>
> # Create some image data
> vtkRTAnalyticSource image_source
> image_source Update
>
> # Calculate the gradient
> vtkImageGradient gradient
> gradient SetDimensionality 3
> gradient SetInputConnection [image_source GetOutputPort]
> gradient Update
>
> # Create streamer
> vtkStreamTracer streamer
> streamer SetInputConnection [gradient GetOutputPort]
> streamer Update
>
> # write the streamline
> vtkXMLPolyDataWriter stream_writer
> stream_writer SetInputConnection [streamer GetOutputPort]
> stream_writer SetFileName "tmp/stream.vtp"
> stream_writer Write
>
> exit
>
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
>
More information about the vtkusers
mailing list