docstr: Get points by skeletonizing the objects and decimating
docstr_tok: ["Get","points","by","skeletonizing","the","objects","and","decimating"]
code: def get_skeleton_points(self, obj):
      """Get points by skeletonizing the objects and decimating"""
      ii = []
      jj = []
      total_skel = numpy.zeros(obj.shape, bool)
      for labels, indexes in obj.get_labels():
          colors = centrosome.cpmorphology.color_labels(labels)
          for color in range(1, numpy.max(colors) + 1):
              labels_mask = colors == color
              skel = centrosome.cpmorphology.skeletonize(
                  labels_mask,
                  ordering=scipy.ndimage.distance_transform_edt(
                      labels_mask
                  )
                  * centrosome.filter.poisson_equation(labels_mask),
              )
              total_skel = total_skel | skel
      n_pts = numpy.sum(total_skel)
      if n_pts == 0:
          return numpy.zeros(0, numpy.int32), numpy.zeros(
              0, numpy.int32
          )
      i, j = numpy.where(total_skel)
      if n_pts > self.max_points.value:
          #
          # Decimate the skeleton by finding the branchpoints in the
          # skeleton and propagating from those.
          #
          markers = numpy.zeros(total_skel.shape, numpy.int32)
          branchpoints = centrosome.cpmorphology.branchpoints(
              total_skel
          ) | centrosome.cpmorphology.endpoints(total_skel)
          markers[branchpoints] = (
              numpy.arange(numpy.sum(branchpoints)) + 1
          )
          #
          # We compute the propagation distance to that point, then impose
          # a slightly arbitarary order to get an unambiguous ordering
          # which should number the pixels in a skeleton branch monotonically
          #
          ts_labels, distances = centrosome.propagate.propagate(
              numpy.zeros(markers.shape), markers, total_skel, 1
          )
          order = numpy.lexsort(
              (j, i, distances[i, j], ts_labels[i, j])
          )
          #
          # Get a linear space of self.max_points elements with bounds at
          # 0 and len(order)-1 and use that to select the points.
          #
          order = order[
              numpy.linspace(
                  0, len(order) - 1, self.max_points.value
              ).astype(int)
          ]
          return i[order], j[order]
      return i, j
  
imports: from functools import reduce
  import centrosome.cpmorphology
  import centrosome.fastemd
  import centrosome.filter
  import centrosome.index
  import centrosome.propagate
  import numpy
  import scipy.ndimage
  import scipy.sparse
  from cellprofiler_core.constants.measurement import COLTYPE_FLOAT
  from cellprofiler_core.module import Module
  from cellprofiler_core.setting import Binary
  from cellprofiler_core.setting.choice import Choice
  from cellprofiler_core.setting.subscriber import LabelSubscriber
  from cellprofiler_core.setting.text import Integer
  from cellprofiler.modules import _help
label_desc: Use image node_id 8 for calling the MeasureObjectOverlap obj's underlying member method code with example usage: obj.get_skeleton_points(obj) and returns: i,  j, numpy,  numpy, i,  j