code: def test_mask_match(data_dict):
      # we can't do PCA over spatial axes if we use a spatial mask
      ncomp = 5
      out_coords = data_dict["mask"].reference.coord_names
      for i, o, n in zip("ijk", out_coords, [0, 1, 2]):
          pytest.raises(
              ValueError,
              pca_image,
              data_dict["fmridata"],
              i,
              data_dict["mask"],
              ncomp,
          )
          pytest.raises(
              ValueError,
              pca_image,
              data_dict["fmridata"],
              o,
              data_dict["mask"],
              ncomp,
          )
          pytest.raises(
              ValueError,
              pca_image,
              data_dict["fmridata"],
              n,
              data_dict["mask"],
              ncomp,
          )
  
imports: import numpy
  import pytest
  from nibabel.affines import from_matvec
  from numpy.testing import assert_almost_equal, assert_array_equal
  from ....core.api import AffineTransform, Image
  from ....core.api import CoordinateSystem
  from ....core.image.image import rollimg
  from ....core.reference.coordinate_map import AxisError, drop_io_dim
  from ....core.reference.coordinate_map import product
  from ....io.api import load_image
  from ....testing import funcfile
  from ..pca import pca
  from ..pca import pca_image
  from .test_pca import res2pos1
label_desc: Use image node_id 4 for calling a global function with example usage: test_mask_match(data_dict) without return types