[vtkusers] Voxelize a point cloud (vtkVoxelModeller?)

David Doria daviddoria+vtk at gmail.com
Mon Nov 2 17:18:41 EST 2009


On Mon, Nov 2, 2009 at 2:53 PM,  <lynx.abraxas at freenet.de> wrote:
> On 31/10/09 15:56:11, David Doria wrote:
>>  I am trying to take a set of points and insert it into a voxelized 3d grid.
>> That is, the input is an unstructured point set (vtkPoints or similar) and
>> the output would be a structure that you can do something like the following
>> after voxelizing the points into a 10x10x10 grid:
>>
>> for(int x = 0; x < 10; x++)
>>   for(int y = 0; y < 10; y++)
>>    for(int z = 0; z < 10; z++)
>>      cout << "Grid cell " << x << " " << y << " " << z << " has " <<
>> Grid->GetNumberOfPointsInVoxel(x,y,z) << " points.";
>
> Hello David,
>
>
> If  You  want  to  creat some kind of N-D histogram by this it came to me that
> perhaps Gaussian_Splat might be of some help. I'm not sure if You can restrict
> the splatter to only the centre point but if You want to regard the histogram-
> smoothing caused by some uncertainty in the x,y,z position then Gaussian_Splat
> might be You choise.
>
> Regards,
> Lynx


Lynx,

Yes, this is perfect. I made an example here:
http://www.vtk.org/Wiki/Embed_points_into_a_volume
Maybe vtkVoxelModeller should be marked as deprecated? Or was I not
using it for the its intended use?

I tried to do SetRadius(0) which I thought would set the "spread" of
the point to be zero (an impulse) and therefore the entire
contribution of the point would be added directly to the voxel that it
is inside. However, when I did that (and even with SetRadius(.01)),
none of the voxels received any contributions (i.e. the resulting
imagedata was completely zeros). Do you know why that might be?

Thanks,

David



More information about the vtkusers mailing list