Function for smoothing surfaces

Hello Brainstorm Users,

I am currently working on developing scouts for multiple events, and I am doing this directly in MATLAB, but everything can be imported into Brainstorm for visualization purposes. I wondered how to smooth the brain cortical surface (and then the scouts) directly from MATLAB without using the slider on the Panel Surface in the GUI. Can you help me understand what function does this smoothing or what kind of pipeline I can use to achieve this purpose?

Best,
Margherita

In Brainstorm the Smooth: slider modifiers only the data in the Figure.

The function that is used to do so is tess_smooth()

Check the function SmoothSurface() in figure_3d.m to see how tess_smooth() is used