### Adding text labels to cells in an image# One way (of many) for getting the coordinates of labeled cellsfromscipy.ndimage.measurementsimportcenter_of_mass# Prepare the imageplt.figure(figsize=(10,10))plt.imshow(array_of_labeled_objects,interpolation='none',cmap='inferno')# Iterate over cell labels...forlabelinnp.unique(array_of_labeled_objects)[1:]:# Get coordinates of the cellcoords=center_of_mass(array_of_labeled_objects==label)# Add the cell ID to the imageplt.text(int(coords[1])-15,int(coords[0])+5,label,color='w')# Doneplt.show()