[vtkusers] accelerated convert vtkImageData to vtkPoints

qwcbeyond 340181048 at qq.com
Thu Apr 5 05:21:11 EDT 2012


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.



More information about the vtkusers mailing list