code: def octahedron(radius, dtype=np.uint8, *, decomposition=None):
      """Generates a octahedron-shaped footprint.
  
      This is the 3D equivalent of a diamond.
      A pixel is part of the neighborhood (i.e. labeled 1) if
      the city block/Manhattan distance between it and the center of
      the neighborhood is no greater than radius.
  
      Parameters
      ----------
      radius : int
          The radius of the octahedron-shaped footprint.
  
      Other Parameters
      ----------------
      dtype : data-type, optional
          The data type of the footprint.
      decomposition : {None, 'sequence'}, optional
          If 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 with
          better computational performance. See Notes for more details.
  
      Returns
      -------
      footprint : ndarray or tuple
          The footprint where elements of the neighborhood are 1 and 0 otherwise.
          When `decomposition` is 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)
  
      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 either binary or grayscale morphology, using
      ``decomposition='sequence'`` was observed to have a performance benefit,
      with the magnitude of the benefit increasing with increasing footprint
      size.
      """
      # note that in contrast to diamond(), this method allows non-integer radii
      if decomposition is None:
          n = 2 * radius + 1
          Z, Y, X = np.mgrid[
              -radius : radius : n * 1j,
              -radius : radius : n * 1j,
              -radius : radius : n * 1j,
          ]
          s = np.abs(X) + np.abs(Y) + np.abs(Z)
          footprint = np.array(s <= radius, dtype=dtype)
      elif decomposition == "sequence":
          fp = octahedron(1, dtype=dtype, decomposition=None)
          nreps = _decompose_size(2 * radius + 1, fp.shape[0])
          footprint = ((fp, nreps),)
      else:
          raise ValueError(
              f"Unrecognized decomposition: {decomposition}"
          )
      return footprint
  
imports: import os
  from collections.abc import Sequence
  from numbers import Integral
  import numpy
  from ..None import draw
  from skimage import morphology
label_desc: Use image node_id 15 for calling a global function with example usage: octahedron(radius, dtype) and returns: footprint