Runs in 3D.
TODO: relabel res and run get_compactness.