A method of determining the position and orientation of an invasive medical device is described using altered devices and a machine learning algorithm for detecting the position and orientation of such devices from imagery. Such predictions can subsequently be displayed to an operator to improve the speed and accuracy by which they perform procedures.