parameters: (
          binary_array: np.ndarray,
          method: str = 'auto',
          **kwargs
          )
docstring: Smooths the 0.5 level-set of a binary array. Returns a floating-point
      array with a smoothed version of the original level-set in the 0 isovalue.
  
      This function can apply two different methods:
  
      - A constrained smoothing method which preserves details and fine
        structures, but it is slow and requires a large amount of memory. This
        method is recommended when the input array is small (smaller than
        (500, 500, 500)).
      - A Gaussian filter applied over the binary array. This method is fast, but
        not very precise, as it can destroy fine details. It is only recommended
        when the input array is large and the 0.5 level-set does not contain
        thin structures.
  
      Parameters
      ----------
      binary_array : ndarray
          Input binary array with the 0.5 level-set to smooth.
      method : str, one of ['auto', 'gaussian', 'constrained']
          Smoothing method. If 'auto' is given, the method will be automatically
          chosen based on the size of `binary_array`.
  
      Parameters for 'gaussian'
      -------------------------
      sigma : float
          Size of the Gaussian filter (default 3).
  
      Parameters for 'constrained'
      ----------------------------
      max_iters : positive integer
          Number of iterations of the constrained optimization method
          (default 500).
      rel_tol: float
          Relative tolerance as a stopping criterion (default 1e-6).
  
      Output
      ------
      res : ndarray
          Floating-point array with a smoothed 0 level-set.
docstring_summary: Smooths the 0.5 level-set of a binary array. Returns a floating-point
      array with a smoothed version of the original level-set in the 0 isovalue.
docstring_tokens: Smooths the 0 . 5 level - set of a binary array . Returns a floating - point array with a smoothed version of the original level - set in the 0 isovalue .
function: def smooth(
          binary_array: np.ndarray,
          method: str = 'auto',
          **kwargs
          ) -> np.ndarray:
      """
      Smooths the 0.5 level-set of a binary array. Returns a floating-point
      array with a smoothed version of the original level-set in the 0 isovalue.
  
      This function can apply two different methods:
  
      - A constrained smoothing method which preserves details and fine
        structures, but it is slow and requires a large amount of memory. This
        method is recommended when the input array is small (smaller than
        (500, 500, 500)).
      - A Gaussian filter applied over the binary array. This method is fast, but
        not very precise, as it can destroy fine details. It is only recommended
        when the input array is large and the 0.5 level-set does not contain
        thin structures.
  
      Parameters
      ----------
      binary_array : ndarray
          Input binary array with the 0.5 level-set to smooth.
      method : str, one of ['auto', 'gaussian', 'constrained']
          Smoothing method. If 'auto' is given, the method will be automatically
          chosen based on the size of `binary_array`.
  
      Parameters for 'gaussian'
      -------------------------
      sigma : float
          Size of the Gaussian filter (default 3).
  
      Parameters for 'constrained'
      ----------------------------
      max_iters : positive integer
          Number of iterations of the constrained optimization method
          (default 500).
      rel_tol: float
          Relative tolerance as a stopping criterion (default 1e-6).
  
      Output
      ------
      res : ndarray
          Floating-point array with a smoothed 0 level-set.
      """
  
      binary_array = np.asarray(binary_array)
  
      if method == 'auto':
          if binary_array.size > 500**3:
              method = 'gaussian'
          else:
              method = 'constrained'
  
      if method == 'gaussian':
          return smooth_gaussian(binary_array, **kwargs)
  
      if method == 'constrained':
          return smooth_constrained(binary_array, **kwargs)
  
      raise ValueError("Unknown method '{}'".format(method))
function_tokens: def smooth ( binary_array : np . ndarray , method : str = 'auto' , * * kwargs ) -> np . ndarray : binary_array = np . asarray ( binary_array ) if method == 'auto' : if binary_array . size > 500 ** 3 : method = 'gaussian' else : method = 'constrained' if method == 'gaussian' : return smooth_gaussian ( binary_array , * * kwargs ) if method == 'constrained' : return smooth_constrained ( binary_array , * * kwargs ) raise ValueError ( "Unknown method '{}'" . format ( method ) )