BUG - Now parsing all unique labels != 0 properly, and set threshold_rel=0 in is_local_maximum() wrapper.

This commit is contained in:
Josh Warner (Mac)
2012-11-20 01:11:31 -06:00
parent 233b368195
commit da5a2a8221
2 changed files with 5 additions and 3 deletions
+3 -1
View File
@@ -106,8 +106,10 @@ def peak_local_max(image, min_distance=10, threshold_abs=0, threshold_rel=0.1,
labels[mask] = rank_order(labels[mask])[0].astype(labels.dtype)
labels = labels.astype(np.int32)
# New values for new ordering
label_values = np.unique(labels)
out = np.zeros_like(image)
for label in labels:
for label in label_values[label_values != 0]:
maskim = (labels == label)
out += peak_local_max(image * maskim, min_distance=min_distance,
threshold_abs=threshold_abs,
+2 -2
View File
@@ -294,8 +294,8 @@ def is_local_maximum(image, labels=None, footprint=None):
"""
return peak_local_max(image, labels=labels, min_distance=1,
footprint=footprint, indices=False,
exclude_border=False)
threshold_rel=0, footprint=footprint,
indices=False, exclude_border=False)
# ---------------------- deprecated ------------------------------