In this paper, we present a novel registration algorithm for locally affine registrations. This method preserves the anatomical and intensity class relationships between the local regions. A regularisation procedure is used to maintain a global diffeomorphic transformation. Combined with a novel generic method for accurately inverting the final deformation field, we include our techniques within an atlas-based segmentation propagation framework. We applied our method to automatically segment the whole heart from cardiac magnetic resonance images from a cohort of 18 volunteers (acquisition resolution 2 x 2 x 2 mm). The results show that the proposed method provides a robust initialisation for the atlas-based segmentation propagation framework refined with a fluid registration. We validated our approach against other registration strategies, and demonstrated that we improved the accuracy of the whole heart segmentations (1.8 +/- 0.42 mm).