<div dir="ltr">Check out this example [1] in C++. Or maybe [2] or [3] from the Python examples.<div><br></div><div>[1] <a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/Medical/GenerateModelsFromLabels">http://www.vtk.org/Wiki/VTK/Examples/Cxx/Medical/GenerateModelsFromLabels</a></div>
<div>[2] <a href="http://www.vtk.org/Wiki/VTK/Examples/Python/MeshLabelImage">http://www.vtk.org/Wiki/VTK/Examples/Python/MeshLabelImage</a></div><div>[3] <a href="http://www.vtk.org/Wiki/VTK/Examples/Python/MeshLabelImageColor">http://www.vtk.org/Wiki/VTK/Examples/Python/MeshLabelImageColor</a></div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Jun 15, 2013 at 3:46 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">
yah I did as follow , its not working either :( , an empty render window. any<br>
help plzz<br>
<div class="im"><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>
</div>contour = vtk.vtkMarchingCubes() #for label images<br>
contour.SetInput(reader.GetOutput())<br>
contour.Update()<br>
<div class="im"><br>
## mapper<br>
mapper = vtk.vtkPolyDataMapper()<br>
mapper.SetInput(contour.GetOutput())<br>
</div>mapper.Update()<br>
<div class="im"><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>
</div>View this message in context: <a href="http://vtk.1045678.n5.nabble.com/need-help-in-vtkMarchingCubes-Python-tp5721398p5721420.html" target="_blank">http://vtk.1045678.n5.nabble.com/need-help-in-vtkMarchingCubes-Python-tp5721398p5721420.html</a><br>
<div class="HOEnZb"><div class="h5">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>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Christopher Mullins<div>R&D Engineer</div><div>Kitware Inc.,</div><div>919.869.8871</div>
</div></div>