decimate_surface(points, triangles, n_triangles, method='quadric', verbose=None)¶
Decimate surface data.
The surface to be decimated, a 3 x number of points array.
The surface to be decimated, a 3 x number of triangles array.
The desired number of triangles.
Can be “quadric” or “sphere”. “sphere” will inflate the surface to a sphere using Freesurfer and downsample to an icosahedral or octahedral mesh.
New in version 0.20.
This requires VTK. If an odd target number was requested, the
'decimation'algorithm used results in the next even number of triangles. For example a reduction request to 30001 triangles may result in 30000 triangles.
This requires Freesurfer to be installed and available in the environment. The destination number of triangles must be one of
[20, 80, 320, 1280, 5120, 20480]for ico (0-5) downsampling or one of
[8, 32, 128, 512, 2048, 8192, 32768]for oct (1-7) downsampling.
This mode is slower, but could be more suitable for decimating meshes for BEM creation (recommended
n_triangles=5120) due to better topological property preservation.