code: def test_z_score_opposite_contrast(rng):
      fmri, mask = generate_fake_fmri(
          shape=(50, 20, 50), length=96, random_state=rng
      )
  
      nifti_masker = NiftiMasker(mask_img=mask)
      data = nifti_masker.fit_transform(fmri)
  
      frametimes = np.linspace(0, (96 - 1) * 2, 96)
  
      for i in [0, 20]:
          design_matrix = make_first_level_design_matrix(
              frametimes,
              hrf_model="spm",
              add_regs=np.array(data[:, i]).reshape(-1, 1),
          )
          c1 = np.array([1] + [0] * (design_matrix.shape[1] - 1))
          c2 = np.array([0] + [1] + [0] * (design_matrix.shape[1] - 2))
          contrasts = {
              "seed1 - seed2": c1 - c2,
              "seed2 - seed1": c2 - c1,
          }
          fmri_glm = FirstLevelModel(
              t_r=2.0,
              noise_model="ar1",
              standardize=False,
              hrf_model="spm",
              drift_model="cosine",
          )
          fmri_glm.fit(fmri, design_matrices=design_matrix)
          z_map_seed1_vs_seed2 = fmri_glm.compute_contrast(
              contrasts["seed1 - seed2"], output_type="z_score"
          )
          z_map_seed2_vs_seed1 = fmri_glm.compute_contrast(
              contrasts["seed2 - seed1"], output_type="z_score"
          )
  
          assert_almost_equal(
              z_map_seed1_vs_seed2.get_fdata(dtype="float32").min(),
              -z_map_seed2_vs_seed1.get_fdata(dtype="float32").max(),
              decimal=10,
          )
          assert_almost_equal(
              z_map_seed1_vs_seed2.get_fdata(dtype="float32").max(),
              -z_map_seed2_vs_seed1.get_fdata(dtype="float32").min(),
              decimal=10,
          )
  
imports: import numpy
  import pytest
  import scipy.linalg
  import scipy.stats
  from numpy.testing import assert_almost_equal, assert_array_almost_equal, assert_array_equal
  from scipy.stats import norm
  from nilearn._utils.data_gen import generate_fake_fmri
  from nilearn.glm._utils import full_rank, multiple_fast_inverse, multiple_mahalanobis, pad_contrast, positive_reciprocal, z_score
  from nilearn.glm.first_level import FirstLevelModel, make_first_level_design_matrix
  from nilearn.maskers import NiftiMasker
label_desc: Use image node_id 4 for calling a global function with example usage: test_z_score_opposite_contrast(rng) without return types