code: def test_view_img_on_surf():
      img = _get_img()
      surfaces = datasets.fetch_surf_fsaverage()
      html = html_surface.view_img_on_surf(img, threshold="92.3%")
      check_html(html)
      html = html_surface.view_img_on_surf(
          img, threshold=0, surf_mesh=surfaces
      )
      check_html(html)
      html = html_surface.view_img_on_surf(
          img, threshold=0.4, title="SOME_TITLE"
      )
      assert "SOME_TITLE" in html.html
      check_html(html)
      html = html_surface.view_img_on_surf(
          img, threshold=0.4, cmap="hot", black_bg=True
      )
      check_html(html)
      with pytest.raises(DimensionError):
          html_surface.view_img_on_surf([img, img])
      img_4d = image.new_img_like(
          img, get_data(img)[:, :, :, np.newaxis]
      )
      assert len(img_4d.shape) == 4
      html = html_surface.view_img_on_surf(img, threshold="92.3%")
      check_html(html)
      np.clip(get_data(img), 0, None, out=get_data(img))
      html = html_surface.view_img_on_surf(img, symmetric_cmap=False)
      check_html(html)
      html = html_surface.view_img_on_surf(
          img,
          symmetric_cmap=False,
          vol_to_surf_kwargs={
              "n_samples": 1,
              "radius": 0.0,
              "interpolation": "nearest",
          },
      )
      check_html(html)
  
file_path: nilearn/nilearn/plotting/tests/test_html_surface.py
imports: import json
  import numpy
  import pytest
  from nilearn import datasets, image, surface
  from nilearn._utils.exceptions import DimensionError
  from nilearn.datasets import fetch_surf_fsaverage
  from nilearn.image import get_data
  from nilearn.plotting import html_surface
  from nilearn.plotting.js_plotting_utils import decode
  from .test_js_plotting_utils import check_colors, check_html
label_desc: Use image node_id 8 for calling a global function with example usage: test_view_img_on_surf() without return types