scipy.ndimage.measurements.label
Hi all, Can someone please tell me what algorithm scipy.ndimage.measurements.label implements? Many thanks, Sarah -- Sarah Mount, Senior Lecturer, University of Wolverhampton website: http://www.snim2.org/ twitter: @snim2
Is your question what the function does, or how it does it? The docstring is I think pretty clear on the former, but you can ask back if you have any specific questions. As to how that result is generated, the most authoritative answer is to peruse the source code to NI_Label() in https://github.com/scipy/scipy/blob/master/scipy/ndimage/src/ni_measure.c Based on a quick look, this appears to be the standard two-pass binary connected-component labeling algorithm ( http://en.wikipedia.org/wiki/Connected-component_labeling ), generalized to ND, and with the nice feature that the connectivity can be defined by an arbitrary structuring element. Zach On Aug 23, 2012, at 2:29 PM, Sarah Mount wrote:
Hi all,
Can someone please tell me what algorithm scipy.ndimage.measurements.label implements?
Many thanks,
Sarah
-- Sarah Mount, Senior Lecturer, University of Wolverhampton website: http://www.snim2.org/ twitter: @snim2 _______________________________________________ SciPy-User mailing list SciPy-User@scipy.org http://mail.scipy.org/mailman/listinfo/scipy-user
On Sun, Aug 26, 2012 at 2:55 PM, Zachary Pincus <zachary.pincus@yale.edu> wrote:
Is your question what the function does, or how it does it?
How it does it...
The docstring is I think pretty clear on the former, but you can ask back if you have any specific questions.
As to how that result is generated, the most authoritative answer is to peruse the source code to NI_Label() in https://github.com/scipy/scipy/blob/master/scipy/ndimage/src/ni_measure.c
Based on a quick look, this appears to be the standard two-pass binary connected-component labeling algorithm ( http://en.wikipedia.org/wiki/Connected-component_labeling ), generalized to ND, and with the nice feature that the connectivity can be defined by an arbitrary structuring element.
Brilliant. I was ideally looking for a paper which describes the algorithm and I think there's a couple of good links from the Wikipedia page you mention above. Thanks for your help, that was massively useful! Sarah
On Aug 23, 2012, at 2:29 PM, Sarah Mount wrote:
Hi all,
Can someone please tell me what algorithm scipy.ndimage.measurements.label implements?
Many thanks,
Sarah
-- Sarah Mount, Senior Lecturer, University of Wolverhampton website: http://www.snim2.org/ twitter: @snim2 _______________________________________________ SciPy-User mailing list SciPy-User@scipy.org http://mail.scipy.org/mailman/listinfo/scipy-user
_______________________________________________ SciPy-User mailing list SciPy-User@scipy.org http://mail.scipy.org/mailman/listinfo/scipy-user
-- Sarah Mount, Senior Lecturer, University of Wolverhampton website: http://www.snim2.org/ twitter: @snim2
participants (2)
-
Sarah Mount -
Zachary Pincus