Myocardial perfusion imaging (MPI) using slow rotating large field of view cameras requires spatiotemporal reconstruction of dynamically acquired data to capture the time variation of the radiotracer concentration. In vivo, MPI contains additional degrees of freedom involving unavoidable motion of the heart due to quasiperiodic beating and the effects of respiration, which can severely degrade the quality of the images. This work develops a technique for a single photon emission computed tomography (SPECT) that reconstructs the distribution of the radiotracer concentration in the myocardium using a tensor product of different sets of basis functions that approximately describe the spatiotemporal variation of the radiotracer concentration and the motion of the heart. In this study the temporal B-spline basis functions are chosen to reflect the dynamics of the radiotracer, while the intrinsic deformation and the extrinsic motion of the heart are described by a product of a discrete set of Gaussian basis functions. Reconstruction results are presented showing the dynamics of the tracer in the myocardium as it deforms due to cardiac beating, and is displaced due to respiratory motion. These results are compared with the conventional 4D-spatiotemporal reconstruction method that models only the temporal changes of the tracer activity. The higher dimensional reconstruction method proposed here improves bias, yet the signal-to-noise ratio (SNR) decreases slightly due to redistribution of the counts over the cardiac-respiratory gates. Additionally, there is a trade-off between the number of gates and the number of projections per gate to achieve high contrast images.