[vtkusers] accelerated convert vtkImageData to vtkPoints

Jothybasu Selvaraj jothybasu at gmail.com
Thu Apr 5 05:26:10 EDT 2012


Try this

http://www.vtk.org/Wiki/VTK/Examples/Cxx/ImageData/ImageDataGeometryFilter

Jothy

On Thu, Apr 5, 2012 at 10:21 AM, qwcbeyond <340181048 at qq.com> wrote:

> I use this method,but it's too slow.........help.....
> when I convert a 512*512*365 volume to vtkPoints,it takes several minutes.
>
>   vtkSmartPointer<vtkPoints> points = vtkSmartPointer<vtkPoints>::New();
>
>  int subId, cellNum;
> double *paraCoords = new double[3];
> double *xyzCoords  = new double[3];
> double *vtkcellweights = new double[4];
>
> int NumberOfImageDataVoxels=image->GetNumberOfPoints();
>
> for (cellNum = 0; cellNum < NumberOfImageDataVoxels; cellNum++ )
> {
> subId = image->GetCell( cellNum )->GetParametricCenter(paraCoords);
> int &subIDadd = subId;
> image->GetCell(cellNum)->EvaluateLocation(subIDadd, paraCoords,
> xyzCoords, vtkcellweights);
>
> points->InsertNextPoint(xyzCoords);
>
> }
>
> --
> View this message in context:
> http://vtk.1045678.n5.nabble.com/accelerated-convert-vtkImageData-to-vtkPoints-tp5619900p5619900.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>



-- 
Jothy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120405/86274832/attachment.htm>


More information about the vtkusers mailing list