docstr: Apply the smoothing filter to the image
code: def smooth_image(self, image, mask):
      """Apply the smoothing filter to the image"""
  
      filter_size = self.calc_smoothing_filter_size()
      if filter_size == 0:
          return image
      sigma = filter_size / 2.35
      #
      # We not only want to smooth using a Gaussian, but we want to limit
      # the spread of the smoothing to 2 SD, partly to make things happen
      # locally, partly to make things run faster, partly to try to match
      # the Matlab behavior.
      #
      filter_size = max(int(float(filter_size) / 2.0), 1)
      f = (
          1
          / numpy.sqrt(2.0 * numpy.pi)
          / sigma
          * numpy.exp(
              -0.5
              * numpy.arange(-filter_size, filter_size + 1) ** 2
              / sigma**2
          )
      )
  
      def fgaussian(image):
          output = scipy.ndimage.convolve1d(
              image, f, axis=0, mode="constant"
          )
          return scipy.ndimage.convolve1d(
              output, f, axis=1, mode="constant"
          )
  
      #
      # Use the trick where you similarly convolve an array of ones to find
      # out the edge effects, then divide to correct the edge effects
      #
      edge_array = fgaussian(mask.astype(float))
      masked_image = image.copy()
      masked_image[~mask] = 0
      smoothed_image = fgaussian(masked_image)
      masked_image[mask] = smoothed_image[mask] / edge_array[mask]
      return masked_image
  
imports: import math
  import cellprofiler_core.module.image_segmentation
  import cellprofiler_core.object
  import centrosome.cpmorphology
  import centrosome.outline
  import centrosome.propagate
  import centrosome.threshold
  import numpy
  import scipy.ndimage
  import scipy.sparse
  import skimage.morphology
  import skimage.segmentation
  from cellprofiler_core.setting import Binary, Color
  from cellprofiler_core.setting.choice import Choice
  from cellprofiler_core.setting.range import IntegerRange
  from cellprofiler_core.setting.text import Integer, Float
  import cellprofiler.gui.help
  import cellprofiler.gui.help.content
  from cellprofiler.modules import _help, threshold
label_desc: Use image node_id 11 for calling the IdentifyPrimaryObjects obj's underlying member method code with example usage: obj.smooth_image(image, mask) and returns: masked_image, image, scipy