[vtkusers] "Convert" output of vtkImageExtractComponents to a vector?

David Doria daviddoria at gmail.com
Tue Aug 28 17:18:58 EDT 2012


On Tue, Aug 28, 2012 at 5:11 PM, Cory Quammen <cquammen at cs.unc.edu> wrote:
> Hi all,
>
> I am using vtkImageExtractComponents to produce an image with three
> components per pixel. I would like to treat these three components as
> a vector field to pass to vtkGlyph3D. However, the data coming out of
> vtkImageExtractComponents is treated as a scalar field rather than a
> vector field, so I can't orient the glyphs according to the vectors in
> this data array.
>
> What might I do to get vtkGlyph3D to recognize this three-component
> image data as a vector so that it can orient glyphs along the vector
> direction? I'm assuming it's something simple, but everything I've
> tried doesn't work.
>
> Thank you in advance,
> Cory

Did you try:

imageData->GetPointData()->SetVectors(imageData->GetPointData()->GetScalars());

? (I've never done this, but it seems worth a try).

David



More information about the vtkusers mailing list