<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def chord_counts(im):
 r""" Finds the length of each chord in the supplied image and returns a list of their individual sizes Parameters im : ND-array An image containing chords drawn in the void space. Returns ------- result : 1D-array A 1D array with one element for each chord, containing its length. Notes ---- The returned array can be passed to ``plt.hist`` to plot the histogram, or to ``sp.histogram`` to get the histogram data directly. Another useful function is ``sp.bincount`` which gives the number of chords of each length in a format suitable for ``plt.plot``. """

    labels, N = spim.label(im > 0)
    props = regionprops(labels, coordinates='xy')
    chord_lens = sp.array([i.filled_area for i in props])
    return chord_lens