components, a Python code which organizes contiguous cells of nonzero values into labeled components, for a 1D, 2D, or 3D array. This code has uses in image analysis and percolation simulation.
The information on this web page is distributed under the MIT license.
components is available in a C version and a C++ version and a Fortran77 version and a Fortran90 version and a MATLAB version and an Octave version and a Python version.
bwlabel_test, a Python code which calls scipy.ndimage.label(), which is given a matrix, and organizes the nonzero values into labeled components, using 4-way or 8-way connectivity.
percolation_simulation, a Python code which simulates a percolation system. A rectangular region is decomposed into a grid of MxN squares. Each square may be porous or solid. We are interested in a path of porous squares connecting the top and bottom, or the left and right boundaries. The original code was written by Ian Cooper.