Skip to content

Commit

Permalink
DOC : Add comment for the use of strided output array for generic_fil…
Browse files Browse the repository at this point in the history
…ter in RAG
  • Loading branch information
OrkoHunter committed Jan 25, 2016
1 parent b9c9513 commit 050138b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions skimage/future/graph/rag.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,12 @@ def __init__(self, label_image=None, connectivity=1, data=None, **attr):

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 cost expensive.
ndi.generic_filter(
label_image,
function=_add_edge_filter,
Expand Down

0 comments on commit 050138b

Please sign in to comment.