code: def mesh_to_gifti(
      coordinates: np.ndarray,
      faces: np.ndarray,
      gifti_file: Union[pathlib.Path, str],
  ) -> None:
      """Write surface mesh to gifti file on disk."""
      gifti_file = pathlib.Path(gifti_file)
      gifti_img = nib.gifti.GiftiImage()
      coords_array = nib.gifti.GiftiDataArray(
          coordinates,
          intent="NIFTI_INTENT_POINTSET",
          datatype="float32",
      )
      faces_array = nib.gifti.GiftiDataArray(
          faces, intent="NIFTI_INTENT_TRIANGLE", datatype="int32"
      )
      gifti_img.add_gifti_data_array(coords_array)
      gifti_img.add_gifti_data_array(faces_array)
      nib.save(gifti_img, gifti_file)
  
file_path: nilearn/nilearn/experimental/surface/_io.py
imports: import pathlib
  from typing import Dict, Union
  import nibabel
  import numpy
  from nilearn import surface
label_desc: Use image node_id 3 for calling a global function with example usage: mesh_to_gifti(coordinates, faces, gifti_file) without return types