From b9199fe765cb5edf7b1a772f2861f6ba0793d855 Mon Sep 17 00:00:00 2001 From: Himanshu Mishra Date: Sun, 24 Jan 2016 21:34:59 +0530 Subject: [PATCH] DOC : Add comment for the use of strided output array for generic_filter in RAG --- skimage/future/graph/rag.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/skimage/future/graph/rag.py b/skimage/future/graph/rag.py index dae5bbd1..96f00b6f 100644 --- a/skimage/future/graph/rag.py +++ b/skimage/future/graph/rag.py @@ -143,6 +143,13 @@ class RAG(nx.Graph): if label_image is not None: fp = ndi.generate_binary_structure(label_image.ndim, connectivity) + # In the next ``ndi.generic_filter`` function, the kwarg + # ``output`` is used to provide a strided array with a single + # 64-bit floating point number, to which the function repeatedly + # writes. This is done because even if we don't care about the + # output, without this, a float array of the same shape as the + # input image will be created and that could be expensive in + # memory consumption. ndi.generic_filter( label_image, function=_add_edge_filter,