components


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.

Licensing:

The information on this web page is distributed under the MIT license.

Languages:

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.

Related Data and Programs:

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.

Reference:

Source Code:


Last revised on 17 July 2022.