prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  BUG: broken reference in example
  <!--Provide a brief description of the bug.-->
  Broken reference to vol_to_surf in:
  
  examples/01_plotting/plot_3d_map_to_surface_projection.py
  
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `examples/01_plotting/plot_3d_map_to_surface_projection.py`
  Content:
  ```
  1 """
  2 Making a surface plot of a 3D statistical map
  3 =============================================
  4 
  5 project a 3D statistical map onto a cortical mesh using
  6 :func:`nilearn.surface.vol_to_surf`. Display a surface plot of the projected
  7 map using :func:`nilearn.plotting.plot_surf_stat_map` and adding contours of
  8 regions of interest using :func:`nilearn.plotting.plot_surf_contours`.
  9 
  10 """
  11 
  12 ##############################################################################
  13 # Get a statistical map
  14 # ---------------------
  15 
  16 from nilearn import datasets
  17 
  18 motor_images = datasets.fetch_neurovault_motor_task()
  19 stat_img = motor_images.images[0]
  20 
  21 
  22 ##############################################################################
  23 # Get a cortical mesh
  24 # -------------------
  25 
  26 fsaverage = datasets.fetch_surf_fsaverage()
  27 
  28 ##############################################################################
  29 # Sample the 3D data around each node of the mesh
  30 # -----------------------------------------------
  31 
  32 from nilearn import surface
  33 
  34 texture = surface.vol_to_surf(stat_img, fsaverage.pial_right)
  35 
  36 ##############################################################################
  37 # Plot the result
  38 # ---------------
  39 
  40 from nilearn import plotting
  41 
  42 plotting.plot_surf_stat_map(fsaverage.infl_right, texture, hemi='right',
  43                             title='Surface right hemisphere', colorbar=True,
  44                             threshold=1., bg_map=fsaverage.sulc_right)
  45 
  46 ##############################################################################
  47 # Plot 3D image for comparison
  48 # ----------------------------
  49 
  50 plotting.plot_glass_brain(stat_img, display_mode='r', plot_abs=False,
  51                           title='Glass brain', threshold=2.)
  52 
  53 plotting.plot_stat_map(stat_img, display_mode='x', threshold=1.,
  54                        cut_coords=range(0, 51, 10), title='Slices')
  55 
  56 ##############################################################################
  57 # Use an atlas and choose regions to outline
  58 # ------------------------------------------
  59 
  60 import numpy as np
  61 
  62 destrieux_atlas = datasets.fetch_atlas_surf_destrieux()
  63 parcellation = destrieux_atlas['map_right']
  64 
  65 # these are the regions we want to outline
  66 regions_dict = {b'G_postcentral': 'Postcentral gyrus',
  67                 b'G_precentral': 'Precentral gyrus'}
  68 
  69 # get indices in atlas for these labels
  70 regions_indices = [np.where(np.array(destrieux_atlas['labels']) == region)[0][0]
  71                    for region in regions_dict]
  72 
  73 labels = list(regions_dict.values())
  74 
  75 ##############################################################################
  76 # Display outlines of the regions of interest on top of a statistical map
  77 # -----------------------------------------------------------------------
  78 
  79 figure = plotting.plot_surf_stat_map(fsaverage.infl_right, texture, hemi='right',
  80                                      title='Surface right hemisphere',
  81                                      colorbar=True, threshold=1.,
  82                                      bg_map=fsaverage.sulc_right)
  83 
  84 plotting.plot_surf_contours(fsaverage.infl_right, parcellation, labels=labels,
  85                             levels=regions_indices, figure=figure, legend=True,
  86                             colors=['g', 'k'])
  87 plotting.show()
  88 
  89 ##############################################################################
  90 # Plot with higher-resolution mesh
  91 # --------------------------------
  92 #
  93 # `fetch_surf_fsaverage` takes a "mesh" argument which specifies
  94 # wether to fetch the low-resolution fsaverage5 mesh, or the high-resolution
  95 # fsaverage mesh. using mesh="fsaverage" will result in more memory usage and
  96 # computation time, but finer visualizations.
  97 
  98 big_fsaverage = datasets.fetch_surf_fsaverage('fsaverage')
  99 big_texture = surface.vol_to_surf(stat_img, big_fsaverage.pial_right)
  100 
  101 plotting.plot_surf_stat_map(big_fsaverage.infl_right,
  102                             big_texture, hemi='right', colorbar=True,
  103                             title='Surface right hemisphere: fine mesh',
  104                             threshold=1., bg_map=big_fsaverage.sulc_right)
  105 
  106 
  107 ##############################################################################
  108 # Plot multiple views of the 3D volume on a surface
  109 # -------------------------------------------------
  110 #
  111 # *plot_img_on_surf* takes a statistical map and projects it onto a surface.
  112 # It supports multiple choices of orientations, and can plot either one or both
  113 # hemispheres. If no *surf_mesh* is given, *plot_img_on_surf* projects the
  114 # images onto `FreeSurfer <https://surfer.nmr.mgh.harvard.edu/>`_\'s
  115 # fsaverage5.
  116 
  117 plotting.plot_img_on_surf(stat_img,
  118                           views=['lateral', 'medial'],
  119                           hemispheres=['left', 'right'],
  120                           colorbar=True)
  121 plotting.show()
  122 
  123 ##############################################################################
  124 # 3D visualization in a web browser
  125 # ---------------------------------
  126 # An alternative to :func:`nilearn.plotting.plot_surf_stat_map` is to use
  127 # :func:`nilearn.plotting.view_surf` or
  128 # :func:`nilearn.plotting.view_img_on_surf` that give more interactive
  129 # visualizations in a web browser. See :ref:`interactive-surface-plotting` for
  130 # more details.
  131 
  132 view = plotting.view_surf(fsaverage.infl_right, texture, threshold='90%',
  133                           bg_map=fsaverage.sulc_right)
  134 
  135 # In a Jupyter notebook, if ``view`` is the output of a cell, it will
  136 # be displayed below the cell
  137 view
  138 
  139 ##############################################################################
  140 
  141 # uncomment this to open the plot in a web browser:
  142 # view.open_in_browser()
  143 
  144 ##############################################################################
  145 # We don't need to do the projection ourselves, we can use view_img_on_surf:
  146 
  147 view = plotting.view_img_on_surf(stat_img, threshold='90%')
  148 # view.open_in_browser()
  149 
  150 view
  151 
  152 ##############################################################################
  153 # Impact of plot parameters on visualization
  154 # ------------------------------------------
  155 # You can specify arguments to be passed on to the function
  156 # :func:`nilearn.plotting.vol_to_surf` using `vol_to_surf_kwargs`. This allows
  157 # fine-grained control of how the input 3D image is resampled and interpolated -
  158 # for example if you are viewing a volumetric atlas, you would want to avoid
  159 # averaging the labels between neighboring regions. Using nearest-neighbor
  160 # interpolation with zero radius will achieve this.
  161 
  162 destrieux = datasets.fetch_atlas_destrieux_2009()
  163 
  164 view = plotting.view_img_on_surf(
  165     destrieux.maps,
  166     surf_mesh="fsaverage",
  167     vol_to_surf_kwargs={"n_samples": 1, "radius": 0.0, "interpolation": "nearest"},
  168     symmetric_cmap=False,
  169 )
  170 
  171 # view.open_in_browser()
  172 view
  173
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/examples/01_plotting/plot_3d_map_to_surface_projection.py b/examples/01_plotting/plot_3d_map_to_surface_projection.py
  --- a/examples/01_plotting/plot_3d_map_to_surface_projection.py
  +++ b/examples/01_plotting/plot_3d_map_to_surface_projection.py
  @@ -153,7 +153,7 @@
   # Impact of plot parameters on visualization
   # ------------------------------------------
   # You can specify arguments to be passed on to the function
  -# :func:`nilearn.plotting.vol_to_surf` using `vol_to_surf_kwargs`. This allows
  +# :func:`nilearn.surface.vol_to_surf` using `vol_to_surf_kwargs`. This allows
   # fine-grained control of how the input 3D image is resampled and interpolated -
   # for example if you are viewing a volumetric atlas, you would want to avoid
   # averaging the labels between neighboring regions. Using nearest-neighbor
  
verification_info: {"golden_diff": "diff --git a/examples/01_plotting/plot_3d_map_to_surface_projection.py b/examples/01_plotting/plot_3d_map_to_surface_projection.py\n--- a/examples/01_plotting/plot_3d_map_to_surface_projection.py\n+++ b/examples/01_plotting/plot_3d_map_to_surface_projection.py\n@@ -153,7 +153,7 @@\n # Impact of plot parameters on visualization\n # ------------------------------------------\n # You can specify arguments to be passed on to the function\n-# :func:`nilearn.plotting.vol_to_surf` using `vol_to_surf_kwargs`. This allows\n+# :func:`nilearn.surface.vol_to_surf` using `vol_to_surf_kwargs`. This allows\n # fine-grained control of how the input 3D image is resampled and interpolated -\n # for example if you are viewing a volumetric atlas, you would want to avoid\n # averaging the labels between neighboring regions. Using nearest-neighbor\n", "issue": "BUG: broken reference in example\n<!--Provide a brief description of the bug.-->\r\nBroken reference to vol_to_surf in:\r\n\r\nexamples/01_plotting/plot_3d_map_to_surface_projection.py\r\n\r\n\n", "before_files": [{"content": "\"\"\"\nMaking a surface plot of a 3D statistical map\n=============================================\n\nproject a 3D statistical map onto a cortical mesh using\n:func:`nilearn.surface.vol_to_surf`. Display a surface plot of the projected\nmap using :func:`nilearn.plotting.plot_surf_stat_map` and adding contours of\nregions of interest using :func:`nilearn.plotting.plot_surf_contours`.\n\n\"\"\"\n\n##############################################################################\n# Get a statistical map\n# ---------------------\n\nfrom nilearn import datasets\n\nmotor_images = datasets.fetch_neurovault_motor_task()\nstat_img = motor_images.images[0]\n\n\n##############################################################################\n# Get a cortical mesh\n# -------------------\n\nfsaverage = datasets.fetch_surf_fsaverage()\n\n##############################################################################\n# Sample the 3D data around each node of the mesh\n# -----------------------------------------------\n\nfrom nilearn import surface\n\ntexture = surface.vol_to_surf(stat_img, fsaverage.pial_right)\n\n##############################################################################\n# Plot the result\n# ---------------\n\nfrom nilearn import plotting\n\nplotting.plot_surf_stat_map(fsaverage.infl_right, texture, hemi='right',\n                            title='Surface right hemisphere', colorbar=True,\n                            threshold=1., bg_map=fsaverage.sulc_right)\n\n##############################################################################\n# Plot 3D image for comparison\n# ----------------------------\n\nplotting.plot_glass_brain(stat_img, display_mode='r', plot_abs=False,\n                          title='Glass brain', threshold=2.)\n\nplotting.plot_stat_map(stat_img, display_mode='x', threshold=1.,\n                       cut_coords=range(0, 51, 10), title='Slices')\n\n##############################################################################\n# Use an atlas and choose regions to outline\n# ------------------------------------------\n\nimport numpy as np\n\ndestrieux_atlas = datasets.fetch_atlas_surf_destrieux()\nparcellation = destrieux_atlas['map_right']\n\n# these are the regions we want to outline\nregions_dict = {b'G_postcentral': 'Postcentral gyrus',\n                b'G_precentral': 'Precentral gyrus'}\n\n# get indices in atlas for these labels\nregions_indices = [np.where(np.array(destrieux_atlas['labels']) == region)[0][0]\n                   for region in regions_dict]\n\nlabels = list(regions_dict.values())\n\n##############################################################################\n# Display outlines of the regions of interest on top of a statistical map\n# -----------------------------------------------------------------------\n\nfigure = plotting.plot_surf_stat_map(fsaverage.infl_right, texture, hemi='right',\n                                     title='Surface right hemisphere',\n                                     colorbar=True, threshold=1.,\n                                     bg_map=fsaverage.sulc_right)\n\nplotting.plot_surf_contours(fsaverage.infl_right, parcellation, labels=labels,\n                            levels=regions_indices, figure=figure, legend=True,\n                            colors=['g', 'k'])\nplotting.show()\n\n##############################################################################\n# Plot with higher-resolution mesh\n# --------------------------------\n#\n# `fetch_surf_fsaverage` takes a \"mesh\" argument which specifies\n# wether to fetch the low-resolution fsaverage5 mesh, or the high-resolution\n# fsaverage mesh. using mesh=\"fsaverage\" will result in more memory usage and\n# computation time, but finer visualizations.\n\nbig_fsaverage = datasets.fetch_surf_fsaverage('fsaverage')\nbig_texture = surface.vol_to_surf(stat_img, big_fsaverage.pial_right)\n\nplotting.plot_surf_stat_map(big_fsaverage.infl_right,\n                            big_texture, hemi='right', colorbar=True,\n                            title='Surface right hemisphere: fine mesh',\n                            threshold=1., bg_map=big_fsaverage.sulc_right)\n\n\n##############################################################################\n# Plot multiple views of the 3D volume on a surface\n# -------------------------------------------------\n#\n# *plot_img_on_surf* takes a statistical map and projects it onto a surface.\n# It supports multiple choices of orientations, and can plot either one or both\n# hemispheres. If no *surf_mesh* is given, *plot_img_on_surf* projects the\n# images onto `FreeSurfer <https://surfer.nmr.mgh.harvard.edu/>`_\\'s\n# fsaverage5.\n\nplotting.plot_img_on_surf(stat_img,\n                          views=['lateral', 'medial'],\n                          hemispheres=['left', 'right'],\n                          colorbar=True)\nplotting.show()\n\n##############################################################################\n# 3D visualization in a web browser\n# ---------------------------------\n# An alternative to :func:`nilearn.plotting.plot_surf_stat_map` is to use\n# :func:`nilearn.plotting.view_surf` or\n# :func:`nilearn.plotting.view_img_on_surf` that give more interactive\n# visualizations in a web browser. See :ref:`interactive-surface-plotting` for\n# more details.\n\nview = plotting.view_surf(fsaverage.infl_right, texture, threshold='90%',\n                          bg_map=fsaverage.sulc_right)\n\n# In a Jupyter notebook, if ``view`` is the output of a cell, it will\n# be displayed below the cell\nview\n\n##############################################################################\n\n# uncomment this to open the plot in a web browser:\n# view.open_in_browser()\n\n##############################################################################\n# We don't need to do the projection ourselves, we can use view_img_on_surf:\n\nview = plotting.view_img_on_surf(stat_img, threshold='90%')\n# view.open_in_browser()\n\nview\n\n##############################################################################\n# Impact of plot parameters on visualization\n# ------------------------------------------\n# You can specify arguments to be passed on to the function\n# :func:`nilearn.plotting.vol_to_surf` using `vol_to_surf_kwargs`. This allows\n# fine-grained control of how the input 3D image is resampled and interpolated -\n# for example if you are viewing a volumetric atlas, you would want to avoid\n# averaging the labels between neighboring regions. Using nearest-neighbor\n# interpolation with zero radius will achieve this.\n\ndestrieux = datasets.fetch_atlas_destrieux_2009()\n\nview = plotting.view_img_on_surf(\n    destrieux.maps,\n    surf_mesh=\"fsaverage\",\n    vol_to_surf_kwargs={\"n_samples\": 1, \"radius\": 0.0, \"interpolation\": \"nearest\"},\n    symmetric_cmap=False,\n)\n\n# view.open_in_browser()\nview\n", "path": "examples/01_plotting/plot_3d_map_to_surface_projection.py"}], "after_files": [{"content": "\"\"\"\nMaking a surface plot of a 3D statistical map\n=============================================\n\nproject a 3D statistical map onto a cortical mesh using\n:func:`nilearn.surface.vol_to_surf`. Display a surface plot of the projected\nmap using :func:`nilearn.plotting.plot_surf_stat_map` and adding contours of\nregions of interest using :func:`nilearn.plotting.plot_surf_contours`.\n\n\"\"\"\n\n##############################################################################\n# Get a statistical map\n# ---------------------\n\nfrom nilearn import datasets\n\nmotor_images = datasets.fetch_neurovault_motor_task()\nstat_img = motor_images.images[0]\n\n\n##############################################################################\n# Get a cortical mesh\n# -------------------\n\nfsaverage = datasets.fetch_surf_fsaverage()\n\n##############################################################################\n# Sample the 3D data around each node of the mesh\n# -----------------------------------------------\n\nfrom nilearn import surface\n\ntexture = surface.vol_to_surf(stat_img, fsaverage.pial_right)\n\n##############################################################################\n# Plot the result\n# ---------------\n\nfrom nilearn import plotting\n\nplotting.plot_surf_stat_map(fsaverage.infl_right, texture, hemi='right',\n                            title='Surface right hemisphere', colorbar=True,\n                            threshold=1., bg_map=fsaverage.sulc_right)\n\n##############################################################################\n# Plot 3D image for comparison\n# ----------------------------\n\nplotting.plot_glass_brain(stat_img, display_mode='r', plot_abs=False,\n                          title='Glass brain', threshold=2.)\n\nplotting.plot_stat_map(stat_img, display_mode='x', threshold=1.,\n                       cut_coords=range(0, 51, 10), title='Slices')\n\n##############################################################################\n# Use an atlas and choose regions to outline\n# ------------------------------------------\n\nimport numpy as np\n\ndestrieux_atlas = datasets.fetch_atlas_surf_destrieux()\nparcellation = destrieux_atlas['map_right']\n\n# these are the regions we want to outline\nregions_dict = {b'G_postcentral': 'Postcentral gyrus',\n                b'G_precentral': 'Precentral gyrus'}\n\n# get indices in atlas for these labels\nregions_indices = [np.where(np.array(destrieux_atlas['labels']) == region)[0][0]\n                   for region in regions_dict]\n\nlabels = list(regions_dict.values())\n\n##############################################################################\n# Display outlines of the regions of interest on top of a statistical map\n# -----------------------------------------------------------------------\n\nfigure = plotting.plot_surf_stat_map(fsaverage.infl_right, texture, hemi='right',\n                                     title='Surface right hemisphere',\n                                     colorbar=True, threshold=1.,\n                                     bg_map=fsaverage.sulc_right)\n\nplotting.plot_surf_contours(fsaverage.infl_right, parcellation, labels=labels,\n                            levels=regions_indices, figure=figure, legend=True,\n                            colors=['g', 'k'])\nplotting.show()\n\n##############################################################################\n# Plot with higher-resolution mesh\n# --------------------------------\n#\n# `fetch_surf_fsaverage` takes a \"mesh\" argument which specifies\n# wether to fetch the low-resolution fsaverage5 mesh, or the high-resolution\n# fsaverage mesh. using mesh=\"fsaverage\" will result in more memory usage and\n# computation time, but finer visualizations.\n\nbig_fsaverage = datasets.fetch_surf_fsaverage('fsaverage')\nbig_texture = surface.vol_to_surf(stat_img, big_fsaverage.pial_right)\n\nplotting.plot_surf_stat_map(big_fsaverage.infl_right,\n                            big_texture, hemi='right', colorbar=True,\n                            title='Surface right hemisphere: fine mesh',\n                            threshold=1., bg_map=big_fsaverage.sulc_right)\n\n\n##############################################################################\n# Plot multiple views of the 3D volume on a surface\n# -------------------------------------------------\n#\n# *plot_img_on_surf* takes a statistical map and projects it onto a surface.\n# It supports multiple choices of orientations, and can plot either one or both\n# hemispheres. If no *surf_mesh* is given, *plot_img_on_surf* projects the\n# images onto `FreeSurfer <https://surfer.nmr.mgh.harvard.edu/>`_\\'s\n# fsaverage5.\n\nplotting.plot_img_on_surf(stat_img,\n                          views=['lateral', 'medial'],\n                          hemispheres=['left', 'right'],\n                          colorbar=True)\nplotting.show()\n\n##############################################################################\n# 3D visualization in a web browser\n# ---------------------------------\n# An alternative to :func:`nilearn.plotting.plot_surf_stat_map` is to use\n# :func:`nilearn.plotting.view_surf` or\n# :func:`nilearn.plotting.view_img_on_surf` that give more interactive\n# visualizations in a web browser. See :ref:`interactive-surface-plotting` for\n# more details.\n\nview = plotting.view_surf(fsaverage.infl_right, texture, threshold='90%',\n                          bg_map=fsaverage.sulc_right)\n\n# In a Jupyter notebook, if ``view`` is the output of a cell, it will\n# be displayed below the cell\nview\n\n##############################################################################\n\n# uncomment this to open the plot in a web browser:\n# view.open_in_browser()\n\n##############################################################################\n# We don't need to do the projection ourselves, we can use view_img_on_surf:\n\nview = plotting.view_img_on_surf(stat_img, threshold='90%')\n# view.open_in_browser()\n\nview\n\n##############################################################################\n# Impact of plot parameters on visualization\n# ------------------------------------------\n# You can specify arguments to be passed on to the function\n# :func:`nilearn.surface.vol_to_surf` using `vol_to_surf_kwargs`. This allows\n# fine-grained control of how the input 3D image is resampled and interpolated -\n# for example if you are viewing a volumetric atlas, you would want to avoid\n# averaging the labels between neighboring regions. Using nearest-neighbor\n# interpolation with zero radius will achieve this.\n\ndestrieux = datasets.fetch_atlas_destrieux_2009()\n\nview = plotting.view_img_on_surf(\n    destrieux.maps,\n    surf_mesh=\"fsaverage\",\n    vol_to_surf_kwargs={\"n_samples\": 1, \"radius\": 0.0, \"interpolation\": \"nearest\"},\n    symmetric_cmap=False,\n)\n\n# view.open_in_browser()\nview\n", "path": "examples/01_plotting/plot_3d_map_to_surface_projection.py"}]}