code: def check_stc(
      true_signal, corrected_signal, ref_slice=0, rtol=1e-5, atol=1e-5
  ):
      n_slices = true_signal.shape[2]
      # The reference slice should be more or less perfect
      assert_almost_equal(
          corrected_signal[..., ref_slice, :],
          true_signal[..., ref_slice, :],
      )
      # The other slices should be more or less right
      for sno in range(n_slices):
          if sno == ref_slice:
              continue  # We checked this one
          arr0 = true_signal[..., sno, 1:-1]
          arr1 = corrected_signal[..., sno, 1:-1]
          # Intermediate test matrices for debugging
          abs_diff = np.abs(arr0 - arr1)
          rel_diff = np.abs((arr0 / arr1) - 1)
          abs_fails = abs_diff > atol
          rel_fails = rel_diff > rtol
          fails = abs_fails & rel_fails
          abs_only = abs_diff[fails]
          rel_only = rel_diff[fails]
          assert np.allclose(arr0, arr1, rtol=rtol, atol=atol)
  
imports: import numpy
  from numpy.testing import assert_almost_equal, assert_array_equal
  from scipy.ndimage import gaussian_filter, gaussian_filter1d
  from nipy.core.api import Image, vox2scanner
  from ..groupwise_registration import SpaceTimeRealign
label_desc: Use image node_id 1 for calling a global function with example usage: check_stc(true_signal, corrected_signal, ref_slice, rtol, atol) without return types