1. A method for magnetic imaging of an object, the method comprising: monitoring a magnetic field of sources in the object at a plurality of magnetic detectors to obtain a corresponding plurality of sensor outputs; while monitoring the magnetic field of the sources, monitoring a position of the object; modeling the magnetic field of the sources in the object as a gradient of a scalar potential, the scalar potential comprising a sum of spherical harmonic functions each multiplied by a corresponding coefficient; and, compensating for changes in the position of the object by applying a transformation to the plurality of sensor outputs, the transformation including, at least in part, a spherical harmonic translation transformation.