docstr: Filter the labeled image based on the size range
  
  labeled_image - pixel image labels
  object_count - # of objects in the labeled image
  returns the labeled image, and the labeled image with the
  small objects removed
code: def filter_on_size(self, labeled_image, object_count):
      """Filter the labeled image based on the size range
  
      labeled_image - pixel image labels
      object_count - # of objects in the labeled image
      returns the labeled image, and the labeled image with the
      small objects removed
      """
      if self.exclude_size.value and object_count > 0:
          areas = scipy.ndimage.measurements.sum(
              numpy.ones(labeled_image.shape),
              labeled_image,
              numpy.array(
                  list(range(0, object_count + 1)), dtype=numpy.int32
              ),
          )
          areas = numpy.array(areas, dtype=int)
          min_allowed_area = (
              numpy.pi * (self.size_range.min * self.size_range.min) / 4
          )
          max_allowed_area = (
              numpy.pi * (self.size_range.max * self.size_range.max) / 4
          )
          # area_image has the area of the object at every pixel within the object
          area_image = areas[labeled_image]
          labeled_image[area_image < min_allowed_area] = 0
          small_removed_labels = labeled_image.copy()
          labeled_image[area_image > max_allowed_area] = 0
      else:
          small_removed_labels = labeled_image.copy()
      return labeled_image, small_removed_labels
  
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 14 for calling the IdentifyPrimaryObjects obj's underlying member method code with example usage: obj.filter_on_size(labeled_image, object_count) and returns: labeled_image,  small_removed_labels