To ensure input image has chords already applied to it.
@@ -443,7 +443,8 @@ def chord_counts(im):
function is ``sp.bincount`` which gives the number of chords of each
length in a format suitable for ``plt.plot``.
"""
-
+ if (im.dtype == bool) or (im.max() == 1):
+ raise Exception ('Image does not have chords')
labels, N = spim.label(im > 0)
props = regionprops(labels)
chord_lens = sp.array([i.filled_area for i in props])
