[vtkusers] Visualizing a vector field from a vtkImageData
David Doria
daviddoria at gmail.com
Tue Sep 20 10:05:02 EDT 2011
> 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
>
I suppose one way to do this is to extract the points based on their
magnitude before glyphing. I tried to do that here (just extract the
points, not the glyphing):
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Broken/VectorFieldNonZeroExtraction
I am getting an error:
"vtkExtractSelectedThresholds (0x9ba6a40): Could not figure out what
array to threshold in."
I thought that's what this line:
extract->SetInputArrayToProcess(0,0,0,
vtkDataObject::FIELD_ASSOCIATION_POINTS, "ImageScalars");
was specifying?
Any thoughts on how to do this?
Thanks,
David
More information about the vtkusers
mailing list