A localization system comprising: a medical device having a proximal end and a distal end, wherein the distal end includes at least a first localization sensor and an optical sensor, wherein the first localization sensor and the optical sensor are rigidly affixed within the distal end of the medical device; and a computer system configured for: receiving feedback from a first localization sensor; receiving optical feedback from an optical sensor; calculating a position of the first localization sensor based on the received feedback, wherein the position is provided with respect to a first magnetic reference frame defined by the first localization sensor; calculating a shape of the optical sensor based on the optical feedback from the optical sensor, wherein the shape is provided with respect to a second optical reference frame defined with respect to the optical sensor; recording first magnetic position data provided by the first localization sensor and first optical data provided by the optical sensor; storing the recorded data as a first fiducial pair, wherein the first magnetic position data is provided in the magnetic reference frame and the first optical data is provided in the optical reference frame; placing the distal end of the medical device in a second position, wherein the second position causes a deflection of the optical sensor; recording second magnetic position data provided by the first localization sensor and second optical data provided by the optical sensor and storing the recorded data as a second fiducial pair; calculating a transformation based on the first and second fiducial pairs to transform the optical shape data form the second optical reference frame to the first magnetic reference frame for transforming the shape of the optical sensor from the second optical reference frame to the first magnetic reference frame; and displaying the position and shape of the medical device with respect to the first magnetic reference frame. a medical device having a proximal end and a distal end, wherein the distal end includes at least a first localization sensor and an optical sensor, wherein the first localization sensor and the optical sensor are rigidly affixed within the distal end of the medical device; and a computer system configured for: receiving feedback from a first localization sensor; receiving optical feedback from an optical sensor; calculating a position of the first localization sensor based on the received feedback, wherein the position is provided with respect to a first magnetic reference frame defined by the first localization sensor; calculating a shape of the optical sensor based on the optical feedback from the optical sensor, wherein the shape is provided with respect to a second optical reference frame defined with respect to the optical sensor; recording first magnetic position data provided by the first localization sensor and first optical data provided by the optical sensor; storing the recorded data as a first fiducial pair, wherein the first magnetic position data is provided in the magnetic reference frame and the first optical data is provided in the optical reference frame; placing the distal end of the medical device in a second position, wherein the second position causes a deflection of the optical sensor; recording second magnetic position data provided by the first localization sensor and second optical data provided by the optical sensor and storing the recorded data as a second fiducial pair; calculating a transformation based on the first and second fiducial pairs to transform the optical shape data form the second optical reference frame to the first magnetic reference frame for transforming the shape of the optical sensor from the second optical reference frame to the first magnetic reference frame; and displaying the position and shape of the medical device with respect to the first magnetic reference frame. receiving feedback from a first localization sensor; receiving optical feedback from an optical sensor; calculating a position of the first localization sensor based on the received feedback, wherein the position is provided with respect to a first magnetic reference frame defined by the first localization sensor; calculating a shape of the optical sensor based on the optical feedback from the optical sensor, wherein the shape is provided with respect to a second optical reference frame defined with respect to the optical sensor; recording first magnetic position data provided by the first localization sensor and first optical data provided by the optical sensor; storing the recorded data as a first fiducial pair, wherein the first magnetic position data is provided in the magnetic reference frame and the first optical data is provided in the optical reference frame; placing the distal end of the medical device in a second position, wherein the second position causes a deflection of the optical sensor; recording second magnetic position data provided by the first localization sensor and second optical data provided by the optical sensor and storing the recorded data as a second fiducial pair; calculating a transformation based on the first and second fiducial pairs to transform the optical shape data form the second optical reference frame to the first magnetic reference frame for transforming the shape of the optical sensor from the second optical reference frame to the first magnetic reference frame; and displaying the position and shape of the medical device with respect to the first magnetic reference frame.