A Magnetic Particle Imaging (MPI) system with a magnet configured to generate a magnetic field having a field free line, the system including at least one shim magnet configured to modify the magnetic field in a manner to maintain desired magnetic flux distributions during imaging.