code: def plot_slices(V, slice_indices=None, fname=None, **fig_kwargs):
      r"""Plot 3 slices from the given volume: 1 sagittal, 1 coronal and 1 axial
  
      Creates a figure showing the axial, coronal and sagittal slices at the
      requested positions of the given volume. The requested slices are specified
      by slice_indices.
  
      Parameters
      ----------
      V : array, shape (S, R, C)
          the 3D volume to extract the slices from
      slice_indices : array, shape (3,) (optional)
          the indices of the sagittal (slice_indices[0]), coronal
          (slice_indices[1])
          and axial (slice_indices[2]) slices to be displayed. If None, the
          middle slices along each direction are displayed.
      fname : string (optional)
          the name of the file to save the figure to. If None (default), the
          figure is not saved to disk.
      fig_kwargs: extra parameters for saving figure, e.g. `dpi=300`.
      """
      if slice_indices is None:
          slice_indices = np.array(V.shape) // 2
  
      # Normalize the intensities to [0, 255]
      V = np.asarray(V, dtype=np.float64)
      V = 255 * (V - V.min()) / (V.max() - V.min())
  
      # Extract the middle slices
      axial = np.asarray(V[:, :, slice_indices[2]]).astype(np.uint8).T
      coronal = np.asarray(V[:, slice_indices[1], :]).astype(np.uint8).T
      sagittal = (
          np.asarray(V[slice_indices[0], :, :]).astype(np.uint8).T
      )
  
      fig = _tile_plot(
          [axial, coronal, sagittal],
          ["Axial", "Coronal", "Sagittal"],
          cmap=plt.cm.gray,
          origin="lower",
      )
  
      # Save the figure if requested
      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 6 for calling a global function with example usage: plot_slices(V, slice_indices, fname) and returns: fig