A method for registering a flexible medical device disposed within a passage in an anatomical structure of a patient to a four-dimensional computer model of the anatomical structure, wherein the flexible medical device has a plurality of sensors distributed along the length of the flexible medical device, wherein the four-dimensional computer model includes information of a plurality of three-dimensional computer models of the anatomical structure, wherein each of the plurality of three-dimensional computer models is for a different point in time than others of the plurality of three-dimensional computer models so that the fourth dimension is time, wherein the plurality of three-dimensional computer models indicate movement of the anatomical structure, wherein each of the plurality of three-dimensional computer models defines a plurality of passages, and wherein each of the plurality of passages has a shape, the method comprising:
- determining a current pose and shape of the flexible medical device using information provided by the plurality of sensors at the same point in time;
- registering the flexible medical device to the four-dimensional computer model of the anatomical structure by matching at least the determined shape of the flexible medical device to a best fitting one of the shapes of potential passages in the four-dimensional computer model.