Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def get_measurement_columns(self, pipeline):
'''Column definitions for measurements made by IdentifyPrimAutomatic'''
columns = cpmi.get_object_measurement_columns(self.object_name.value)
columns += [(cpmeas.IMAGE,
format%self.object_name.value,
cpmeas.COLTYPE_FLOAT)
for format in (FF_FINAL_THRESHOLD, FF_ORIG_THRESHOLD,
FF_WEIGHTED_VARIANCE, FF_SUM_OF_ENTROPIES)]
return columns
if isinstance(local_threshold,np.ndarray):
ave_threshold = np.mean(local_threshold)
else:
ave_threshold = local_threshold
measurements.add_measurement(cpmeas.IMAGE,
cpmi.FF_FINAL_THRESHOLD%(objname),
np.array([ave_threshold],
dtype=float))
measurements.add_measurement(cpmeas.IMAGE,
cpmi.FF_ORIG_THRESHOLD%(objname),
np.array([global_threshold],
dtype=float))
wv = cpthresh.weighted_variance(img, mask, local_threshold)
measurements.add_measurement(cpmeas.IMAGE,
cpmi.FF_WEIGHTED_VARIANCE%(objname),
np.array([wv],dtype=float))
entropies = cpthresh.sum_of_entropies(img, mask, local_threshold)
measurements.add_measurement(cpmeas.IMAGE,
cpmi.FF_SUM_OF_ENTROPIES%(objname),
np.array([entropies],dtype=float))
cpmi.add_object_count_measurements(measurements, objname, object_count)
cpmi.add_object_location_measurements(measurements, objname,
segmented_out)
#
# Relate the secondary objects to the primary ones and record
# the relationship.
#
children_per_parent, parents_of_children = \
objects.relate_children(objects_out)
measurements.add_measurement(self.primary_objects.value,
cpmi.FF_CHILDREN_COUNT%objname,