[vtkusers] vtkImageMapToColors + vtkTexture
Matthew Bowman
matthew.bowman at sogotech.com
Sat Aug 25 07:11:09 EDT 2007
Well (like many others I'm replying to myself). So I've managed to do
this as follows:
vtkVolume16Reader v16 = vtkVolume16Reader::New();
[ ... same as Medical3.cxx ... ]
vtkImageReslice *transform = vtkImageReslice::New();
transform->SetInputConnection(v16->GetOutputPort());
transform->SetOutputExtent(0, 63, 32, 32, 0, 92);
vtkTexture *texture = vtkTexture::New();
texture->SetInputConnection(transform->GetOutputPort());
texture->SetLookupTable(satLut);
vtkActor *plane = vtkActor::New();
plane->SetTexture(texture);
[ ... same as Medical3.cxx ... ]
The texture is now being displayed properly (the correct slice is being
pulled out of the volume), however if I try and change the slice (using
SetOutputExtent(int[]) on vtkImageReslice) nothing happens. The original
OutputExtent is still getting used by the vtkTexture.
Is there something I'm doing wrong with trying to have the vtkTexture
use a "dynamic" source?
Thanks in advance for any replies!
--Matthew Bowman
Matthew Bowman wrote:
> 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
>
>
> _______________________________________________
> 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