A medical system comprising: a memory storing information of a plurality of computer models of an anatomical structure, wherein each of the plurality of computer models corresponds to a different point in time over a period of motion of the anatomical structure; a medical device having a plurality of sensors (1310a-1310k) distributed along a length of the medical device; an image capturing device for capturing images from a perspective of a pose of a distal end of the medical device; and a processor programmed to: perform a global registration of the plurality of computer models to the medical device by: determining a pose and shape of the medical device while disposed in a passage of the anatomical structure by using information provided by the plurality of sensors (1310a-1310k) at the same point in time, and matching at least the determined shape of the medical device to a best fitting one of shapes of one or more potential passages in the plurality of computer models of the anatomical structure; and perform a local registration of the plurality of computer models to the medical device by: comparing an image captured by the image capturing device to a plurality of virtual views of the computer model of the anatomical structure, wherein the plurality of virtual views is generated from the perspective of a virtual camera whose pose is initially set at the pose of the distal end of the medical device and then perturbed about the initial pose, and wherein the pose of the distal end of the medical device is determined according to the global registration of the plurality of computer models to the medical device. a memory storing information of a plurality of computer models of an anatomical structure, wherein each of the plurality of computer models corresponds to a different point in time over a period of motion of the anatomical structure; a medical device having a plurality of sensors (1310a-1310k) distributed along a length of the medical device; an image capturing device for capturing images from a perspective of a pose of a distal end of the medical device; and a processor programmed to: perform a global registration of the plurality of computer models to the medical device by: determining a pose and shape of the medical device while disposed in a passage of the anatomical structure by using information provided by the plurality of sensors (1310a-1310k) at the same point in time, and matching at least the determined shape of the medical device to a best fitting one of shapes of one or more potential passages in the plurality of computer models of the anatomical structure; and determining a pose and shape of the medical device while disposed in a passage of the anatomical structure by using information provided by the plurality of sensors (1310a-1310k) at the same point in time, and matching at least the determined shape of the medical device to a best fitting one of shapes of one or more potential passages in the plurality of computer models of the anatomical structure; and perform a local registration of the plurality of computer models to the medical device by: comparing an image captured by the image capturing device to a plurality of virtual views of the computer model of the anatomical structure, wherein the plurality of virtual views is generated from the perspective of a virtual camera whose pose is initially set at the pose of the distal end of the medical device and then perturbed about the initial pose, and wherein the pose of the distal end of the medical device is determined according to the global registration of the plurality of computer models to the medical device. comparing an image captured by the image capturing device to a plurality of virtual views of the computer model of the anatomical structure, wherein the plurality of virtual views is generated from the perspective of a virtual camera whose pose is initially set at the pose of the distal end of the medical device and then perturbed about the initial pose, and wherein the pose of the distal end of the medical device is determined according to the global registration of the plurality of computer models to the medical device.