Mismatches between PET and CT datasets due to respiratory effects can lead to artefactual perfusion defects. To overcome this, we have proposed a method of aligning a single CT with each frame of a gated PET study in a semi-automatic manner, incorporating a statistical shape model of the diaphragm and a rigid registration of the heart. This ensures that the structures that could influence the appearance of the reconstructed cardiac activity are correctly matched between emission and transmission datasets. When tested on two patient studies, it was found in both cases that attenuation correction using the proposed technique resulted in PET images that were closer to the gold standard of attenuation correction with a gated CT, compared with scenarios where only heart matching was considered (and not the diaphragm) or where no transformation was performed (i.e. where a single CT frame was used to attenuation-correct all PET frames). These preliminary results suggest that diaphragm matching between PET and CT improves the quantitative accuracy of reconstructed PET images and that the proposed method of using a statistical shape model to describe the diaphragm shape and motion, in combination with a rigid registration to determine respiratory-induced heart motion, is a feasible method of achieving this.