Real-Time Pose Detection for Magnetic Medical Devices