A system for local metal distortion correction for using an accurate electromagnetic tracking system in a medical environment comprises an electromagnetic field generator monitoring a medical device having a suitable sensor coil. A correction function, derived from an error correction tool, is applied to the position and orientation readings of the sensor coil. The error correction tool comprises a number of electromagnetic sensors arranged in a fixed and known geometric configuration and is placed surrounding the site of the medical procedure. Sensor data is displayed on an imaging system. In addition, a distortion mapping can be done utilizing optical sensors for relative positioning readings along with an electromagnetic tracking system sensor.