code: def test_get_montage_volume_labels():
      """Test finding ROI labels near montage channel locations."""
      pytest.importorskip("nibabel")
      ch_coords = np.array(
          [
              [-8.7040273, 17.99938754, 10.29604017],
              [-14.03007764, 19.69978401, 12.07236939],
              [-21.1130506, 21.98310911, 13.25658887],
          ]
      )
      ch_pos = dict(zip(["1", "2", "3"], ch_coords / 1000))  # mm -> m
      montage = make_dig_montage(ch_pos, coord_frame="mri")
      labels, colors = get_montage_volume_labels(
          montage, "sample", subjects_dir, aseg="aseg", dist=1
      )
      assert labels == {
          "1": ["Unknown"],
          "2": ["Left-Cerebral-Cortex"],
          "3": ["Left-Cerebral-Cortex"],
      }
      assert "Unknown" in colors
      assert "Left-Cerebral-Cortex" in colors
      np.testing.assert_almost_equal(
          colors["Left-Cerebral-Cortex"],
          (
              0.803921568627451,
              0.24313725490196078,
              0.3058823529411765,
              1.0,
          ),
      )
      np.testing.assert_almost_equal(
          colors["Unknown"], (0.0, 0.0, 0.0, 1.0)
      )
  
      # test inputs
      with pytest.raises(
          RuntimeError, match='`aseg` file path must end with "aseg"'
      ):
          get_montage_volume_labels(
              montage, "sample", subjects_dir, aseg="foo"
          )
      fail_montage = make_dig_montage(ch_pos, coord_frame="head")
      with pytest.raises(
          RuntimeError, match="Coordinate frame not supported"
      ):
          get_montage_volume_labels(
              fail_montage, "sample", subjects_dir, aseg="aseg"
          )
      with pytest.raises(ValueError, match="between 0 and 10"):
          get_montage_volume_labels(
              montage, "sample", subjects_dir, dist=11
          )
  
imports: from pathlib import Path
  import numpy
  import pytest
  from numpy.testing import assert_allclose, assert_array_equal, assert_equal
  from mne import decimate_surface, dig_mri_distances, get_montage_volume_labels, pick_types, read_surface, write_surface
  from mne._fiff.constants import FIFF
  from mne.channels import make_dig_montage
  from mne.datasets import testing
  from mne.io import read_info
  from mne.surface import _compute_nearest, _get_ico_surface, _marching_cubes, _normal_orth, _project_onto_surface, _read_patch, _tessellate_sphere, _voxel_neighbors, fast_cross_3d, get_head_surf, get_meg_helmet_surf, read_curvature
  from mne.transforms import _get_trans
  from mne.utils import _record_warnings, catch_logging, object_diff, requires_freesurfer
label_desc: Use image node_id 12 for calling a global function with example usage: test_get_montage_volume_labels() without return types