Mesh for segmentation
Function to load and save .obj files. Function to generate mesh using marching_cubes algorithm. Function to visualize the generated mesh using k3d. Most of the implementation is based on the library Trimesh. It is important to make sure to pad the volume obtained from our generator when parts of it touches the edges, otherwise it would result in an incorrect mesh. I added in create_mesh the parameter padding already set to (2,2,2) to add 2 slices in each direction.