code: def test_3d(self):
      testing_dir = os.path.join(
          os.path.dirname(os.path.realpath(__file__)), "testing_data"
      )
      keys = "image"
      xforms = Compose(
          [
              LoadImaged(keys=keys),
              EnsureChannelFirstd(keys=keys, channel_dim="no_channel"),
              ScaleIntensityd(keys=keys),
          ]
      )
      image_path = os.path.join(testing_dir, "anatomical.nii")
      ims = xforms({keys: image_path})
  
      fig = pyplot.figure()  # external figure
      fig, _ = matshow3d(
          ims[keys],
          fig=fig,
          figsize=(2, 2),
          frames_per_row=5,
          every_n=2,
          frame_dim=-1,
          show=False,
      )
  
      with tempfile.TemporaryDirectory() as tempdir:
          tempimg = f"{tempdir}/matshow3d_test.png"
          fig.savefig(tempimg)
          comp = compare_images(
              f"{testing_dir}/matshow3d_test.png", tempimg, 5e-2
          )
          self.assertIsNone(
              comp, f"value of comp={comp}"
          )  # None indicates test passed
  
      _, axes = pyplot.subplots()
      matshow3d(
          ims[keys],
          fig=axes,
          figsize=(2, 2),
          frames_per_row=5,
          every_n=2,
          frame_dim=-1,
          show=False,
      )
  
file_path: MONAI/tests/test_matshow3d.py
imports: from __future__ import annotations
  import os
  import tempfile
  import unittest
  import numpy
  from monai.transforms import Compose, EnsureChannelFirstd, LoadImaged, RandSpatialCropSamplesd, RepeatChanneld, ScaleIntensityd
  from monai.utils import optional_import
  from monai.visualize.utils import matshow3d
  from tests.utils import SkipIfNoModule
label_desc: Use image node_id 1 for calling the TestMatshow3d obj's underlying member method code with example usage: obj.test_3d() without return types