Perturbations in a static magnetic field of magnetic resonance imaging
apparatus are compensated by creating magnetic fields near an object
creating the perturbations with the magnetic fields adjusted to offset the
perturbations in the static magnetic field. In an embodiment where the
perturbations are caused by an x-ray detector in a combined modality
imaging apparatus, the coils are positioned to surround the x-ray detector
and create magnetic fields in the static magnetic field outside of the
detector which compensate for the perturbations caused by the x-ray
detector.