The data in the vtp is just a set of points (vertices). I wanted to get a surface from the points.<br><br>Here&#39;s what I&#39;ve tried:<br><br><br>    vtkSmartPointer&lt;vtkXMLPolyDataReader&gt; reader = vtkSmartPointer&lt;vtkXMLPolyDataReader&gt;::New();<br>
    reader-&gt;SetFileName(InputFile.c_str());<br>    reader-&gt;Update();<br>    cout &lt;&lt; &quot;NumPoints: &quot; &lt;&lt; reader-&gt;GetOutput()-&gt;GetNumberOfPoints() &lt;&lt; endl;<br><br>    vtkSmartPointer&lt;vtkContourFilter&gt; CF = vtkSmartPointer&lt;vtkContourFilter&gt;::New();<br>
    //CF-&gt;SetValue(0,128);<br>    double range[2];<br>    range[0] = 0;<br>    range[1] = 1000;<br>    CF-&gt;GenerateValues(0, range);<br>    CF-&gt;SetInputConnection(reader-&gt;GetOutputPort());<br>    CF-&gt;Update();<br>
    <br>    vtkSmartPointer&lt;vtkXMLPolyDataWriter&gt; writer = vtkSmartPointer&lt;vtkXMLPolyDataWriter&gt;::New();<br>    writer-&gt;SetInputConnection(CF-&gt;GetOutputPort());<br>    writer-&gt;SetFileName(OutputFile.c_str());<br>
    writer-&gt;Update() ;<br><br>but it just makes an empty file. Where have I gone wrong?<br><br clear="all">Thanks,<br><br>David<br>
<br><br><div class="gmail_quote">On Wed, Mar 4, 2009 at 10:00 AM, Bryn Lloyd <span dir="ltr">&lt;<a href="mailto:blloyd@vision.ee.ethz.ch">blloyd@vision.ee.ethz.ch</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Is your data a surface? Is there data associated with the polydata?<br>
<br>
What do you expect marching cubes to give you? (lines?)<br>
<br>
<br>
You could use vtkContourFilter, it works on any kind of vtkDataSet, i.e. polydata...<br>
<br>
<a href="http://www.vtk.org/doc/nightly/html/classvtkContourFilter.html" target="_blank">http://www.vtk.org/doc/nightly/html/classvtkContourFilter.html</a><br>
<br>
--Bryn<br>
<br>
<br>
<br>
<br>
David Doria wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="h5">
I am reading in a vtp file and then trying to run the vtkMarchingCubes filter. It says the input is of type vtkPolyData, but a vtkImageData is required.<br>
<br>
I tried to use vtkMarchingContourFilter and it says no data to contour.<br>
<br>
It makes sense that the points should be on a structured grid, but how do I create one?<br>
<br>
Thanks,<br>
<br>
David<br>
<br>
<br></div></div>
------------------------------------------------------------------------<div class="im"><br>
<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></blockquote>
<br>
<br>
-- <br>
-------------------------------------------------<br><font color="#888888">
Bryn Lloyd<br>
Computer Vision Laboratory<br>
ETH Zürich, Sternwartstrasse 7<br>
CH - 8092 Zürich, Switzerland<br>
Tel: +41 44 63 26668<br>
Fax: +41 44 63 21199<br>
-------------------------------------------------<br>
</font></blockquote></div><br>