[SciPy-User] scipy.ndimage.measurements.label

Zachary Pincus zachary.pincus@yale....
Sun Aug 26 08:55:49 CDT 2012


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



More information about the SciPy-User mailing list