code: def test_decimate_surface_vtk(n_tri):
      """Test triangular surface decimation."""
      pytest.importorskip("pyvista")
      points = np.array(
          [
              [-0.00686118, -0.10369860, 0.02615170],
              [-0.00713948, -0.10370162, 0.02614874],
              [-0.00686208, -0.10368247, 0.02588313],
              [-0.00713987, -0.10368724, 0.02587745],
          ]
      )
      tris = np.array([[0, 1, 2], [1, 2, 3], [0, 3, 1], [1, 2, 0]])
      _, this_tris = decimate_surface(points, tris, n_tri)
      want = (n_tri, n_tri - 1)
      if n_tri == 3:
          want = want + (1,)
      assert len(this_tris) in want
      with pytest.raises(
          ValueError, match="exceeds number of original"
      ):
          decimate_surface(points, tris, len(tris) + 1)
      nirvana = 5
      tris = np.array(
          [[0, 1, 2], [1, 2, 3], [0, 3, 1], [1, 2, nirvana]]
      )
      with pytest.raises(ValueError, match="undefined points"):
          decimate_surface(points, tris, n_tri)
  
imports: from pathlib import Path
  import numpy
  import pytest
  from numpy.testing import assert_allclose, assert_array_equal, assert_equal
  from mne import decimate_surface, dig_mri_distances, get_montage_volume_labels, pick_types, read_surface, write_surface
  from mne._fiff.constants import FIFF
  from mne.channels import make_dig_montage
  from mne.datasets import testing
  from mne.io import read_info
  from mne.surface import _compute_nearest, _get_ico_surface, _marching_cubes, _normal_orth, _project_onto_surface, _read_patch, _tessellate_sphere, _voxel_neighbors, fast_cross_3d, get_head_surf, get_meg_helmet_surf, read_curvature
  from mne.transforms import _get_trans
  from mne.utils import _record_warnings, catch_logging, object_diff, requires_freesurfer
label_desc: Use image node_id 7 for calling a global function with example usage: test_decimate_surface_vtk(n_tri) without return types