Skip to content

extension to vtkDiscreteMarchingCubes to also create vtkPointData Scalars containing the value of the neighbouring voxel

This extension to vtkDiscreteMarchingCubes makes it possible to let vtkDiscreteMarchingCubes also create vtkPointData Scalars containing the label value of the neighbouring voxel in a label image. This then allows to remove regions of the resulting mesh that are adjacent to specific other label meshes (for details see Grothausmann R. (2016) "Providing values of adjacent voxel with vtkDiscreteMarchingCubes" http://hdl.handle.net/10380/3559). For example a label image that was created by running a watershed on a distance map followed by masking with the original binary segmentation, a common procedure to separate regions in the segmentation at constrictions (see e.g. Beare and Lehmann (2006) "The watershed transform in ITK - discussion and new developments" http://hdl.handle.net/1926/202). Such a label image is shown in Fig. 1.

Fig. 1 A label image that separates a segmentation at constrictions and also contains a background label (0, rendered fully transparent). The cursor is on label 21 (light purple) which is adjacent to label 19 (dark pink): vtkdiscretemarchingcubes_extension_07

When creating meshes for each foreground label from such a label image the meshes are closed at the constrictions where the separation was introduced, see 3D view in Fig. 1 and Fig. 2.

Fig. 2 Meshes generated by vtkDiscreteMarchingCubes for the label image shown above, coloured differently and smoothed with vtkWindowedSincPolyDataFilter. Note the capping at constrictions: vtkdiscretemarchingcubes_extension_01

With the contributed extension to vtkDiscreteMarchingCubes the resulting mesh contains additional scalar data for the points that holds the label value of the adjacent label. A simple threshold that extracts the regions of the meshes that are adjacent to the background label (0) then makes it possible to remove the capping at constrictions, see Fig. 3.

Fig. 3 Result only displaying those regions of the meshes that were adjacent to the background label. Note that the capping is removed compared to Fig. 2: vtkdiscretemarchingcubes_extension_02

For example looking at label 19 and 21 (extracted by a simple threshold on the cell scalars generated by vtkDiscreteMarchingCubes) which are adjacent to each other but mostly separated by the background label, see Fig. 4.

Fig. 4 Showing only the meshes of label 21 (light grey) and 19 (dark grey). Regions of the mesh of label 21 are coloured if adjacent to other labels, e.g. red where 19 and 21 touch, i.e. where the separation took place: vtkdiscretemarchingcubes_extension_03

Fig. 5 Views of label 21 only, coloured as in Fig. 4: vtkdiscretemarchingcubes_extension_04 vtkdiscretemarchingcubes_extension_05

An additional threshold on the point scalars then removes the capping at the separation, see Fig 6.

Fig. 6 Capping removed from label 21: vtkdiscretemarchingcubes_extension_06

An advantage of this kind of capping removal is that it is even possible after the mesh was modified by other filters, e.g. smoothed by vtkWindowedSincPolyDataFilter. However, in most cases the resulting meshes are not connected on the open border edges any more, i.e. there will be gaps between them. The vtkCoplanarSurfaceExtractor (Grothausmann (2014) "Extracting Intersections of Coplanar Surfaces (Boolean-operation on touching meshes)" http://hdl.handle.net/10380/3504) can be used to avoid such gaps.

Edited by Roman Grothausmann

Merge request reports