A method for determining a shape of a catheter (40A, 101), the method comprising: receiving a plurality of raw impedance measurements from a plurality of electrodes (46, 102) disposed on a flexible tip portion (44A, 110) of the catheter (40A, 101); receiving a magnetic position and orientation measurement from a magnetic position sensor (56, 116) disposed on a shaft of the catheter (40A, 101); determining a relationship between each of the plurality of electrodes (46, 102) disposed on the flexible tip portion (44A, 110) of the catheter (40A, 101), based on the raw impedance measurements received from the plurality of electrodes (46, 102); predicting a shape of the flexible tip portion (44A, 110) of the catheter (40A, 101), based on the determined relationship between each of the plurality of electrodes (46, 102) disposed on the flexible tip portion (44A, 110) of the catheter (40A, 101); determining a shape of the catheter; characterized in that determining the relationship between each of the plurality of electrodes (46, 102) includes determining an angle between at least three electrodes, and predicting the shape of the flexible tip portion (44A, 110) of the catheter (40A, 101) is based on the determined angles between the at least three electrodes in relation to a shape model of the flexible tip portion (44A, 110), and in that determining a shape of the catheter (40A, 101) includes shifting the shape of the flexible tip portion (44A, 110) of the catheter (40A, 101) in relation to the shaft of the catheter (40A, 101) based on the magnetic position and orientation measurement received from the magnetic position sensor (56, 116). receiving a plurality of raw impedance measurements from a plurality of electrodes (46, 102) disposed on a flexible tip portion (44A, 110) of the catheter (40A, 101); receiving a magnetic position and orientation measurement from a magnetic position sensor (56, 116) disposed on a shaft of the catheter (40A, 101); determining a relationship between each of the plurality of electrodes (46, 102) disposed on the flexible tip portion (44A, 110) of the catheter (40A, 101), based on the raw impedance measurements received from the plurality of electrodes (46, 102); predicting a shape of the flexible tip portion (44A, 110) of the catheter (40A, 101), based on the determined relationship between each of the plurality of electrodes (46, 102) disposed on the flexible tip portion (44A, 110) of the catheter (40A, 101); determining a shape of the catheter; characterized in that determining the relationship between each of the plurality of electrodes (46, 102) includes determining an angle between at least three electrodes, and predicting the shape of the flexible tip portion (44A, 110) of the catheter (40A, 101) is based on the determined angles between the at least three electrodes in relation to a shape model of the flexible tip portion (44A, 110), and in that determining a shape of the catheter (40A, 101) includes shifting the shape of the flexible tip portion (44A, 110) of the catheter (40A, 101) in relation to the shaft of the catheter (40A, 101) based on the magnetic position and orientation measurement received from the magnetic position sensor (56, 116).