[vtkusers] cleaning up a surface rendering

Amy Henderson amy.henderson at kitware.com
Thu Mar 25 11:35:21 EST 2004


John,

vtkConnectivityFilter should be helpful to you.  See 
http://www.vtk.org/doc/nightly/html/classvtkConnectivityFilter.html.

- Amy

At 11:05 AM 3/25/2004, John Hunter wrote:

>I am using marching cubes to do some surface rendering of CT data.  I
>would like to "clean up" the data by using a picker to remove some of
>the iso surfaces from the results.  Basically, I have a number of
>disjoint surfaces and I want to remove some of them.
>
>My marching cube code is standard issue
>
>     iso = vtk.vtkMarchingCubes()
>     iso.SetInput(reader.GetOutput())
>     iso.SetValue(0,1200)
>
>     isoMapper = vtk.vtkPolyDataMapper()
>     isoMapper.SetInput(iso.GetOutput())
>     isoMapper.ScalarVisibilityOff()
>
>     isoActor = vtk.vtkActor()
>     isoActor.SetMapper(isoMapper)
>     isoActor.GetProperty().SetColor(0.9804,0.9216,0.8431)
>
>     ren.AddActor(isoActor)
>     ren.SetBackground(0.2,0.3,0.4)
>
>I have worked with a variety of vtk pickers before and have some
>familiarity with them.  But I don't know how to take the polygon
>output of the marching cube algorithm and segregate it into separate
>contiguous chunks to feed to the picker, nor how to remove these
>pieces once picked.
>
>Should I work with the polyData and vtkCellPicker?  Something along
>the lines of
>
>     picker = vtk.vtkCellPicker()
>     polyData = iso.GetOutput()
>     # pick, get the cell id
>     polyData.DeleteCell (cellId)
>
>I'm not sure how the cell data is arranged in the polyData, and if
>this approach would get an entire contiguous chunk or a single
>face, or if it is at all viable.
>
>Pointers to docs, relevant classes, examples, or otherwise
>appreciated!
>
>Thanks,
>John Hunter
>
>_______________________________________________
>This is the private VTK discussion list.
>Please keep messages on-topic. Check the FAQ at: 
><http://public.kitware.com/cgi-bin/vtkfaq>
>Follow this link to subscribe/unsubscribe:
>http://www.vtk.org/mailman/listinfo/vtkusers






More information about the vtkusers mailing list