Search code examples
pythonscikit-imagemarching-cubes

Clarifying Scikit Image Marching Cubes algorithm "spacing" parameter?


I have a 64x64x64 occupancy grid (0 is the level) on which I'm trying to run marching cubes to generate a mesh. In trying to debug some issues with the generated mesh, I wanted to clarify what the "spacing" parameter means. The documentation here says "Voxel spacing in spatial dimensions corresponding to numpy array indexing dimensions (M, N, P) as in volume.", but I don't quite get what that means. Any clarification would be appreciated, thank you!


Solution

  • In many 3D imaging technologies, the resolution of one axis is lower than that of the other axes. For example, in optical microscopy, one moves the plane of focus by a certain amount before taking another (2D) picture. The resolution on the axis of focus is the distance between focus planes, while the resolution on the other two axes is the (typically much better) resolution of the imaging camera. A typical example might be 10µm for the focus axis, and 500nm (0.5µm) for the acquisition axes. When passing such an image to marching cubes, you might use the argument spacing=(10, 0.5, 0.5).