From 305f5fd2259a5f1196a44ba5e0c10ca713f17aca Mon Sep 17 00:00:00 2001 From: kpk09 Date: Sun, 25 Jan 2015 00:22:11 +0000 Subject: [PATCH] Using numpy.argwhere makes code easier to read --- skimage/feature/peak.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/skimage/feature/peak.py b/skimage/feature/peak.py index 7580efc2..599a6e58 100644 --- a/skimage/feature/peak.py +++ b/skimage/feature/peak.py @@ -146,7 +146,7 @@ def peak_local_max(image, min_distance=10, threshold_abs=0, threshold_rel=0.1, peak_threshold = max(np.max(image.ravel()) * threshold_rel, threshold_abs) # get coordinates of peaks - coordinates = np.transpose((image > peak_threshold).nonzero()) + coordinates = np.argwhere(image > peak_threshold) if coordinates.shape[0] > num_peaks: intensities = image.flat[np.ravel_multi_index(coordinates.transpose(),image.shape)]