List of my modules...
Module: Cubical Complex Collapse
Description:
Collapses a cubical complex. A cubical complexe is a type of abstract simplicial complex, and is also called cellular complex [Kovalevsky, 1989]. For more details, load this.
For details on cubical complexes, load this.
Illustration of the collapse. On the left is the original cubical complex, and the others are the result with the original complex in transparent, according to the type: respectively, from left to right, Directional, Surfacic, Curve, and Min Intersect.
Connections:
Image
[required]
The input cubical complex, of type HxUniformScalarField3 and containing byte-sized values.
Ports:
Type

Type of the collapse, controls both the collapsing order and stop condition. For Directional collapse, all free pairs on the front are removed, then on the back, up, down, left, right, then front again, etc. For Surfacic, same order, but stops when only 2-faces remain. For Curve, same order, but stops when only 1-faces remain. For Min Intersect, an already collapsed cubical complex must be connected. It reinserts 3-faces containing the complex, and removes the free pairs that minimise the resulting number of faces, so as to avoid surface pinching artefacts.
Iterations

Number of times the collapse loops through all the types of free pairs. This is only to view the internal mechanism of the collapse.
Illustration of the iterative process of the collapse. On the left is the original cubical complex, and each iteration of the directional collapse is shown from left to right. Already at the second iteration no 3-face remain, and at the fourth iteration, the complex is reduced to a 0-face.
Options

Does not collapse border faces.
Action button

Push the button to start the computation.
Commands:
Additional options can be accessed when typing in the console Cubical_Complex_Collapse COMMAND_NAME. Typing the command again usually reverts back to original settings.
verbose
Displays timing information after the computation. Retype to hide info.
create
Runs the computation. Returns the name of the output, so it can be used in a script, such as set RESULT [Cubical_Complex_Collapse create].
Reference:
V.A. Kovalevsky. Finite topology as applied to image analysis. Computer Vision, Graphics and Image Processing, 46(2):141–161, 1989.