[vtkusers] Voxelization

David Doria daviddoria+vtk at gmail.com
Wed Mar 10 18:23:14 EST 2010


On Wed, Mar 10, 2010 at 6:12 PM, Daniel Soares <adaptchart.info at gmail.com>wrote:

> I suppose you are saying that I use the following pipeline:
>
> vtkSphereSource -> vtkVoxelModeller -> vtkDelaunay3D
>
> The problem is that the input of vtkDelaunay3D is a vtkPointSet and the
> output of vtkVoxelModeller is a vtkImageData. How could I convert a
> vtkImageData to a vtkPointSet?
>
> Anyway, it looks like the solution involves vtkMarchingCubes, as it's input
> is a vtkImageData. The problem is that vtkMarchingCubes is not displaying
> any result when used in my source code.
>
> Any ideas?
>
> Daniel Soares
>
>
To convert an ImageData to a PointSet, I don't think there is a better way
than to do:

vtkPolyData* pd = vtkPolyData::New();
for(unsigned int i = 0; i < image->GetNumberOfPoints(); i++
{
  double p[3];
  image->GetPoint(i, p);
  pd->InsertNextPoint(p);
}

As for why marching cubes doesn't display anything - maybe you can make the
simplest example that will compile - make a sphere source, convert it to an
ImageData, then run MarchingCubes. Post this compilable code to the list and
we'll check it out.

Thanks,

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100310/989359f2/attachment.htm>


More information about the vtkusers mailing list