code: def apply_threshold(image, threshold, mask=None, smoothing=0):
      if mask is None:
          # Create a fake mask if one isn't provided
          mask = numpy.full(image.shape, True)
      if smoothing == 0:
          return (image >= threshold) & mask, 0
      else:
          # Convert from a scale into a sigma. What I've done here
          # is to structure the Gaussian so that 1/2 of the smoothed
          # intensity is contributed from within the smoothing diameter
          # and 1/2 is contributed from outside.
          sigma = smoothing / 0.6744 / 2.0
  
      blurred_image = centrosome.smooth.smooth_with_function_and_mask(
          image,
          lambda x: scipy.ndimage.gaussian_filter(
              x, sigma, mode="constant", cval=0
          ),
          mask,
      )
      return (blurred_image >= threshold) & mask, sigma
  
imports: import numpy
  import skimage.color
  import skimage.morphology
  import centrosome
  import centrosome.threshold
  import scipy
  import matplotlib
label_desc: Use image node_id 16 for calling a global function with example usage: apply_threshold(image, threshold, mask, smoothing) and returns: unknown,  sigma, unknown,  int