bundles / skimage latest / skimage / morphology / footprints / cube
function
skimage.morphology.footprints:cube
source: /dev/scikit-image/src/skimage/morphology/footprints.py :701
Signature
def cube ( width , dtype = <class 'numpy.uint8'> , * , decomposition = None ) Summary
Generates a cube-shaped footprint.
Extended Summary
This is the 3D equivalent of a square. Every pixel along the perimeter has a chessboard distance no greater than radius (radius=floor(width/2)) pixels.
Parameters
width: intThe width, height and depth of the cube.
Returns
footprint: ndarray or tupleThe footprint where elements of the neighborhood are 1 and 0 otherwise. When
decompositionis None, this is just a numpy.ndarray. Otherwise, this will be a tuple whose length is equal to the number of unique structuring elements to apply (see Notes for more detail)
Other Parameters
dtype: dtype-like, optionalThe data type of the footprint.
decomposition: {None, 'separable', 'sequence'}, optionalIf None, a single array is returned. For 'sequence', a tuple of smaller footprints is returned. Applying this series of smaller footprints will given an identical result to a single, larger footprint, but often with better computational performance. See Notes for more details.
Notes
When decomposition is not None, each element of the footprint tuple is a 2-tuple of the form (ndarray, num_iter) that specifies a footprint array and the number of iterations it is to be applied.
For binary morphology, using decomposition='sequence' was observed to give better performance, with the magnitude of the performance increase rapidly increasing with footprint size. For grayscale morphology with square footprints, it is recommended to use decomposition=None since the internal SciPy functions that are called already have a fast implementation based on separable 1D sliding windows.
The 'sequence' decomposition mode only supports odd valued width. If width is even, the sequence used will be identical to the 'separable' mode.
Aliases
-
skimage.morphology.cube