From 7a074d5dd165536cb05fd87ea94a29510edac1a7 Mon Sep 17 00:00:00 2001 From: Charles Harris Date: Fri, 4 Jul 2014 20:04:32 -0600 Subject: [PATCH] BUG: Fix slicing error revealed by numpy 1.9.0. Numpy 1.9.0 no longer allows oversize data to be assigned to a boolean indexed 1-d array by discarding excess elements. Closes #1050. --- skimage/segmentation/_join.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/skimage/segmentation/_join.py b/skimage/segmentation/_join.py index 7b6d2a3e..5cceeb5b 100644 --- a/skimage/segmentation/_join.py +++ b/skimage/segmentation/_join.py @@ -124,7 +124,7 @@ def relabel_sequential(label_field, offset=1): if m == len(labels0): # nothing to do, already 1...n labels return label_field, labels, labels forward_map = np.zeros(m + 1, int) - forward_map[labels0] = np.arange(offset, offset + len(labels0) + 1) + forward_map[labels0] = np.arange(offset, offset + len(labels0)) if not (labels == 0).any(): labels = np.concatenate(([0], labels)) inverse_map = np.zeros(offset - 1 + len(labels), dtype=np.intp)