[vtkusers] how to get the position of every voxel in world coordinates?

qwcbeyond 340181048 at qq.com
Sun Apr 1 05:13:04 EDT 2012


I use this method,but it's too slow.........help.....

   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/how-to-get-the-position-of-every-voxel-in-world-coordinates-tp5609957p5610087.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list