1. A method for generating a PET or SPECT image dataset for an at least partially moving examination object, the method comprising: acquiring a plurality of PET or SPECT measurement signals from an examination region; acquiring a plurality of anatomy image datasets that show the examination region using a second imaging modality at the same time as acquiring the PET or SPECT measurement signals; at least one of determining similarity between a reference anatomy image dataset acquired at a time point t′ using the second imaging modality and at least one anatomy image dataset acquired at a different time point, and determining a temporal weighting function; and generating the PET or SPECT image dataset taking into account at least one of the determined similarity of the anatomy image datasets and temporal weighting of the PET measurement signals using the determined temporal weighting function.