code: def test_compute_mask_sessions(in_tmp_path):
      """Test that the mask computes well on multiple sessions"""
      # Make a 4D file from the anatomical example
      img = nib.load(anatfile)
      arr = img.get_fdata()
      a2 = np.zeros(arr.shape + (2,))
      a2[:, :, :, 0] = arr
      a2[:, :, :, 1] = arr
      img = nib.Nifti1Image(a2, np.eye(4))
      a_fname = "fourd_anat.nii"
      nib.save(img, a_fname)
      a3 = a2.copy()
      a3[:10, :10, :10] = 0
      img2 = nib.Nifti1Image(a3, np.eye(4))
      # check 4D mask
      msk1 = nnm.compute_mask_sessions([img2, img2])
      msk2 = nnm.compute_mask_sessions([img2, a_fname])
      assert_array_equal(msk1, msk2)
      msk3 = nnm.compute_mask_sessions([img2, a_fname], threshold=0.9)
      msk4 = nnm.compute_mask_sessions([img2, a_fname], threshold=0)
      msk5 = nnm.compute_mask_sessions([a_fname, a_fname])
      assert_array_equal(msk1, msk3)
      assert_array_equal(msk4, msk5)
  
file_path: nipy/nipy/labs/tests/test_mask.py
imports: import nibabel
  import numpy
  from nipy.testing import anatfile, assert_array_equal
  from ..None import mask
  from ..mask import largest_cc, series_from_mask, threshold_connect_components
label_desc: Use image node_id 6 for calling a global function with example usage: test_compute_mask_sessions(in_tmp_path) without return types