code: def overlay_images(
      img0,
      img1,
      title0="",
      title_mid="",
      title1="",
      fname=None,
      **fig_kwargs,
  ):
      r"""Plot two images one on top of the other using red and green channels.
  
      Creates a figure containing three images: the first image to the left
      plotted on the red channel of a color image, the second to the right
      plotted on the green channel of a color image and the two given images on
      top of each other using the red channel for the first image and the green
      channel for the second one. It is assumed that both images have the same
      shape. The intended use of this function is to visually assess the quality
      of a registration result.
  
      Parameters
      ----------
      img0 : array, shape(R, C)
          the image to be plotted on the red channel, to the left of the figure
      img1 : array, shape(R, C)
          the image to be plotted on the green channel, to the right of the
          figure
      title0 : string (optional)
          the title to be written on top of the image to the left. By default, no
          title is displayed.
      title_mid : string (optional)
          the title to be written on top of the middle image. By default, no
          title is displayed.
      title1 : string (optional)
          the title to be written on top of the image to the right. By default,
          no title is displayed.
      fname : string (optional)
          the file name to write the resulting figure. If None (default), the
          image is not saved.
      fig_kwargs: extra parameters for saving figure, e.g. `dpi=300`.
      """
      # Normalize the input images to [0,255]
      img0 = 255 * ((img0 - img0.min()) / (img0.max() - img0.min()))
      img1 = 255 * ((img1 - img1.min()) / (img1.max() - img1.min()))
  
      # Create the color images
      img0_red = np.zeros(shape=img0.shape + (3,), dtype=np.uint8)
      img1_green = np.zeros(shape=img0.shape + (3,), dtype=np.uint8)
      overlay = np.zeros(shape=img0.shape + (3,), dtype=np.uint8)
  
      # Copy the normalized intensities into the appropriate channels of the
      # color images
      img0_red[..., 0] = img0
      img1_green[..., 1] = img1
      overlay[..., 0] = img0
      overlay[..., 1] = img1
  
      fig = _tile_plot(
          [img0_red, overlay, img1_green], [title0, title_mid, title1]
      )
  
      # If a file name was given, save the figure
      if fname is not None:
          fig.savefig(fname, bbox_inches="tight", **fig_kwargs)
  
      return fig
  
file_path: dipy/dipy/viz/regtools.py
imports: import numpy
  from dipy.utils.optpkg import optional_package
label_desc: Use image node_id 3 for calling a global function with example usage: overlay_images(img0, img1, title0, title_mid, title1, fname) and returns: fig