<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hey Theodore,<div><br></div><div>One quick way might be to send the output of the reader right into a vtkThreshold filter (that is set with a threshold range which will pass all of your data). I've never tried it with a vtkStructuredPoints, but it works well for vtkImageData, and I think it should work in your case.</div><div><br></div><div>There are test code samples linked off of the Doxygen page:</div><div><br></div><div><a href="http://www.vtk.org/doc/nightly/html/classvtkThreshold.html">http://www.vtk.org/doc/nightly/html/classvtkThreshold.html</a></div><div><br></div><div>Or, there is at least this one (and maybe more) on the VTK examples Wiki:</div><div><br></div><div><a href="http://www.itk.org/Wiki/VTK/Examples/ThresholdingCells">http://www.itk.org/Wiki/VTK/Examples/ThresholdingCells</a></div><div><br></div><div>(There's also a vtkThresholdPoints filter that outputs vtkPolyData)</div><div><br></div><div>-Eric</div><div><br><div>
<span class="Apple-style-span" style="font-size: 12px; "><div>------------------------------------------------------</div><div>Eric E Monson</div><div>Duke Visualization Technology Group</div><div><span class="Apple-style-span" style="font-size: medium;"><br></span></div></span>
</div>
<br><div><div>On May 7, 2010, at 2:16 PM, Jack wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div><div style="font-family:'times new roman', 'new york', times, serif;font-size:12pt"><div style="font-family:times, serif;font-size:12pt;"><div><span class="Apple-style-span" style="font-family:arial, sans-serif;font-size:13px;border-collapse:collapse;color:rgb(51, 51, 51);">Hi<div><br></div><div>I have a file with a dataset of structured points. I'd like to convert this to a dataset of unstructured points and/or unstructured grid. How can I do this?</div><div><br></div><div>So far, this is what I have:&nbsp;</div><div><br></div><div><div>int main()</div><div>{</div><div><span style="white-space:pre;">        </span>//get all data from the file</div><div><span style="white-space:pre;">        </span>vtkSmartPointer&lt; vtkStructuredPointsReader&gt; reader = vtkSmartPointer&lt; vtkStructuredPointsReader&gt;:: New();</div><div><span style="white-space:pre;">
        </span>reader-&gt;SetFileName("geometry. vtk");</div><div><span style="white-space:pre;">        </span>reader-&gt;Update();</div><div><br></div><div><span style="white-space:pre;">        </span>vtkStructuredPoints* structuredPoints = reader-&gt;GetOutput();</div><div><br></div><div><span style="white-space:pre;">        </span>//get the number of points the file contains</div><div>&nbsp;<span style="white-space:pre;">        </span>vtkIdType numPoints = structuredPoints-&gt; GetNumberOfPoints();</div><div>&nbsp;</div><div><span style="white-space:pre;">        </span>std::cout &lt;&lt; "There are " &lt;&lt; numPoints &lt;&lt; " points." &lt;&lt; std::endl;</div><div><br></div><div><span style="white-space:pre;">        </span>vtkSmartPointer&lt; vtkUnstructuredGrid&gt; unstructuredGrid = vtkSmartPointer&lt; vtkUnstructuredGrid&gt;::New();</div><div><br></div><div>}</div><div><br></div><div>It's incomplete and I'm not sure how to
 proceed.</div><div><br></div><div>Thanks in advance.</div><div><br></div><div>Theodore</div><div><br></div></div></span></div><div style=""></div>


</div><div style="position:fixed"></div>


</div><br>



      </div>_______________________________________________<br>Powered by <a href="http://www.kitware.com">www.kitware.com</a><br><br>Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html">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">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">http://www.vtk.org/mailman/listinfo/vtkusers</a><br></blockquote></div><br></div></body></html>