[vtkusers] Uniformly subdividing a 3D space with points

Bryn Lloyd blloyd at vision.ee.ethz.ch
Sun Jan 17 10:08:49 EST 2010


Hi David,


You could try the following:

1. put your regular grid (e.g. vtkImageData) into a vtkCellLocator.

2. query for each of your points in the point cloud: 
vtkCellLocator::FindCell(...)

3. store this information in a way suitable for you, e.g. vtkDataArray 
for the point cloud.


BTW. vtkDataSet (and all sub-classes) has its own "FindCell" method, so 
you could skip the vtkCellLocator.


Cheers
Bryn





David Doria wrote:
> I have a point cloud. I would like to break it down into a uniform
> grid of cubic voxels (axis aligned is fine). That is, I would like to
> be able to ask "which points are in voxel (i,j,k)?". The only way I
> know how to do this is to actually create a cube to represent each
> voxel and then, for each cube, use a vtkSelectEnclosedPoints filter.
> This seems very "manual" - I'd need to come up with a data structure
> to store the cubes in this (i,j,k) type format, etc. It seems like
> there should be a way to divide the space into a grid of cubes all in
> one shot.
> 
> Does anyone know of a filter that does this efficiently?
> 
> Thanks,
> 
> David
> _______________________________________________
> 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
> 





More information about the vtkusers mailing list