code: def plot_roi(
      roi_img,
      bg_img=MNI152TEMPLATE,
      cut_coords=None,
      output_file=None,
      display_mode="ortho",
      figure=None,
      axes=None,
      title=None,
      annotate=True,
      draw_cross=True,
      black_bg="auto",
      threshold=0.5,
      alpha=0.7,
      cmap=plt.cm.gist_ncar,
      dim="auto",
      colorbar=False,
      cbar_tick_format="%i",
      vmin=None,
      vmax=None,
      resampling_interpolation="nearest",
      view_type="continuous",
      linewidths=2.5,
      radiological=False,
      **kwargs,
  ):
      """Plot cuts of an ROI/mask image.
  
      By default 3 cuts: Frontal, Axial, and Lateral.
  
      Parameters
      ----------
      roi_img : Niimg-like object
          See :ref:`extracting_data`.
          The ROI/mask image, it could be binary mask or an atlas or ROIs
          with integer values.
      %(bg_img)s
          If nothing is specified, the MNI152 template will be used.
          To turn off background image, just pass "bg_img=None".
          Default=MNI152TEMPLATE.
      %(cut_coords)s
      %(output_file)s
      %(display_mode)s
      %(figure)s
      %(axes)s
      %(title)s
      %(annotate)s
      %(draw_cross)s
      %(black_bg)s
          Default='auto'.
      %(threshold)s
          Default=0.5.
      alpha : float between 0 and 1, default=0.7
          Alpha sets the transparency of the color inside the filled
          contours.
      %(cmap)s
          Default=`plt.cm.gist_ncar`.
      %(dim)s
          Default='auto'.
      colorbar : boolean, default=False
          If True, display a colorbar on the right of the plots.
      cbar_tick_format: str, default="%%.2g" (scientific notation)
          Controls how to format the tick labels of the colorbar.
          Ex: use "%%.2g" to use scientific notation.
      %(vmin)s
      %(vmax)s
      %(resampling_interpolation)s
          Default='nearest'.
      view_type : {'continuous', 'contours'}, default='continuous'
          By default view_type == 'continuous',
          rois are shown as continuous colors.
          If view_type == 'contours', maps are shown as contours.
          For this type, label
          denoted as 0 is considered as background and not shown.
      %(linewidths)s
          Default=2.5.
      %(radiological)s
  
      Returns
      -------
      display : :class:`~nilearn.plotting.displays.OrthoSlicer` or None
          An instance of the OrthoSlicer class. If ``output_file`` is defined,
          None is returned.
  
      Notes
      -----
      A small threshold is applied by default to eliminate numerical
      background noise.
  
      For visualization, non-finite values found in passed 'roi_img' or
      'bg_img' are set to zero.
  
      See Also
      --------
      nilearn.plotting.plot_prob_atlas : To simply plot probabilistic atlases
          (4D images)
  
      """
      valid_view_types = ["continuous", "contours"]
      if view_type not in valid_view_types:
          raise ValueError(
              f"Unknown view type: {view_type}. "
              f"Valid view types are {valid_view_types}."
          )
      elif view_type == "contours":
          img = roi_img
          roi_img = None
  
      bg_img, black_bg, bg_vmin, bg_vmax = load_anat(
          bg_img, dim=dim, black_bg=black_bg
      )
  
      display = _plot_img_with_bg(
          img=roi_img,
          bg_img=bg_img,
          cut_coords=cut_coords,
          output_file=output_file,
          display_mode=display_mode,
          figure=figure,
          axes=axes,
          title=title,
          annotate=annotate,
          draw_cross=draw_cross,
          black_bg=black_bg,
          threshold=threshold,
          bg_vmin=bg_vmin,
          bg_vmax=bg_vmax,
          resampling_interpolation=resampling_interpolation,
          colorbar=colorbar,
          cbar_tick_format=cbar_tick_format,
          alpha=alpha,
          cmap=cmap,
          vmin=vmin,
          vmax=vmax,
          radiological=radiological,
          **kwargs,
      )
  
      if view_type == "contours":
          display = _plot_roi_contours(
              display,
              img,
              cmap=cmap,
              alpha=alpha,
              linewidths=linewidths,
          )
  
      return display
  
imports: import collections.abc
  import functools
  import numbers
  import os
  import warnings
  import matplotlib
  import matplotlib.pyplot
  import numpy
  from matplotlib import gridspec
  from matplotlib.colors import LinearSegmentedColormap
  from nibabel.spatialimages import SpatialImage
  from scipy import stats
  from scipy.ndimage import binary_fill_holes
  from nilearn.image.resampling import reorder_img
  from nilearn.maskers import NiftiMasker
  from nilearn.plotting.displays import get_projector, get_slicer
  from nilearn.plotting.displays._slicers import _get_cbar_ticks
  from ..None import _utils
  from .._utils import compare_version, fill_doc
  from .._utils.extmath import fast_abs_percentile
  from .._utils.ndimage import get_border_data
  from .._utils.niimg import safe_get_data
  from .._utils.numpy_conversions import as_ndarray
  from .._utils.param_validation import check_threshold
  from ..datasets import load_mni152_template
  from ..image import get_data, iter_img, math_img, new_img_like, resample_to_img
  from ..masking import apply_mask, compute_epi_mask
  from ..signal import clean
  from .None import cm
label_desc: Use image node_id 10 for calling a global function with example usage: plot_roi(roi_img, bg_img, cut_coords, output_file, display_mode, figure, axes, title, annotate, draw_cross, black_bg, threshold, alpha, cmap, dim, colorbar, cbar_tick_format, vmin, vmax, resampling_interpolation, view_type, linewidths, radiological) and returns: display