code: def _json_view_params(
      shape,
      affine,
      vmin,
      vmax,
      cut_slices,
      black_bg=False,
      opacity=1,
      draw_cross=True,
      annotate=True,
      title=None,
      colorbar=True,
      value=True,
  ):
      """Create a dictionary with all the brainsprite parameters.
  
      Returns: params
  
      """
      # Set color parameters
      if black_bg:
          cfont = "#FFFFFF"
          cbg = "#000000"
      else:
          cfont = "#000000"
          cbg = "#FFFFFF"
  
      # Deal with limitations of json dump regarding types
      if type(vmin).__module__ == "numpy":
          vmin = vmin.tolist()  # json does not deal with numpy array
      if type(vmax).__module__ == "numpy":
          vmax = vmax.tolist()  # json does not deal with numpy array
  
      params = {
          "canvas": "3Dviewer",
          "sprite": "spriteImg",
          "nbSlice": {"X": shape[0], "Y": shape[1], "Z": shape[2]},
          "overlay": {
              "sprite": "overlayImg",
              "nbSlice": {"X": shape[0], "Y": shape[1], "Z": shape[2]},
              "opacity": opacity,
          },
          "colorBackground": cbg,
          "colorFont": cfont,
          "crosshair": draw_cross,
          "affine": affine.tolist(),
          "flagCoordinates": annotate,
          "title": title,
          "flagValue": value,
          "numSlice": {
              "X": cut_slices[0] - 1,
              "Y": cut_slices[1] - 1,
              "Z": cut_slices[2] - 1,
          },
      }
  
      if colorbar:
          params["colorMap"] = {
              "img": "colorMap",
              "min": vmin,
              "max": vmax,
          }
      return params
  
imports: import copy
  import json
  import os
  import warnings
  from base64 import b64encode
  from io import BytesIO
  import matplotlib
  import numpy
  from matplotlib.image import imsave
  from nibabel.affines import apply_affine
  from nilearn.plotting.html_document import HTMLDocument
  from .._utils import fill_doc
  from .._utils.extmath import fast_abs_percentile
  from .._utils.niimg import safe_get_data
  from .._utils.niimg_conversions import check_niimg_3d
  from .._utils.param_validation import check_threshold
  from ..datasets import load_mni152_template
  from ..image import get_data, new_img_like, reorder_img, resample_to_img
  from ..plotting import cm
  from ..plotting.find_cuts import find_xyz_cut_coords
  from ..plotting.img_plotting import load_anat
  from .js_plotting_utils import colorscale, get_html_template
label_desc: Use image node_id 9 for calling a global function with example usage: _json_view_params(shape, affine, vmin, vmax, cut_slices, black_bg, opacity, draw_cross, annotate, title, colorbar, value) and returns: params