docstr: Return an image that is dilated according to the settings
  
  image - an instance of cpimage.Image
  
  returns another instance of cpimage.Image
docstr_tok: ["Return","an","image","that","is","dilated","according","to","the","settings","image","-","an","instance","of","cpimage.Image","returns","another","instance","of","cpimage.Image"]
code: def apply_dilation(self, image, orig_image=None):
      """Return an image that is dilated according to the settings
  
      image - an instance of cpimage.Image
  
      returns another instance of cpimage.Image
      """
      if self.dilate_objects.value:
          #
          # This filter is designed to spread the boundaries of cells
          # and this "dilates" the cells
          #
          kernel = centrosome.smooth.circular_gaussian_kernel(
              self.object_dilation_radius.value,
              self.object_dilation_radius.value * 3,
          )
  
          def fn(image):
              return scipy.ndimage.convolve(
                  image, kernel, mode="constant", cval=0
              )
  
          if image.pixel_data.ndim == 2:
              dilated_pixels = (
                  centrosome.smooth.smooth_with_function_and_mask(
                      image.pixel_data, fn, image.mask
                  )
              )
          else:
              dilated_pixels = numpy.dstack(
                  [
                      centrosome.smooth.smooth_with_function_and_mask(
                          x, fn, image.mask
                      )
                      for x in image.pixel_data.transpose(2, 0, 1)
                  ]
              )
          return Image(dilated_pixels, parent_image=orig_image)
      else:
          return image
  
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 10 for calling the CorrectIlluminationCalculate obj's underlying member method code with example usage: obj.apply_dilation(image, orig_image) and returns: Image, image, scipy