code: def test_matrix_orientation():
      """Test if processing is performed along the correct axis."""
      # the "step" kind generate heavyside-like signals for each voxel.
      # all signals being identical, standardizing along the wrong axis
      # would leave a null signal. Along the correct axis, the step remains.
      fmri, mask = data_gen.generate_fake_fmri(
          shape=(40, 41, 42), kind="step"
      )
      masker = NiftiMasker(
          mask_img=mask, standardize=True, detrend=True
      )
      timeseries = masker.fit_transform(fmri)
      assert timeseries.shape[0] == fmri.shape[3]
      assert timeseries.shape[1] == get_data(mask).sum()
      std = timeseries.std(axis=0)
      assert std.shape[0] == timeseries.shape[1]  # paranoid
      assert not np.any(std < 0.1)
  
      # Test inverse transform
      masker = NiftiMasker(
          mask_img=mask, standardize=False, detrend=False
      )
      masker.fit()
      timeseries = masker.transform(fmri)
      recovered = masker.inverse_transform(timeseries)
      np.testing.assert_array_almost_equal(
          get_data(recovered), get_data(fmri)
      )
  
imports: import os
  import shutil
  import warnings
  from tempfile import mkdtemp
  import nibabel
  import numpy
  import pytest
  from numpy.testing import assert_array_equal
  from nilearn._utils import data_gen, exceptions, testing
  from nilearn._utils.class_inspect import get_params
  from nilearn.image import get_data, index_img
  from nilearn.maskers import NiftiMasker
  from nilearn.maskers.nifti_masker import _filter_and_mask
label_desc: Use image node_id 9 for calling a global function with example usage: test_matrix_orientation() without return types