<div dir="ltr">Try this<br><br><a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/ImageData/ImageDataGeometryFilter">http://www.vtk.org/Wiki/VTK/Examples/Cxx/ImageData/ImageDataGeometryFilter</a><br><br>Jothy<br><br><div class="gmail_quote">
On Thu, Apr 5, 2012 at 10:21 AM, qwcbeyond <span dir="ltr"><<a href="mailto:340181048@qq.com">340181048@qq.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I use this method,but it's too slow.........help.....<br>
when I convert a 512*512*365 volume to vtkPoints,it takes several minutes.<br>
<br>
vtkSmartPointer<vtkPoints> points = vtkSmartPointer<vtkPoints>::New();<br>
<br>
int subId, cellNum;<br>
double *paraCoords = new double[3];<br>
double *xyzCoords = new double[3];<br>
double *vtkcellweights = new double[4];<br>
<br>
int NumberOfImageDataVoxels=image->GetNumberOfPoints();<br>
<br>
for (cellNum = 0; cellNum < NumberOfImageDataVoxels; cellNum++ )<br>
{<br>
subId = image->GetCell( cellNum )->GetParametricCenter(paraCoords);<br>
int &subIDadd = subId;<br>
image->GetCell(cellNum)->EvaluateLocation(subIDadd, paraCoords,<br>
xyzCoords, vtkcellweights);<br>
<br>
points->InsertNextPoint(xyzCoords);<br>
<br>
}<br>
<br>
--<br>
View this message in context: <a href="http://vtk.1045678.n5.nabble.com/accelerated-convert-vtkImageData-to-vtkPoints-tp5619900p5619900.html" target="_blank">http://vtk.1045678.n5.nabble.com/accelerated-convert-vtkImageData-to-vtkPoints-tp5619900p5619900.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><br clear="all"><br>-- <br><div dir="ltr">Jothy<br></div><br>
</div>