code: def reconstruct(time_series, images, axis=0):
      # Reconstruct data from remaining components
      n_tps = time_series.shape[0]
      images = np.rollaxis(images, axis)
      ncomps = images.shape[0]
      img_size = np.prod(images.shape[1:])
      rarr = images.reshape((ncomps, img_size))
      recond = np.dot(time_series, rarr)
      recond = recond.reshape((n_tps,) + images.shape[1:])
      if axis < 0:
          axis = axis + images.ndim
      recond = np.rollaxis(recond, 0, axis + 1)
      return recond
  
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 2 for calling a global function with example usage: reconstruct(time_series, images, axis) and returns: recond