Shimming with permanent magnets for the x-ray detector in a hybrid x-ray/
Departments of Radiology and Physics, Stanford University, Stanford, California 94305
Rebecca Fahrig and Scott T. Williamsb?
Department of Radiology, Stanford University, Stanford, California 94305
Norbert J. Pelc
Departments of Radiology and Bioengineering, Stanford University, Stanford, California 94305
?Received 16 November 2007; revised 9 June 2008; accepted for publication 2 July 2008;
published 7 August 2008?
In this x-ray/MR hybrid system an x-ray flat panel detector is placed under the patient cradle, close
to the MR volume of interest ?VOI?, where the magnetic field strength is ?0.5 T. Immersed in this
strong field, several electronic components inside the detector become magnetized and create an
additional magnetic field that is superimposed on the original field of the MR scanner. Even after
linear shimming, the field homogeneity of the MR scanner remains disrupted by the detector. The
authors characterize the field due to the detector with the field of two magnetic dipoles and further
show that two sets of permanent magnets ?NdFeB? can withstand the main magnetic field and
compensate for the nonlinear components of the additional field. The ideal number of magnets and
their locations are calculated based on a field map measured with the detector in place. Experimen-
tal results demonstrate great promise for this technique, which may be useful in many settings
where devices with magnetic components need to be placed inside or close to an MR
scanner. © 2008 American Association of Physicists in Medicine. ?DOI: 10.1118/1.2963994?
Key words: XMR hybrid system, magnetic field shimming, permanent magnet
Our hybrid system provides the synergic image guidance of
two powerful imaging modalities, x-ray fluoroscopy and
magnetic resonance imaging ?MRI?.1–3Clinical trials have
shown that the hybrid x-ray/MR system can greatly benefit a
number of interventional procedures.4,5In our system, an
x-ray tube and a flat panel detector were placed inside the
magnetic field of an open-bore MR system. Effects of the
magnetic field on the x-ray tube have been studied and pos-
sible solutions proposed.6–8The x-ray detector, being close
to the MR imaging volume under the patient cradle, experi-
ences a magnetic field approximately equal to the system
field strength of 0.5 T. The effect of the magnetic field on the
performance of the x-ray detector was evaluated and no ap-
preciable image degradation was observed.9However, the
effect of the detector on the MR system has not heretofore
been fully explored. The detector can affect the MR system if
it has magnetic components. When placed in the main mag-
netic field, these components can be magnetized and degrade
the homogeneity of the magnetic field of the MR scanner. In
order to make the detector MR compatible, we have tried our
best to replace magnetic components with nonmagnetic sub-
stitutes. Nonetheless, it is difficult to make the detector com-
pletely nonmagnetic and thus the residual field from the de-
tector can still degrade the field homogeneity of the MR
Our MR scanner is able to produce a linear “shim” field to
make the main field more homogenous, i.e., a gradient field
to compensate for the linear spatial components of the inho-
mogeneous field in the imaging volume. Due to the proxim-
ity of the detector to the MR imaging volume, however, the
detector produces a field that contains considerable nonlinear
spatial components. As a result, even after linear shimming
the MR image quality with the detector in position still suf-
fers, especially with the steady-state free precession ?SSFP?
imaging that is frequently used in our interventional
procedures.10,11Our system does not have resistive higher
order shim coils12,13and the superconductive higher-order
shims cannot be easily adjusted. Even if high-order shim-
ming coils could be used, they are designed to produce fields
with spatial variation comparable to the bore size and may
not be an optimal choice for the effects of the x-ray detector.
Passive shimming can also provide nonlinear field compo-
nents to improve the system field homogeneity by strategi-
cally placing pieces of ferromagnetic material in the
magnet.14,15The sizes and locations of the ferromagnetic ma-
terial need to be carefully calibrated. Since our x-ray detector
is not permanently mounted in the MR system, it would be
difficult to remove and replace the passive shimming accord-
ing to the presence of the detector. Therefore, a more conve-
nient and efficient method is very desirable.
Local shimming could be implemented with electric coils
that can be tailored to specific situations. This active shim-
ming scheme is especially well-suited in situations where the
field inhomogeneity is slight and the imaging volume is lo-
calized, e.g., in fMRI studies.16For interventional proce-
dures, on the other hand, the imaging volume can be large
and the deleterious field created by the magnetic material in
38953895Med. Phys. 35 „9…, September 20080094-2405/2008/35„9…/3895/8/$23.00© 2008 Am. Assoc. Phys. Med.
the x-ray detector can be strong. Preliminary studies showed
that for our applications the shimming coils would require
very high power to be effective. Further, problems such as
heat dissipation could also arise.
Based on the origin of the detector’s field, we hypoth-
esized that shimming with permanent magnets would be able
to counteract the detector induced field. If the magnetic com-
ponents inside the detector are distributed in small clusters,
the field from each cluster can be well approximated by the
field of a magnetic dipole near the cluster pointing in the
direction of the external field. In reality, the dipole field can
be approximated with the field of a small permanent magnet.
If the intrinsic coercivity of the magnet is sufficiently large,
reversing the poles of the magnet in space will not change its
magnetization or its magnetic field.17As a result, the undes-
ired magnetic field from the detector could be largely can-
celed by suitably selected and placed permanent magnets ori-
ented in the direction opposite to the external magnetic field.
The process to optimize the locations and strengths of the
shim magnets is illustrated in the flowchart shown in Fig. 1.
We first measured the baseline field ?Bbase? without the de-
tector, and then we measured the field with the detector in
place ?Bbase+det?, which is the sum of the baseline field and
the net field due to the detector ?Bdet?. Considering the linear
shimming of the scanner, we focused on the higher-order
terms by numerically removing the offset and linear ?x,y,z?
components of the field. We hypothesized that the magnetic
components in the detector can be grouped into a few clus-
ters, and the field produced by each cluster can be approxi-
mated with a dipole field. In other words, the field due to the
detector Bdetcan be modeled with the field of a few dipoles.
As the ultimate goal is to reduce the inhomogeneity of
Bbase+det, this measured field was fitted with the field of a
number of dipoles. The fitting result dipolestarwas the tar-
geted dipoles and they were used to guide the selection and
placement of the shim magnets. The field with the shim mag-
nets ?Bbase+mags? was measured, and the net field due to the
magnets ?Bmags=Bbase+mags−Bbase? was fitted with the field of
the same number of dipoles. The fitting result dipolesmags
was compared with dipolestarin order to adjust the locations
and quantities of the shim magnets. Iterations of adjustment
of the magnets were performed until there was no significant
difference in shimming performance between dipolestarand
dipolesmags. Finally, the detector with shimming magnets was
placed in the MR system, and the MR field homogeneity was
evaluated qualitatively with MR images and quantitatively
with measurement of Bbase+det+mags.
All MR data were collected on a 0.5 T open magnet sys-
tem ?Signa SP, GE Healthcare, Waukesha, WI? using a
transmit-receive birdcage body coil ?Fig. 2?. The impact of
the detector on the field homogeneity was evaluated using a
28 cm diameter cylindrical phantom filled with doped water.
For qualitative assessment of image quality, axial 2D mul-
tislice gradient echo images were collected with TR/TE
=250/20 ms, FOV=34?34 cm2, 256?256 matrix, slice
thickness=7 mm, and 50° flip angle. Balanced steady state
free precession ?SSFP? images were also collected with
TR/TE=11.0/3.9 ms, slice thickness=8.2 mm, 60° flip
angle, and the same FOV and matrix size as the GRE im-
II.A. Field map measurement and data processing
II.A.1. Field map measurement
In order to obtain the field map, interleaved 2D multi-slice
gradient echo ?GRE? images of the phantom were collected
with two consecutive single-echo scans at different echo
times ?TE1=4.8 ms, TE2=6.8 ms? for 66 3-mm contiguous
axial slices ?FOV: 34?34 cm2, resolution: 64?64, TR:
1500 ms?. Both magnitude and phase images were recon-
structed. The magnitude images were used to select only
voxels within the cylindrical phantom for further processing.
FIG. 1. Flowchart of the optimization process for shim magnets: Bbaseis the
baseline field, Bbase+detis the field measured with detector in place. Bbase+det
is fitted with field of dipoles, and the fitting result dipolestaris the targeted
dipoles for shim magnets. Bbase+magsis the field measured with shim mag-
nets, and dipolesmagsis the dipole fitting result of the net field produced by
shim magnets Bbase+mags-Bbase. The final shimming efficacy is tested by mea-
suring the field with detector and shim magnets Bbase+det+mags.
FIG. 2. Experimental setup for field map measurement: the x-ray detector
sits underneath a phantom inside an open-bore MR scanner.
3896Wen et al.: Shimming magnets for the x-ray detector in XMR system3896
Medical Physics, Vol. 35, No. 9, September 2008
The phase difference between the two echo times was then
calculated for voxels within the cylindrical volume of inter-
Phase unwrapping was performed starting from the center
of the cylindrical VOI and proceeding along the central axis
toward both ends in the slice direction ?z?. Within each slice,
phase unwrapping was first performed from the central voxel
toward both edges along the horizontal ?y? direction and then
in the vertical direction ?x?. At each voxel, a multiple of 2?
was added or subtracted to make the difference compared to
the previous voxel less than ?.
The difference of the two echo times ??TE=2 ms? was
empirically chosen so that the phase evolution map could be
unwrapped and the angular frequency of the spins at each
voxel can be calculated. The angular frequency divided by
the gyromagnetic ratio was used to generate the field map.
Since all the processing was performed on images demodu-
lated by the assumed Larmor frequency, the field map was
defined as the field shift from the assumed main magnetic
field of the MR system ?B0?.
II.A.2. Field map processing
A least-squares ?LS? fit of the field map to a three-
dimensional linear spatial function ?with a constant term?
was performed. These components can be corrected using
conventional methods, e.g., changing the linear shims and
center frequency of the scanner. Thus, they were removed
from all the field maps so that the resultant fields only con-
tain the higher-order components for which the system is
unable to compensate.
II.B. Fitting with the dipole field
II.B.1. Dipole field calculation
The static field of a small permanent magnet ?or a small
magnetized volume? at a distance much larger than the size
of the magnet can be approximated by the field of a dipole:
4??3?m · r?r
where m is the dipole moment, ?0is the permeability con-
stant, and r is the displacement vector from the dipole to the
point of field ?Fig. 3?.18The mathematical model behind this
approximation is to express the field in the local spherical
coordinates ?centered at the magnet? with Legendre func-
tions, neglecting the terms of orders higher than the second
order. In the presence of the main magnetic field B0, only the
component of the dipole field in the same direction as B0
?usually defined as the z direction? affects the resonance fre-
quency. The perpendicular components of the dipole field B
are negligible because B is orders of magnitude less than B0.
For a dipole aligned with the z direction, the z component of
its field is
m?3 cos2? − 1?
where ? is the angle between m and r. This expression was
used to calculate the dipole field with the constant and linear
spatial components numerically removed.
II.B.2. Nonlinear LS fitting
In order to approximate a measured magnetic field with
the field of one or more dipoles, the deviation between these
two fields needs to be minimized. The selection of the num-
ber of dipoles is discussed below. The disagreement between
the measured and modeled fields can be characterized by the
span ?max-min? of the difference field ?peak-to-peak devia-
tion?, which is appropriate since MR image quality can often
be limited by the maximum peak-to-peak deviation.19How-
ever, fitting trials showed that in our case with a large num-
ber of field sampling points ??105?, minimization of the
peak-to-peak ?p-p? deviation was less effective and less
stable than minimization of the root-mean-square ?rms? error.
Therefore, LS minimization was adopted to find locations
and strengths of the dipoles. Nonlinear LS fitting was per-
formed with an optimization program ?lsqcurvefit? by
MATLAB ?MathWorks, Natick, MA?. If locations of the di-
poles are known, the dipole strengths that minimize the rms
error can be computed with linear fitting. Between iterations
of nonlinear fitting, linear optimization of the dipole
strengths was performed at then estimated positions. This
was found to improve convergence. Iterations were termi-
nated when changes in the dipole parameters were insignifi-
cant, and the total computation time was on the order of
As can be appreciated from Eq. ?2?, at large distances
from a dipole, a change in the dipole distance can be mostly
compensated by a change in the dipole strength. A more
distant dipole of higher strength produces a similar field
within the volume of interest as a weaker but closer dipole.
Thus, it was possible to constrain the dipoles to be located on
a plane below the imaging volume ?i.e., dipole locations with
only two degrees of freedom?, and the residual error after the
LS fit was comparable to that of a fit that allowed full free-
dom in the locations of the dipoles.
II.B.3. Detector field measurement
The field measured with the detector inside the MR scan-
ner ?Bbase+det? had two parts, the intrinsic baseline field of the
scanner ?Bbase? and the field perturbation due to the detector
?Bdet?. The measured total field ?Bbase+det? was fitted with the
field of dipoles since MR image quality is dependent on the
total field. Initially the field with the detector was fitted with
the field of a single dipole. Results showed that the calcu-
FIG. 3. The field of a small magnet can be approximated with the field of a
magnetic dipole ?m?; the main MR field ?B0? is in the z direction.
3897 Wen et al.: Shimming magnets for the x-ray detector in XMR system3897
Medical Physics, Vol. 35, No. 9, September 2008
lated location of the model dipole was considerably below
the bottom of the detector and the predicted residual field
was significantly less homogeneous than the baseline field.
When two dipoles were used, their locations were close to
the detector and the predicted residual field had equal or
better homogeneity than the baseline field. Therefore, a
model containing two magnetic dipoles was used to fit the
field, and two sets of magnets were used to correct the field
II.C. Magnet selection, mounting device, and
The requirements for the magnetic material of the shim
magnets are high strength and coercivity, which allow the
magnets to be small and unaffected by the main MR field.
We selected neodymium-iron-boron ?NdFeB?, a high-
powered magnetic material that can withstand an external
field of more than 1 T. A number of NdFeB magnets, each
approximately 0.8?0.9?1.5 cm3in size, were obtained
since their small size allowed fine adjustment to their total
magnetic dipole strength by changing the number of magnets
In order to cancel the field of the magnetized components
in the detector, we expect the ideal locations of the shim
magnets to be near these magnetic components. Due to space
limitation, it is difficult to place the magnets inside the de-
tector. At best, they could be placed under the detector where
the magnets and their mounting device would not obstruct
the x-ray beam. Importantly, fitting results showed that if two
dipoles were on the same horizontal plane, the specific hori-
zontal plane could be placed at a range of heights while
maintaining satisfactory shimming effects. The farther the
plane was from the detector, the stronger the needed dipoles,
while the residual field was not strongly dependent on the
location of the plane. A plane close to the detector is pre-
ferred so as to reduce the size and strength of the magnets
A device that allowed two sets of magnets to be installed
under the detector was custom built ?Fig. 4?. For MR com-
TABLE I. Results of field measurement and dipole fitting.
Dipole field fitting results
?dipole strength @ y, z?
unit: ?A m2@ mm, mm?
x=365 mm for fitting with two
dipoles ?approximate vertical
location for the magnet holders?
No detector or
Detector in place None
?A: 2.7 @ −13, −78; B: 1.7 @ −21,
?A: 2.2 @ −10, −73; B: 1.4 @ −20,
?A: −2.2 @ −15, −85; B: −1.4 @ −18,
?A: −2.2 @ −16, −75; B: −1.4 @ −17,
Detector in place
with magnets in
?A: 0.5 @ −13, −87; B: 0.5 @ −25,
?y=20 mm 54.75.51
?z=20 mm None 59.55.84
FIG. 4. Two sets of magnets are mounted at the bottom of the detector with
two pairs of slotted bars allowing separate 2D location adjustment for each
of the two sets of magnets.
3898 Wen et al.: Shimming magnets for the x-ray detector in XMR system3898
Medical Physics, Vol. 35, No. 9, September 2008
patibility, the mounting device was made of nonmagnetic
material. The main body was a plastic plate of the same size
as the detector that could be attached to the bottom of the
detector with stainless steel screws. A pair of slotted bars
made of aluminum was fixed on the vertical edges of the
plate, and another pair of bars was placed horizontally over
the first pair with screw-stud fasteners. Two magnet holders
made of plastic ?Delrin, DuPont, Wilmington, DE?, each
with a cavity capable of holding multiple magnets, were situ-
ated on the horizontal bars, held with screw-stud fasteners.
The in-plane positions of the magnet holders could be ad-
justed by sliding the horizontal bars vertically and sliding the
The strengths of the magnets were calibrated using the
MR scanner. Two sets of magnets were placed in the holder
without the detector and then into the MR scanner, approxi-
mately where the detector would be. The baseline field
?Bbase? and the field with the magnets in place ?Bbase+mags?
were measured. The field due to the magnets ?Bmags? was
obtained by subtracting the baseline field from the field mea-
sured with the magnets ?Bmags=Bbase+mags-Bbase?. The result-
ing field Bmagswas fitted with the field of two dipoles in
order to obtain the dipole strengths and locations that could
be used to characterize the field of the magnets.
Field measurement and fitting with dipole field were per-
formed in order to optimize the shim magnets. Results are
tabulated in Table I and described in detail below.
III.A. Baseline field map „Bbase…
Figure 5 shows MR images of an axial slice near the
center of the phantom with GRE and SSFP sequences when
the detector was not inside the MR field. With linear shim-
ming, the GRE sequence could produce images with high
SNR and no artifacts ?Fig. 5?a??. Slight banding artifacts can
be seen in images with the SSFP sequence that is more sen-
sitive to field inhomogeneity ?Fig. 5?b??. The signal nonuni-
formity at the bottom of the phantom in both images is due
to proximity to the RF coil. Figure 5?c? shows a slice of the
measured baseline field ?Bbase? and Fig. 5?d? is a histogram of
Bbaseat voxels in the cylindrical VOI after removing the
offset and linear components. The peak-to-peak ?p-p? and
rms deviations were 53.8?10−7T and 5.51?10−7T, re-
III.B. Field map with the detector „Bbase+det…
The detector significantly perturbed the main magnetic
field and the effects were obvious in the MR images, even
after linear shimming. The GRE images contained banding
artifacts throughout the FOV ?Fig. 6?a??. The SSFP images
had strong banding artifacts typical of the behavior of SSFP
with significant field inhomogeneity ?Fig. 6?b??. The mea-
sured field map ?Bbase+det? ?Fig. 6?c?? within the cylindrical
VOI after linear shimming had a p-p deviation of 125.8
?10−7T ?more than two times of the baseline? and an rms
deviation of 16.8?10−7T ?about three times of the baseline?
FIG. 5. With no detector inside the MR scanner, axial images of the phantom ?256?256, FOV=34 cm? were obtained with ?a? GRE ?TE/TR=20/250 ms,
slice thickness: 7 mm, flip angle: 50°? and ?b? SSFP ?TE/TR=3.9/11.0 ms, slice thickness: 8.2 mm, flip angle: 60°?. ?c? Measured field map. ?d? Histogram
of the field sampled at voxels in the phantom ?offset and linear spatial terms removed?.
FIG. 6. With the detector inside the scanner, images of the phantom were obtained with ?a? GRE and ?b? SSFP sequences. ?c? Measured field map. ?d?
Histogram of the field sampled in the phantom. Imaging parameters were the same as in Fig. 5.
3899 Wen et al.: Shimming magnets for the x-ray detector in XMR system3899
Medical Physics, Vol. 35, No. 9, September 2008