An apparatus, comprising: a probe having a plurality ofelectrodes and adapted for insertion into a heart of a living subject; and a processor, which is configured to receive an electrical signal from the electrodes, and to receive an acquired image of the heart and to perform the steps of: constructing a position map of the electrodes, the position map having mapped points and simulating a 3-dimensional surface of the heart; placing the position map in registration with the acquired image of the heart; constructing, based on the position map, a mesh that models the 3-dimensional surface of the heart, the mesh having vertices; and adjusting positions of the vertices (154, 156, 158) relative to the mapped points (160, 162, 164, 166) to improve a registration of the mesh with the acquired image of the heart; wherein adjusting positions of the vertices comprises the steps of: identifying all vertices of the mesh that are within a predetermined distance from a selected mapped point; calculating respective weight factors based on distances between the identified vertices and the selected mapped point; calculating new positions for the identified vertices comprising a shift toward the selected mapped point according to the respective weight factors; and defining a new mesh based on the new positions. a probe having a plurality ofelectrodes and adapted for insertion into a heart of a living subject; and a processor, which is configured to receive an electrical signal from the electrodes, and to receive an acquired image of the heart and to perform the steps of: constructing a position map of the electrodes, the position map having mapped points and simulating a 3-dimensional surface of the heart; placing the position map in registration with the acquired image of the heart; constructing, based on the position map, a mesh that models the 3-dimensional surface of the heart, the mesh having vertices; and adjusting positions of the vertices (154, 156, 158) relative to the mapped points (160, 162, 164, 166) to improve a registration of the mesh with the acquired image of the heart; wherein adjusting positions of the vertices comprises the steps of: identifying all vertices of the mesh that are within a predetermined distance from a selected mapped point; calculating respective weight factors based on distances between the identified vertices and the selected mapped point; calculating new positions for the identified vertices comprising a shift toward the selected mapped point according to the respective weight factors; and defining a new mesh based on the new positions. constructing a position map of the electrodes, the position map having mapped points and simulating a 3-dimensional surface of the heart; placing the position map in registration with the acquired image of the heart; constructing, based on the position map, a mesh that models the 3-dimensional surface of the heart, the mesh having vertices; and adjusting positions of the vertices (154, 156, 158) relative to the mapped points (160, 162, 164, 166) to improve a registration of the mesh with the acquired image of the heart; wherein adjusting positions of the vertices comprises the steps of: identifying all vertices of the mesh that are within a predetermined distance from a selected mapped point; calculating respective weight factors based on distances between the identified vertices and the selected mapped point; calculating new positions for the identified vertices comprising a shift toward the selected mapped point according to the respective weight factors; and defining a new mesh based on the new positions. identifying all vertices of the mesh that are within a predetermined distance from a selected mapped point; calculating respective weight factors based on distances between the identified vertices and the selected mapped point; calculating new positions for the identified vertices comprising a shift toward the selected mapped point according to the respective weight factors; and defining a new mesh based on the new positions.