docstr: Smooth one 2-d color plane of an image
docstr_tok: ["Smooth","one","2-d","color","plane","of","an","image"]
code: def smooth_plane(self, pixel_data, mask):
      """Smooth one 2-d color plane of an image"""
  
      sigma = self.smoothing_filter_size(pixel_data.shape) / 2.35
      if self.smoothing_method == SM_FIT_POLYNOMIAL:
          output_pixels = centrosome.smooth.fit_polynomial(
              pixel_data, mask
          )
      elif self.smoothing_method == SM_GAUSSIAN_FILTER:
          #
          # Smoothing with the mask is good, even if there's no mask
          # because the mechanism undoes the edge effects that are introduced
          # by any choice of how to deal with border effects.
          #
          def fn(image):
              return scipy.ndimage.gaussian_filter(
                  image, sigma, mode="constant", cval=0
              )
  
          output_pixels = (
              centrosome.smooth.smooth_with_function_and_mask(
                  pixel_data, fn, mask
              )
          )
      elif self.smoothing_method == SM_MEDIAN_FILTER:
          filter_sigma = max(1, int(sigma + 0.5))
          strel = centrosome.cpmorphology.strel_disk(filter_sigma)
          rescaled_pixel_data = pixel_data * 65535
          rescaled_pixel_data = rescaled_pixel_data.astype(numpy.uint16)
          rescaled_pixel_data *= mask
          output_pixels = skimage.filters.median(
              rescaled_pixel_data, strel, behavior="rank"
          )
      elif self.smoothing_method == SM_TO_AVERAGE:
          mean = numpy.mean(pixel_data[mask])
          output_pixels = (
              numpy.ones(pixel_data.shape, pixel_data.dtype) * mean
          )
      elif self.smoothing_method == SM_SPLINES:
          output_pixels = self.smooth_with_splines(pixel_data, mask)
      elif self.smoothing_method == SM_CONVEX_HULL:
          output_pixels = self.smooth_with_convex_hull(pixel_data, mask)
      else:
          raise ValueError(
              "Unimplemented smoothing method: %s:"
              % self.smoothing_method.value
          )
      return output_pixels
  
imports: import centrosome.bg_compensate
  import centrosome.cpmorphology
  import centrosome.cpmorphology
  import centrosome.filter
  import centrosome.smooth
  import numpy
  import scipy.ndimage
  import skimage.filters
  from cellprofiler_core.image import AbstractImage
  from cellprofiler_core.image import Image
  from cellprofiler_core.measurement import Measurements
  from cellprofiler_core.module import Module
  from cellprofiler_core.pipeline import Pipeline
  from cellprofiler_core.setting import Binary
  from cellprofiler_core.setting import ValidationError
  from cellprofiler_core.setting.choice import Choice
  from cellprofiler_core.setting.subscriber import ImageSubscriber
  from cellprofiler_core.setting.text import Float
  from cellprofiler_core.setting.text import ImageName
  from cellprofiler_core.setting.text import Integer
label_desc: Use image node_id 14 for calling the CorrectIlluminationCalculate obj's underlying member method code with example usage: obj.smooth_plane(pixel_data, mask) and returns: output_pixels, scipy