How does create closed surface representation work ?

Hello,
I could not find any answer to this rather simple question online.
I’m trying different methods for extracting meshes from brain segmentations.
I’ve tried several times the Marching Cube algorithm and the results are always ugly. However, the “export closed surface representation” in 3D slicer works very well.
I would like to include this function into a data preprocessing pipeline.
I understand that some smoothing of the segmentation is involved, but I can’t find the code behind this functionality or at least the name of the algorithm.
Any help would be appreciated.
Thanks
Fleur

Actually this has been discussed various times on the forum. Unfortunately the search function is extremely bad. Maybe try a bit more, but here’s a basic answer:

The conversion is part of a multi-representation mechanism, which is described in this paper and thesis:
Manuscript of the paper
Thesis
The actual algorithm changed a bit in the sense that an alternative filter, the relatively new surface nets method has been added. But the default algorithm is the same as what is described in these sources.

You say you couldn’t find the code, so I assume that would help as well:

Thanks a lot !
Do you know if there is a python version of this code ? At least for the default algorithm (flying edges) ?

There is no Python version. But it is extremely simple to port to Python. However, I suggest using the infrastructure of Slicer. It has been an immense task to make everything work correctly, so although it may seem easy, you could find yourself in a difficult situation if you start reimplementing it from scratch.