code: def test_vol_to_surf(kind, n_scans, use_mask):
      img, mask_img = data_gen.generate_mni_space_img(n_scans)
      if not use_mask:
          mask_img = None
      if n_scans == 1:
          img = image.new_img_like(img, image.get_data(img).squeeze())
      fsaverage = datasets.fetch_surf_fsaverage()
      mesh = surface.load_surf_mesh(fsaverage["pial_left"])
      inner_mesh = surface.load_surf_mesh(fsaverage["white_left"])
      center_mesh = np.mean([mesh[0], inner_mesh[0]], axis=0), mesh[1]
      proj = surface.vol_to_surf(
          img,
          mesh,
          kind="depth",
          inner_mesh=inner_mesh,
          mask_img=mask_img,
      )
      other_proj = surface.vol_to_surf(
          img, center_mesh, kind=kind, mask_img=mask_img
      )
      correlation = pearsonr(proj.ravel(), other_proj.ravel())[0]
      assert correlation > 0.99
      with pytest.raises(ValueError, match=".*interpolation.*"):
          surface.vol_to_surf(img, mesh, interpolation="bad")
  
imports: import os
  import tempfile
  import warnings
  import nibabel
  import numpy
  import pytest
  from nibabel import gifti
  from numpy.testing import assert_array_almost_equal, assert_array_equal
  from scipy.spatial import Delaunay
  from scipy.stats import pearsonr
  from nilearn import datasets, image
  from nilearn._utils import data_gen
  from nilearn.image import resampling
  from nilearn.surface import Mesh, Surface, load_surf_data, load_surf_mesh, surface
  from nilearn.surface.surface import _gifti_img_to_mesh, _load_surf_files_gifti_gzip
  from nilearn.surface.tests._testing import flat_mesh, generate_surf, z_const_img
label_desc: Use image node_id 25 for calling a global function with example usage: test_vol_to_surf(kind, n_scans, use_mask) without return types