docstr: Perform a scipy.ndimage-style measurement on a label matrix
  
  workspace   - the workspace for the run
  function    - a function with the following sort of signature:
                image - an image to be fed into the function which for
                        our case is all ones
                labels - the label matrix from the objects
                index  - a sequence of label indexes to pay attention to
  object_name - name of object to retrieve from workspace and deposit
                in measurements
  feature_name- name of feature to deposit in measurements
docstr_tok: ["Perform","a","scipy.ndimage-style","measurement","on","a","label","matrix","workspace","-","the","workspace","for","the","run","function","-","a","function","with","the","following","sort","of","signature",":","image","-","an","image","to","be","fed","into","the","function","which","for","our","case","is","all","ones","labels","-","the","label","matrix","from","the","objects","index","-","a","sequence","of","label","indexes","to","pay","attention","to","object_name","-","name","of","object","to","retrieve","from","workspace","and","deposit","in","measurements","feature_name-","name","of","feature","to","deposit","in","measurements"]
code: def perform_ndmeasurement(
      self, workspace, function, object_name, feature_name
  ):
      """Perform a scipy.ndimage-style measurement on a label matrix
  
      workspace   - the workspace for the run
      function    - a function with the following sort of signature:
                    image - an image to be fed into the function which for
                            our case is all ones
                    labels - the label matrix from the objects
                    index  - a sequence of label indexes to pay attention to
      object_name - name of object to retrieve from workspace and deposit
                    in measurements
      feature_name- name of feature to deposit in measurements
      """
      objects = workspace.get_objects(object_name)
      if len(objects.indices) > 0:
          data = objects.fn_of_ones_label_and_index(function)
      else:
          data = numpy.zeros((0,))
      self.record_measurement(
          workspace, object_name, feature_name, data
      )
  
imports: import centrosome.cpmorphology
  import centrosome.zernike
  import numpy
  import scipy.ndimage
  import skimage.measure
  from cellprofiler_core.constants.measurement import COLTYPE_FLOAT
  from cellprofiler_core.module import Module
  from cellprofiler_core.object import Objects
  from cellprofiler_core.setting import Divider, Binary, ValidationError
  from cellprofiler_core.setting.subscriber import LabelListSubscriber
  import cellprofiler.gui.help.content
  import cellprofiler.icons
label_desc: Use image node_id 15 for calling the MeasureObjectSizeShape obj's underlying member method code with example usage: obj.perform_ndmeasurement(workspace, function, object_name, feature_name) without return types