A method for reconstructing line current sources from magnetic field data