[vtkusers] vtkImageMapToColors + vtkTexture

Matthew Bowman matthew.bowman at sogotech.com
Thu Aug 23 13:54:19 EDT 2007


Greetings all. I'm new to VTK so take it easy on me :-)

I'm trying to expand on the Medical3.cxx example by taking the 
vtkImageMapToColors + vtkImageActor and visualize the result on a 
vtkPlaneSource (vtkPlaneSource -> vtkPolyDataMapper -> vtkActor). I'm 
trying to accomplish this to be able to slide the slice through the 
model and visualize the plane dynamically (as opposed to statically). 
I've tried to do this with vtkTexture but it gives me an error saying 3D 
textures are not supported.

What I'm doing (mostly copied form Medical3.cxx):

    vtkPlaneSource xPlaneSource = vtkPlaneSource::New();

    vtkPolyDataMapper xPlaneMapper = vtkPlaneMapper::New();
    xPlaneMapper->SetInputConnection(xPlaneSource->GetOutputPort());

    vtkActor xPlane = vtkActor::New();
    xPlane->SetMapper(xPlaneMapper);

    vtkLookupTable *bwLut = vtkLookupTable::New();
    ... [same as example] ...

    vtkImageMapToColors *xImageMap = vtkImageMapToColors::New();
    xImageMap->SetInputConnection(v16->GetOutputPort());
    xImageMap->SetLookupTable(bwLut);

    vtkTexture *texture = vtkTexture::New();
    texture->SetInputConnection(xImageMap->GetOutputPort());

    xPlane->SetTexture(texture);

Anyone out there know what I'm doing wrong (or if I'm even shooting in 
the right direction?)

Thanks in advance for any responses!
--Matthew





More information about the vtkusers mailing list