In this study, we propose an automatic method to extract the heart volume from the cardiac positron emission tomography (PET) transmission images. The method combines the automatic 3D segmentation of the transmission image using Markov random fields (MRFs) to surface extraction using deformable models. Deformable models were automatically initialized using the MRFs segmentation result. The extraction of the heart region is needed e.g. in independent component analysis (ICA). The volume of the heart can be used to mask the emission image corresponding to the transmission image, so that only the cardiac region is used for the analysis. The masking restricts the number of independent components and reduces the computation time. In addition, the MRF segmentation result could be used for attenuation correction. The method was tested with 25 patient images. The MRF segmentation results were of good quality in all cases and we were able to extract the heart volume from all the images.