From ee2092c6fa3c916bc3cbf36a4e40d428c300ff25 Mon Sep 17 00:00:00 2001 From: JDWarner Date: Mon, 17 Sep 2012 16:38:59 -0500 Subject: [PATCH] Documentation fix for `labels` input in random_walker. This fix was needed because `labels` claimed it should be "of same shape as `data`", but this is no longer always the case. When multichannel=True, `labels` should be shaped like a SINGLE channel of `data`, i.e. without the final dimension denoting channels. --- skimage/segmentation/random_walker_segmentation.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/skimage/segmentation/random_walker_segmentation.py b/skimage/segmentation/random_walker_segmentation.py index 7597d5b6..22ce17e2 100644 --- a/skimage/segmentation/random_walker_segmentation.py +++ b/skimage/segmentation/random_walker_segmentation.py @@ -190,13 +190,15 @@ def random_walker(data, labels, beta=130, mode='bf', tol=1.e-3, copy=True, channels. Data spacing is assumed isotropic unless depth keyword argument is used. - labels : array of ints, of same shape as `data` + labels : array of ints, of same shape as `data` without channels dimension Array of seed markers labeled with different positive integers for different phases. Zero-labeled pixels are unlabeled pixels. Negative labels correspond to inactive pixels that are not taken into account (they are removed from the graph). If labels are not consecutive integers, the labels array will be transformed so that - labels are consecutive. + labels are consecutive. In the multichannel case, `labels` should have + the same shape as a single channel of `data`, i.e. without the final + dimension denoting channels. beta : float Penalization coefficient for the random walker motion