<div dir="ltr"><div>Have you tried calling Update() on the contour and the mapper after setting their input?<br><br></div><div>Hope this helps,<br><br>Shawn<br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Fri, Jun 14, 2013 at 4:30 AM, dalhotha <span dir="ltr"><<a href="mailto:dhothali@hotmail.com" target="_blank">dhothali@hotmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
hello,<br>
<br>
i'm a novice in vtk.<br>
<br>
I'm trying to do volume rendering.<br>
i segmented an object using Itk-snap. I saved it as vtk data file. i found<br>
that all what i have in the file is POINTS 26829 float , there is no cells.<br>
ive used vtkMarchingCubes as follow to get the surface but nothing appear.<br>
any help please..<br>
<br>
<br>
<br>
import vtk<br>
<br>
input='test.vtk'<br>
<br>
## read the file<br>
reader = vtk.vtkPolyDataReader()<br>
reader.SetFileName(input)<br>
reader.Update()<br>
<br>
<br>
<br>
## surface generation<br>
contour = vtk.vtkMarchingCubes()<br>
contour.SetInput(reader.GetOutput())<br>
<br>
## mapper<br>
mapper = vtk.vtkPolyDataMapper()<br>
mapper.SetInput(contour.GetOutput())<br>
<br>
## the actor<br>
actor = vtk.vtkActor()<br>
actor.SetMapper(mapper)<br>
<br>
## renderer and render window<br>
ren = vtk.vtkRenderer()<br>
ren.SetBackground(1, 0, 1)<br>
## add the actors to the renderer<br>
ren.AddActor(actor)<br>
<br>
renWin = vtk.vtkRenderWindow()<br>
renWin.SetSize(512, 512)<br>
renWin.AddRenderer(ren)<br>
<br>
## render window interactor<br>
iren = vtk.vtkRenderWindowInteractor()<br>
iren.SetRenderWindow(renWin)<br>
<br>
<br>
## initialize and start the interactor<br>
iren.Initialize()<br>
<br>
## render<br>
renWin.Render()<br>
iren.Start()<br>
<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://vtk.1045678.n5.nabble.com/need-help-in-vtkMarchingCubes-Python-tp5721398.html" target="_blank">http://vtk.1045678.n5.nabble.com/need-help-in-vtkMarchingCubes-Python-tp5721398.html</a><br>
Sent from the VTK - Users mailing list archive at Nabble.com.<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</blockquote></div><br></div>