1. A computer program product comprising at least one computer-readable medium storing one or more sequences of instructions, wherein execution of the one or more sequences of instructions by one or more processors causes the one or more processors to execute a computer-implemented method for reconstructing electrical current distribution of a portion of a body, the method comprising: [a] representing the portion of the body as a set of electrical current dipoles within a bounding region, each electrical current dipole having a defined position within the bounding region; [b] representing a magnetic field in a sensor array as a set of nonlinear equations of the magnitude and orientation of the set of electrical current dipoles and an offset of the sensor array relative to the bounding region; [c] setting a value for the offset; [d] representing the magnetic field in the sensor array as a set of linear equations of the magnitude and orientation of the set of electrical current dipoles and the value for the offset; [e] solving the set of linear equations to obtain the magnitude and orientation of the set of electrical current dipoles; [f] inputting into the set of nonlinear equations the magnitude and orientation of the set of electrical current dipoles obtained from solving the set of linear equations and solving the set of nonlinear equations to obtain an updated offset; and [g] responsive to a stop condition not being met, using the updated offset as the value for the offset and returning to step [d].