3D cells/voxels, vtkGeometryFilter, binary image surface extraction

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

3D cells/voxels, vtkGeometryFilter, binary image surface extraction

Marc Niethammer

I am trying to extract the exact (without interpolation) voxel boundary
of a binary image.
The man page of vtkGeometryFilter states that it will extract the
boundary of 3D cells
(the 2D faces that are not shared).

How do I construct such a voxel dataset from binary image data (passed
through the vtkThresholdFilter)?

So far, I tried to use vtkGlyph3D combined with an adapted vtkCubeSource
(so that it would return a voxel).

I constructed the voxel as follows

vtkVoxel *aVoxel = vtkVoxel::New();

 aVoxel->GetPointIds()->SetId(0, solidptids[0] );
 aVoxel->GetPointIds()->SetId(0, solidptids[1] );
 aVoxel->GetPointIds()->SetId(0, solidptids[3] );
 aVoxel->GetPointIds()->SetId(0, solidptids[2] );
 aVoxel->GetPointIds()->SetId(0, solidptids[4] );
 aVoxel->GetPointIds()->SetId(0, solidptids[5] );
 aVoxel->GetPointIds()->SetId(0, solidptids[7] );
 aVoxel->GetPointIds()->SetId(0, solidptids[6] );

 newPolys->InsertNextCell( aVoxel );

However, this does not seem to work. Do I need to specify faces and
edges somewhere?

If I use the standard vtkCubeSource, I get a resulting mesh that follows
the voxels in the
image data, however, I also get interior diagonals (which I do not want).

Many thanks for any help.

This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
Follow this link to subscribe/unsubscribe: