{ } Raw JSON

bundles / skimage latest / skimage / morphology / footprints / _nsphere_series_decomposition

function

skimage.morphology.footprints:_nsphere_series_decomposition

source: /dev/scikit-image/src/skimage/morphology/footprints.py :379

Signature

def   _nsphere_series_decomposition ( radius ndim dtype = <class 'numpy.uint8'> )

Summary

Generate a sequence of footprints approximating an n-sphere.

Extended Summary

Morphological operations with an n-sphere (hypersphere) footprint can be approximated by applying a series of smaller footprints of extent 3 along each axis. Specific solutions for this are given in [1] for the case of 2D disks with radius 2 through 10.

Here we used n-dimensional extensions of the "square", "diamond" and "t-shaped" elements from that publication. All of these elementary elements have size (3,) * ndim. We numerically computed the number of repetitions of each element that gives the closest match to the disk (in 2D) or ball (in 3D) computed with decomposition=None.

The approach can be extended to higher dimensions, but we have only stored results for 2D and 3D at this point.

Empirically, the shapes at large radius approach a hexadecagon (16-sides [2]) in 2D and a rhombicuboctahedron (26-faces, [3]) in 3D.

Aliases

  • skimage.morphology.footprints._nsphere_series_decomposition