code: def __call__(self, block, block_vars, gallery_conf):
      from ._coreg import CoregistrationUI
  
      gui_classes = (CoregistrationUI,)
      try:
          from mne_gui_addons._ieeg_locate import (
              IntracranialElectrodeLocator,
          )
      except Exception:
          pass
      else:
          gui_classes = gui_classes + (IntracranialElectrodeLocator,)
      from qtpy import QtGui
      from sphinx_gallery.scrapers import figure_rst
  
      for gui in block_vars["example_globals"].values():
          if (
              isinstance(gui, gui_classes)
              and not getattr(gui, "_scraped", False)
              and gallery_conf["builder_name"] == "html"
          ):
              gui._scraped = True  # monkey-patch but it's easy enough
              img_fname = next(block_vars["image_path_iterator"])
              # TODO fix in window refactor
              window = (
                  gui if hasattr(gui, "grab") else gui._renderer._window
              )
              # window is QWindow
              # https://doc.qt.io/qt-5/qwidget.html#grab
              pixmap = window.grab()
              if hasattr(gui, "_renderer"):  # if no renderer, no need
                  # Now the tricky part: we need to get the 3D renderer,
                  # extract the image from it, and put it in the correct
                  # place in the pixmap. The easiest way to do this is
                  # actually to save the 3D image first, then load it
                  # using QPixmap and Qt geometry.
                  plotter = gui._renderer.plotter
                  plotter.screenshot(img_fname)
                  sub_pixmap = QtGui.QPixmap(img_fname)
                  # https://doc.qt.io/qt-5/qwidget.html#mapTo
                  # https://doc.qt.io/qt-5/qpainter.html#drawPixmap-1
                  QtGui.QPainter(pixmap).drawPixmap(
                      plotter.mapTo(window, plotter.rect().topLeft()),
                      sub_pixmap,
                  )
              # https://doc.qt.io/qt-5/qpixmap.html#save
              pixmap.save(img_fname)
              try:  # for compatibility with both GUIs, will be refactored
                  gui._renderer.close()  # TODO should be triggered by close
              except Exception:
                  pass
              gui.close()
              return figure_rst(
                  [img_fname], gallery_conf["src_dir"], "GUI"
              )
      return ""
  
imports: from ..utils import get_config, verbose
label_desc: Use image node_id 2 for calling the _GUIScraper obj's underlying member method code with example usage: obj.__call__(block, block_vars, gallery_conf) and returns: str, figure_rst