code: def test_vertex_to_mni_fs_nibabel(monkeypatch):
      """Test equivalence of vert_to_mni for nibabel and freesurfer."""
      pytest.importorskip("nibabel")
      n_check = 1000
      subject = "sample"
      vertices = rng.randint(0, 100000, n_check)
      hemis = rng.randint(0, 1, n_check)
      coords = vertex_to_mni(vertices, hemis, subject, subjects_dir)
      read_mri = mne._freesurfer._read_mri_info
      monkeypatch.setattr(
          mne._freesurfer,
          "_read_mri_info",
          lambda *args, **kwargs: read_mri(
              *args, use_nibabel=True, **kwargs
          ),
      )
      coords_2 = vertex_to_mni(vertices, hemis, subject, subjects_dir)
      # less than 0.1 mm error
      assert_allclose(coords, coords_2, atol=0.1)
  
file_path: mne-python/mne/tests/test_freesurfer.py
imports: from pathlib import Path
  import numpy
  import pytest
  from numpy.testing import assert_allclose, assert_array_equal
  import mne
  from mne import get_volume_labels_from_aseg, head_to_mni, read_freesurfer_lut, read_talxfm, vertex_to_mni
  from mne._freesurfer import _check_subject_dir, _estimate_talxfm_rigid, _get_mgz_header, read_lta
  from mne.datasets import testing
  from mne.transforms import _angle_between_quats, _get_trans, apply_trans, rot_to_quat
label_desc: Use image node_id 5 for calling a global function with example usage: test_vertex_to_mni_fs_nibabel(monkeypatch) without return types