[vtkusers] Visualizing a vector field from a vtkImageData
David Doria
daviddoria at gmail.com
Mon Sep 12 13:51:46 EDT 2011
On Mon, Sep 12, 2011 at 9:28 AM, David Doria <daviddoria at gmail.com> wrote:
> On Mon, Sep 12, 2011 at 9:17 AM, Eric E. Monson <emonson at cs.duke.edu> wrote:
>> Hey David,
>>
>> I just sent you a more detailed email off-list, but the problem is that you're adding 2-component Scalars to the ImageData, but then you're telling the glyph filter to use the ImageData's Vectors (which haven't been assigned). You need to add a third component to the scalars and then make a call to image->GetPointData()->SetActiveVectors("ImageScalars"); and I think it all works.
>>
>> -Eric
A (maybe) quick follow up -
The resulting scene is horribly slugglish to interact with, even
though it only appears to draw ~200 vectors. I assume this is because
it is still "trying" to draw the rest of the vectors, but they are
just invisible because they are scaled by the vector magnitude, which
is zero (if most of the pixels in the vtkImageData are (0,0,0) (zero
vectors) ). Is there a way to tell the Glyph filter to ignore these
zero vectors all together?
Thanks,
David
More information about the vtkusers
mailing list