I have a thin structure represented as a voxelated image. I was using marching cubes from scikit-image but I noticed that it does not handle thin structures well.
Example of the same structure shifted by half a voxel:
import numpy as np
from skimage.measure import marching_cubes
arr1 = np.zeros((4,4,4))
arr2 = np.zeros((4,4,4))
# Perfect match of structure and voxel layout
arr1[:,1,:] = 0.5
# Mismatch of structure and voxel layout
arr2[:,1:3,:] = 0.25
# Finds the surface
v1, s2, n1, val1 = marching_cubes(arr1, level=0.4)
# Does not find the surface
v2, s2, n2, val2 = marching_cubes(arr2, level=0.4)
So the reason for the second one failing is that there are no values which are above level
. However, knowing that my structure is a binary structure (no in-between values exist) I am wondering, if there is an option to compensate for these interpolation artifacts by
- Using a different marching cubes algorithm?
- Using a resolution increase?