MR-based cardiac and respiratory motion correction of PET: application to static and dynamic cardiac 18F-FDG imaging