Binary morphology operations in Tomviz

In a previous blog post, I showed some basic segmentation algorithms recently added to Tomviz. These algorithms produce labeled images where a voxel’s label indicates the object to which it belongs.

Electron tomography image data may contain artifacts such as noise and reconstruction error, so it is often necessary to clean up mislabeled voxels in the segmentation results. Binary morphology operations make up one group of processing algorithms that can be used for this task [*]. They can be used on labeled images to fill in small holes in an object, remove small objects caused by noise, and either fuse or separate larger objects in an image.

In Tomviz, morphology operations for labeled images are provided as the data transforms Binary Dilate, Binary Erode, Binary Open, and Binary Close. The “Binary” in the name refers to the fact that the data transforms operate on voxels with two values, a foreground and background value. One may choose both the label to be considered foreground and the label to be considered background, so binary morphology operations can be used on images with more than two labels. Tomviz also makes it possible to select a spherically symmetric structuring element (box, ball, or cross) and set its radius, as shown in the dialog box for Binary Erode:


Below I show results of the four binary morphology operations available in Tomviz’s nightly builds. The images on the left are the starting image generated by the Binary Threshold data transform in TomViz, and the images on the right show the results of the morphology operations.


Original Binary Image

Morphology Operation Result

Dilate BinaryThresholdOriginal BinaryDilate
Erode BinaryThresholdOriginal BinaryErode
Open BinaryThresholdOriginal BinaryOpen
Close BinaryThresholdOriginal BinaryClose

With Tomviz’s integration of the Insight Registration and Segmentation Toolkit (, we are able to add more image processing and segmentation algorithm families to Tomviz.

[*] For details on mathematical morphology, please see, for example,

Questions or comments are always welcome!