code: def imshow_mri(data, img, vox, xyz, suptitle):
      """Show an MRI slice with a voxel annotated."""
      i, j, k = vox
      fig, ax = plt.subplots(1, figsize=(6, 6), layout="constrained")
      codes = nibabel.orientations.aff2axcodes(img.affine)
      # Figure out the title based on the code of this axis
      ori_slice = dict(
          P="Coronal",
          A="Coronal",
          I="Axial",
          S="Axial",
          L="Sagittal",
          R="Sagittal",
      )
      ori_names = dict(
          P="posterior",
          A="anterior",
          I="inferior",
          S="superior",
          L="left",
          R="right",
      )
      title = ori_slice[codes[0]]
      ax.imshow(data[i], vmin=10, vmax=120, cmap="gray", origin="lower")
      ax.axvline(k, color="y")
      ax.axhline(j, color="y")
      for kind, coords in xyz.items():
          annotation = "{}: {}, {}, {} mm".format(
              kind, *np.round(coords).astype(int)
          )
          text = ax.text(
              k,
              j,
              annotation,
              va="baseline",
              ha="right",
              color=(1, 1, 0.7),
          )
          text.set_path_effects(
              [
                  path_effects.Stroke(linewidth=2, foreground="black"),
                  path_effects.Normal(),
              ]
          )
      # reorient view so that RAS is always rightward and upward
      x_order = -1 if codes[2] in "LIP" else 1
      y_order = -1 if codes[1] in "LIP" else 1
      ax.set(
          xlim=[0, data.shape[2] - 1][::x_order],
          ylim=[0, data.shape[1] - 1][::y_order],
          xlabel=f"k ({ori_names[codes[2]]}+)",
          ylabel=f"j ({ori_names[codes[1]]}+)",
          title=f"{title} view: i={i} ({ori_names[codes[0]]}+)",
      )
      fig.suptitle(suptitle)
      return fig
  
imports: import matplotlib.patheffects
  import matplotlib.pyplot
  import nibabel
  import numpy
  import mne
  from mne.io.constants import FIFF
  from mne.transforms import apply_trans
label_desc: Use image node_id 1 for calling a global function with example usage: imshow_mri(data, img, vox, xyz, suptitle) and returns: fig