[vtkusers] 2D visualization question

Dário Oliveira dariodisk at gmail.com
Sat Oct 6 20:33:49 EDT 2007


Friends,

I'm trying to show a segmentation result in 2d slices. It is possible to set
the original vtkImageData as background and then add transparent layers to
the image, with the results of the segmentation? Here is the code which
doesn't work. I would really appreciate any help, I'm stuck.


viewer->*SetInput*(reader->*GetOutput*());

renwin->*SetNumberOfLayers*(2);

renwin->*AddRenderer*(viewer->*GetRenderer*());

viewer->*GetRenderer*()->*SetLayer*(0);

vtkImageMapper* mapper = vtkImageMapper::*New*();

mapper->*SetInput*(pipe->getOutput());

mapper->*SetZSlice*(10);

mapper->*Update*();

// Creates actor to render slice

viewer->*GetRenderer*()->*SetLayer*(1);

vtkActor2D* cut = vtkActor2D::*New*();

cut->*SetMapper* (mapper);

cut->*GetProperty*()->*SetColor*(1.0,0,0);

cut->*GetProperty*()->*SetOpacity*(0.1);

 viewer->*GetRenderer*()->*AddActor2D*(cut);

Thanks.
-- 
Dário Oliveira
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20071006/ba8d010f/attachment.htm>


More information about the vtkusers mailing list