[vtkusers] need help in vtkMarchingCubes Python!!

dalhotha dhothali at hotmail.com
Sat Jun 15 02:46:37 EDT 2013


yah I did as follow , its not working either :( , an empty render window. any
help plzz

import vtk

input='test.vtk'
 
## read the file
reader = vtk.vtkPolyDataReader()
reader.SetFileName(input)
reader.Update()



## surface generation
contour = vtk.vtkMarchingCubes() #for label images
contour.SetInput(reader.GetOutput())
contour.Update()

## mapper
mapper = vtk.vtkPolyDataMapper()
mapper.SetInput(contour.GetOutput())
mapper.Update()


## the actor
actor = vtk.vtkActor()
actor.SetMapper(mapper)

## renderer and render window 
ren = vtk.vtkRenderer()
ren.SetBackground(1, 0, 1)
## add the actors to the renderer
ren.AddActor(actor)

renWin = vtk.vtkRenderWindow()
renWin.SetSize(512, 512)
renWin.AddRenderer(ren)

## render window interactor
iren = vtk.vtkRenderWindowInteractor()
iren.SetRenderWindow(renWin)


## initialize and start the interactor
iren.Initialize()

## render
renWin.Render()
iren.Start()




--
View this message in context: http://vtk.1045678.n5.nabble.com/need-help-in-vtkMarchingCubes-Python-tp5721398p5721420.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list