[vtkusers] Not getting to use the vtkThreshold with a vtkRectilinearGrid
Adriano Gonçalves
adriano at esss.com.br
Thu Dec 17 08:08:50 EST 2009
Hi, good afternoon for everybody!
I'm with a difficulty in using the vtkThreshold: I'm trying to kill, in
a vtkRectilinearGrid, all the cells with value lower than a specific
value. But, when I try to render the result, nothing appears. Can
anybody give me a help? This is my code:
thresh = vtk.vtkThreshold()
thresh.SetInput(vtk_grid.GetDataSet()) *#
vtk_grid.GetDataSet()* returns me a vtkRectilinearGrid
thresh.ThresholdByLower(0.5)* # The values of the cells are
from 0 to 1*
gridMapper = vtk.vtkDataSetMapper()
gridMapper.SetInputConnection(thresh.GetOutputPort())
gridActor = vtk.vtkActor()
gridActor.SetMapper(gridMapper)
ren1 = vtk.vtkRenderer()
ren1.AddActor(gridActor)
ren1.AddActor(gridActor)
ren1.SetBackground(0, 0, 0)
renWin = vtk.vtkRenderWindow()
renWin.AddRenderer(ren1)
renWin.SetSize(500, 500)
iren = vtk.vtkRenderWindowInteractor()
iren.SetRenderWindow(renWin)
iren.Initialize()
iren.Start()
Thank you so much!
--
Adriano
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20091217/4a1b7353/attachment.htm>
More information about the vtkusers
mailing list