code: def test_other_volume_source_spaces(tmp_path):
      """Test setting up other volume source spaces."""
      # these are split off because they require the MNE tools, and
      # Travis doesn't seem to like them
      pytest.importorskip("nibabel")
  
      # let's try the spherical one (no bem or surf supplied)
      temp_name = tmp_path / "temp-src.fif"
      run_subprocess(
          [
              "mne_volume_source_space",
              "--grid",
              "7.0",
              "--src",
              temp_name,
              "--mri",
              fname_mri,
          ]
      )
      src = read_source_spaces(temp_name)
      sphere = (0.0, 0.0, 0.0, 0.09)
      src_new = setup_volume_source_space(
          None,
          pos=7.0,
          mri=fname_mri,
          subjects_dir=subjects_dir,
          sphere=sphere,
      )
      # we use a more accurate elimination criteria, so let's fix the MNE-C
      # source space
      assert len(src_new[0]["vertno"]) == 7497
      assert len(src) == 1
      assert len(src_new) == 1
      good_mask = np.isin(src[0]["vertno"], src_new[0]["vertno"])
      src[0]["inuse"][src[0]["vertno"][~good_mask]] = 0
      assert src[0]["inuse"].sum() == 7497
      src[0]["vertno"] = src[0]["vertno"][good_mask]
      assert len(src[0]["vertno"]) == 7497
      src[0]["nuse"] = len(src[0]["vertno"])
      assert src[0]["nuse"] == 7497
      _compare_source_spaces(src_new, src, mode="approx")
      assert "volume, shape" in repr(src)
      del src
      del src_new
      pytest.raises(
          ValueError,
          setup_volume_source_space,
          "sample",
          pos=7.0,
          sphere=[1.0, 1.0],
          mri=fname_mri,  # bad sphere
          subjects_dir=subjects_dir,
      )
  
      # now without MRI argument, it should give an error when we try
      # to read it
      run_subprocess(
          [
              "mne_volume_source_space",
              "--grid",
              "7.0",
              "--src",
              temp_name,
          ]
      )
      pytest.raises(ValueError, read_source_spaces, temp_name)
  
imports: from pathlib import Path
  from shutil import copytree
  import numpy
  import pytest
  from numpy.testing import assert_allclose, assert_array_equal, assert_array_less, assert_equal
  import mne
  from mne import SourceEstimate, add_source_space_distances, compute_source_morph, get_volume_labels_from_src, make_sphere_model, morph_source_spaces, pick_types, read_bem_solution, read_bem_surfaces, read_freesurfer_lut, read_source_spaces, read_trans, setup_source_space, setup_volume_source_space, write_source_spaces
  from mne._fiff.constants import FIFF
  from mne._fiff.pick import _picks_to_idx
  from mne.datasets import testing
  from mne.fixes import _get_img_fdata
  from mne.source_estimate import _get_src_type
  from mne.source_space import compute_distance_to_sensors, get_decimated_surfaces
  from mne.source_space._source_space import _compare_source_spaces
  from mne.surface import _accumulate_normals, _triangle_neighbors
  from mne.utils import _record_warnings, requires_mne, run_subprocess
label_desc: Use image node_id 9 for calling a global function with example usage: test_other_volume_source_spaces(tmp_path) without return types