code: def plot_prob_atlas(
      maps_img,
      bg_img=MNI152TEMPLATE,
      view_type="auto",
      threshold="auto",
      linewidths=2.5,
      cut_coords=None,
      output_file=None,
      display_mode="ortho",
      figure=None,
      axes=None,
      title=None,
      annotate=True,
      draw_cross=True,
      black_bg="auto",
      dim="auto",
      colorbar=False,
      cmap=plt.cm.gist_rainbow,
      vmin=None,
      vmax=None,
      alpha=0.7,
      radiological=False,
      **kwargs,
  ):
      """Plot a :term:`Probabilistic atlas` onto the anatomical image \
      by default :term:`MNI` template.
  
      Parameters
      ----------
      maps_img : Niimg-like object or the filename
          4D image of the :term:`Probabilistic atlas` maps.
      %(bg_img)s
          If nothing is specified, the MNI152 template will be used.
          To turn off background image, just pass "bg_img=False".
          Default=MNI152TEMPLATE.
  
          .. versionadded:: 0.4.0
  
      view_type : {'auto', 'contours', 'filled_contours', 'continuous'}, \
                  default='auto'
          If view_type == 'auto', it means maps will be displayed
          automatically using any one of the three view types. The automatic
          selection of view type depends on the total number of maps.
          If view_type == 'contours', maps are overlaid as contours
          If view_type == 'filled_contours', maps are overlaid as contours
          along with color fillings inside the contours.
          If view_type == 'continuous', maps are overlaid as continuous
          colors irrespective of the number maps.
  
      threshold : a str or a number, list of str or numbers, default='auto'
          This parameter is optional and is used to threshold the maps image
          using the given value or automatically selected value. The values
          in the image above the threshold level will be visualized.
          The default strategy, computes a threshold level that seeks to
          minimize (yet not eliminate completely) the overlap between several
          maps for a better visualization.
          The threshold can also be expressed as a percentile over the values
          of the whole atlas. In that case, the value must be specified as
          string finishing with a percent sign, e.g., "25.3%%".
          If a single string is provided, the same percentile will be applied
          over the whole atlas. Otherwise, if a list of percentiles is
          provided, each 3D map is thresholded with certain percentile
          sequentially. Length of percentiles given should match the number
          of 3D map in time (4th) dimension.
          If a number or a list of numbers, the given value will be used
          directly to threshold the maps without any percentile calculation.
          If None, a very small threshold is applied to remove numerical
          noise from the maps background.
      %(linewidths)s
          Default=2.5.
      %(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'.
      %(dim)s
          Default='auto'.
      %(cmap)s
          Default=`plt.cm.gist_rainbow`.
      %(colorbar)s
          Default=False.
      %(vmin)s
      %(vmax)s
      alpha : float between 0 and 1, default=0.7
          Alpha sets the transparency of the color inside the filled contours.
      %(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.
  
      See Also
      --------
      nilearn.plotting.plot_roi : To simply plot max-prob atlases (3D images)
  
      """
      display = plot_anat(
          bg_img,
          cut_coords=cut_coords,
          display_mode=display_mode,
          figure=figure,
          axes=axes,
          title=title,
          annotate=annotate,
          draw_cross=draw_cross,
          black_bg=black_bg,
          dim=dim,
          radiological=radiological,
          **kwargs,
      )
  
      maps_img = _utils.check_niimg_4d(maps_img)
      n_maps = maps_img.shape[3]
  
      valid_view_types = [
          "auto",
          "contours",
          "filled_contours",
          "continuous",
      ]
      if view_type not in valid_view_types:
          raise ValueError(
              f"Unknown view type: {view_type}. "
              f"Valid view types are {valid_view_types}."
          )
  
      cmap = plt.get_cmap(cmap)
      color_list = cmap(np.linspace(0, 1, n_maps))
  
      if view_type == "auto":
          if n_maps > 20:
              view_type = "contours"
          elif n_maps > 10:
              view_type = "filled_contours"
          else:
              view_type = "continuous"
  
      if threshold is None:
          threshold = 1e-6
      elif threshold == "auto":
          # it will use default percentage,
          # strategy is to avoid maximum overlaps as possible
          if view_type == "contours":
              correction_factor = 1
          elif view_type == "filled_contours":
              correction_factor = 0.8
          else:
              correction_factor = 0.5
          threshold = (
              f"{100 * (1 - 0.2 * correction_factor / n_maps):f}%"
          )
  
      if isinstance(
          threshold, collections.abc.Iterable
      ) and not isinstance(threshold, str):
          threshold = [thr for thr in threshold]
          if len(threshold) != n_maps:
              raise TypeError(
                  "The list of values to threshold "
                  "should be equal to number of maps"
              )
      else:
          threshold = [threshold] * n_maps
  
      filled = view_type.startswith("filled")
      for map_img, color, thr in zip(
          iter_img(maps_img), color_list, threshold
      ):
          data = get_data(map_img)
          # To threshold or choose the level of the contours
          thr = check_threshold(
              thr,
              data,
              percentile_func=fast_abs_percentile,
              name="threshold",
          )
          # Get rid of background values in all cases
          thr = max(thr, 1e-6)
  
          if view_type == "continuous":
              display.add_overlay(
                  map_img,
                  threshold=thr,
                  cmap=cm.alpha_cmap(color),
                  alpha=alpha,
              )
          else:
              display.add_contours(
                  map_img,
                  levels=[thr],
                  linewidths=linewidths,
                  colors=[color],
                  filled=filled,
                  alpha=alpha,
                  linestyles="solid",
              )
      if colorbar:
          display._colorbar = True
          # Create a colormap from color list to feed display
          cmap = matplotlib.colors.LinearSegmentedColormap.from_list(
              "segmented colors", color_list, n_maps + 1
          )
          display._show_colorbar(
              cmap, matplotlib.colors.Normalize(1, n_maps + 1)
          )
          tick_locator = matplotlib.ticker.MaxNLocator(nbins=10)
          display.locator = tick_locator
          display._cbar.update_ticks()
          tick_location = np.round(
              np.linspace(1, n_maps, min(n_maps, 10))
          ).astype("int")
          display._cbar.set_ticks(tick_location + 0.5)
          display._cbar.set_ticklabels(tick_location)
          (
              left,
              bottom,
              width,
              height,
          ) = display._colorbar_ax.get_position().bounds
          display._colorbar_ax.set_position(
              [left, bottom, width, height * 0.95]
          )
          display._colorbar_ax.annotate(
              "Map #",
              xy=(1, 1.03),
              ha="right",
              va="bottom",
              xycoords="axes fraction",
          )
      if output_file is not None:
          display.savefig(output_file)
          display.close()
          display = None
  
      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 11 for calling a global function with example usage: plot_prob_atlas(maps_img, bg_img, view_type, threshold, linewidths, cut_coords, output_file, display_mode, figure, axes, title, annotate, draw_cross, black_bg, dim, colorbar, cmap, vmin, vmax, alpha, radiological) and returns: display