code: def test_write(in_tmp_path):
      fname = "myfile.nii"
      img = load_image(funcfile)
      save_image(img, fname)
      test = FmriImageList.from_image(load_image(fname))
      assert test[0].affine.shape == (4, 4)
      assert img[0].affine.shape == (5, 4)
      # Check the affine...
      A = np.identity(4)
      A[:3, :3] = img[:, :, :, 0].affine[:3, :3]
      A[:3, -1] = img[:, :, :, 0].affine[:3, -1]
      assert np.allclose(test[0].affine, A)
      del test
  
file_path: nipy/nipy/modalities/fmri/tests/test_fmri.py
imports: import gc
  import numpy
  import pytest
  from nipy.core.api import AffineTransform
  from nipy.core.api import Image, parcels
  from nipy.io.api import load_image, save_image
  from nipy.modalities.fmri.api import FmriImageList, axis0_generator
  from nipy.testing import funcfile
label_desc: Use image node_id 1 for calling a global function with example usage: test_write(in_tmp_path) without return types