The paper presents a novel elastic image-matching algorithm, which is capable of treating some preselected parts of an image as rigid objects, while remainder of the image can be elastically deformed. The proposed method uses a spring-mass system to model deformations caused by displacement of the rigid objects and/or preselected feature landmarks. The proposed method gives more control over deformations comparing to the methods using purely interpolation of sparse points techniques (e.g. radial basis function), but is not as computationally demanding or difficult to used as the methods based on an accurate physical modeling of the deformable structures. The performance of the proposed elastic warping of the image with the embedded rigid structures is shown using simulated data, and is validated using a pair of real computed tomography (CT) images. The objective measures as well as images enabling subjective evaluation of the new technique are provided.