DIPlib Documentation - ©1995-2014 Quantitative Imaging Group, Delft University of Technology.

The connectivity parameter

DIPlib uses a different name for the various possible connectivites than you might be used to. This is to generalize this parameter to images of any dimensionality. It is defined as follows: if connectivity is 1 all pixels for which only one coordinate differs from the pixel's coordinates by maximally 1 are considered neighbours; if it is 2, all pixels for which one or two coordinates differ maximally 1 are considered neighbours. The connectivity can never be larger than the image dimensionality.

In terms of the obsolete connectivity definitions we have:

In 2-Dthis connectivitycorresponds toand forms this structuring element
14 connectivitydiamond
28 connectivitysquare
-14-8 connectivityoctagon
-28-4 connectivityoctagon
In 3-Dthis connectivitycorresponds toand forms this structuring element
16 connectivityoctahedron
218 connectivitycuboctahedron
326 connectivitycube
-16-26 connectivitysmall rhombicuboctahedron
-326-6 connectivitysmall rhombicuboctahedron

The negative connectivities are only defined for the functions in binary morphology such as BinaryDilation and BinaryErosion. These alternate steps with different connectivity to produce a better approximation to an isotropic structuring element.