A new technique for maintaining the alignment of electric and magnetic fields in an x-
ray tube so the tube can be operated in the presence of a static external
magnetic field without being negatively affected thereby. Deflection of the
electron beam of the x-
ray tube by the
high magnetic field is reduced or eliminated by modifying or canceling, at a location near the
electron beam, the
magnetic field components transverse to the beam. In a preferred embodiment, a set of
electromagnet coils are positioned on or near the tube and oriented in a way that when current is applied internal magnetic fields are produced in a direction opposite to the
transverse magnetic fields, thereby causing cancellation. In one implementation, one or more sensors are used to detect the
transverse magnetic fields. The sensor is positioned near the
electron beam, either inside or outside the x-
ray tube. The sensor produces a
signal dependent on a static
magnetic field component transverse to the desired direction of the electron beam. This
signal is used to control the amount of current applied to the coils. A controller and a feedback circuit may be included to adjust in real time the amount of current being applied.