code: def vertex_to_mni(
      vertices, hemis, subject, subjects_dir=None, verbose=None
  ):
      """Convert the array of vertices for a hemisphere to MNI coordinates.
  
      Parameters
      ----------
      vertices : int, or list of int
          Vertex number(s) to convert.
      hemis : int, or list of int
          Hemisphere(s) the vertices belong to.
      %(subject)s
      subjects_dir : str, or None
          Path to ``SUBJECTS_DIR`` if it is not set in the environment.
      %(verbose)s
  
      Returns
      -------
      coordinates : array, shape (n_vertices, 3)
          The MNI coordinates (in mm) of the vertices.
      """
      singleton = False
      if not isinstance(vertices, list) and not isinstance(
          vertices, np.ndarray
      ):
          singleton = True
          vertices = [vertices]
  
      if not isinstance(hemis, list) and not isinstance(
          hemis, np.ndarray
      ):
          hemis = [hemis] * len(vertices)
  
      if not len(hemis) == len(vertices):
          raise ValueError("hemi and vertices must match in length")
  
      subjects_dir = get_subjects_dir(subjects_dir, raise_error=True)
  
      surfs = [
          subjects_dir / subject / "surf" / f"{h}.white"
          for h in ["lh", "rh"]
      ]
  
      # read surface locations in MRI space
      rr = [read_surface(s)[0] for s in surfs]
  
      # take point locations in MRI space and convert to MNI coordinates
      xfm = read_talxfm(subject, subjects_dir)
      xfm["trans"][:3, 3] *= 1000.0  # m->mm
      data = np.array([rr[h][v, :] for h, v in zip(hemis, vertices)])
      if singleton:
          data = data[0]
      return apply_trans(xfm["trans"], data)
  
imports: import os.path
  from gzip import GzipFile
  from pathlib import Path
  import numpy
  from ._fiff.constants import FIFF
  from ._fiff.meas_info import read_fiducials
  from .surface import _read_mri_surface, read_surface
  from .transforms import Transform, _ensure_trans, apply_trans, combine_transforms, invert_transform, read_ras_mni_t
  from .utils import _check_fname, _check_option, _import_nibabel, _validate_type, get_subjects_dir, logger, verbose
label_desc: Use image node_id 10 for calling a global function with example usage: vertex_to_mni(vertices, hemis, subject, subjects_dir, verbose) and returns: apply_trans