code: def test_slicer_save_to_file(slicer, img, tmp_path):
      """Tests for saving to file with Ortho/Tiled/Mosaic slicers."""
      cut_coords = None if slicer == MosaicSlicer else (0, 0, 0)
      slicer = slicer.init_with_figure(
          img=img, cut_coords=cut_coords, colorbar=True
      )
      slicer.add_overlay(img, cmap=plt.cm.gray, colorbar=True)
      assert slicer.brain_color == (0.5, 0.5, 0.5)
      assert not slicer.black_bg
      # Forcing a layout here, to test the locator code
      slicer.savefig(tmp_path / "out.png")
      slicer.close()
  
imports: import matplotlib
  import matplotlib.pyplot
  import numpy
  import pytest
  from nibabel import Nifti1Image
  from nilearn.datasets import load_mni152_template
  from nilearn.plotting.displays import BaseAxes, LProjector, LRProjector, LYRProjector, LYRZProjector, LZRProjector, LZRYProjector, MosaicSlicer, OrthoProjector, OrthoSlicer, RProjector, TiledSlicer, XProjector, XSlicer, XZProjector, XZSlicer, YProjector, YSlicer, YXProjector, YXSlicer, YZProjector, YZSlicer, ZProjector, ZSlicer
label_desc: Use image node_id 9 for calling a global function with example usage: test_slicer_save_to_file(slicer, img, tmp_path) without return types