code: def test_input_effects(data):
      # Test effects of axis specifications
      ntotal = data["nimages"] - 1
      # return full rank - mean PCA over last axis
      p = pos1pca(data["fmridata"], -1)
      assert p["basis_vectors"].shape == (data["nimages"], ntotal)
      assert p["basis_projections"].shape == data["mask"].shape + (
          ntotal,
      )
      assert p["pcnt_var"].shape == (ntotal,)
      # Reconstructed data lacks only mean
      rarr = reconstruct(p["basis_vectors"], p["basis_projections"], -1)
      rarr = rarr + data["fmridata"].mean(-1)[..., None]
      # same effect if over axis 0, which is the default
      arr = data["fmridata"]
      arr = np.rollaxis(arr, -1)
      # Same basis once we've normalized the signs
      pr = pos1pca(arr)
      out_arr = np.rollaxis(pr["basis_projections"], 0, 4)
      assert_almost_equal(out_arr, p["basis_projections"])
      assert_almost_equal(p["basis_vectors"], pr["basis_vectors"])
      assert_almost_equal(p["pcnt_var"], pr["pcnt_var"])
      # Check axis None raises error
      pytest.raises(ValueError, pca, data["fmridata"], None)
  
imports: import numpy
  import pytest
  from nipy.io.api import load_image
  from nipy.testing import assert_almost_equal, assert_array_almost_equal, funcfile
  from ..pca import pca
label_desc: Use image node_id 8 for calling a global function with example usage: test_input_effects(data) without return types