[vtkusers] 3D cells/voxels, vtkGeometryFilter, binary image surface extraction

Marc Niethammer marcn at ece.gatech.edu
Sun Jan 22 20:26:10 EST 2006


Hello!

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.

Marc



More information about the vtkusers mailing list