code: def get_maxima(
      self, image, labeled_image, maxima_mask, image_resize_factor
  ):
      if image_resize_factor < 1.0:
          shape = numpy.array(image.shape) * image_resize_factor
          i_j = (
              numpy.mgrid[0 : shape[0], 0 : shape[1]].astype(float)
              / image_resize_factor
          )
          resized_image = scipy.ndimage.map_coordinates(image, i_j)
          resized_labels = scipy.ndimage.map_coordinates(
              labeled_image, i_j, order=0
          ).astype(labeled_image.dtype)
  
      else:
          resized_image = image
          resized_labels = labeled_image
      #
      # find local maxima
      #
      if maxima_mask is not None:
          binary_maxima_image = (
              centrosome.cpmorphology.is_local_maximum(
                  resized_image, resized_labels, maxima_mask
              )
          )
          binary_maxima_image[resized_image <= 0] = 0
      else:
          binary_maxima_image = (resized_image > 0) & (
              labeled_image > 0
          )
      if image_resize_factor < 1.0:
          inverse_resize_factor = float(image.shape[0]) / float(
              binary_maxima_image.shape[0]
          )
          i_j = (
              numpy.mgrid[
                  0 : image.shape[0], 0 : image.shape[1]
              ].astype(float)
              / inverse_resize_factor
          )
          binary_maxima_image = (
              scipy.ndimage.map_coordinates(
                  binary_maxima_image.astype(float), i_j
              )
              > 0.5
          )
          assert binary_maxima_image.shape[0] == image.shape[0]
          assert binary_maxima_image.shape[1] == image.shape[1]
  
      # Erode blobs of touching maxima to a single point
  
      shrunk_image = centrosome.cpmorphology.binary_shrink(
          binary_maxima_image
      )
      return shrunk_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 13 for calling the IdentifyPrimaryObjects obj's underlying member method code with example usage: obj.get_maxima(image, labeled_image, maxima_mask, image_resize_factor) and returns: shrunk_image