Most people have seen MRI images, or MRIs being used on medical shows, but rarely is magnetic resonance imaging actually explained. Take a look at how it works.

There are plenty of medical dramas on TV, and nearly all of them have some scenes of desperately sick patients climbing into gigantic tubes that look like space ship escape pods. Usually, at that point, the camera pans away from the patient so people can see the attractive doctors making passes at each other until they turn to the monitor and see the patient's horrible tumor, or lesion, or re-absorbed fetal twin. But how are they getting those images, and why does it take a piece of equipment larger than most city dwellers' bathrooms to do it?

The thing taking up a big chunk of the space in the MRI machine is a giant electromagnet. When electricity is run through it, behaves like a very strong regular magnet. Although it looks huge, the electromagnet isn't as big as it could be. It's made with superconducting material, maximizing the juice that runs through it by minimizing its resistance to electricity. Superconductors can only do this if chilled to well below zero degrees, so another part of the bulk of an MRI machine consists of a cooling system that delivers liquid helium to cool the magnet. The magnet is looped around the central tube, where the person is loaded in. It establishes a massive magnetic field around them.

The atoms in a person's body are spinning, and their spin gives them a magnetic field as well. When they are under the influence of a powerful magnetic field, they line up along with it - especially when they're light and unattached. An MRI targets the hydrogen atoms. Their spins will all be orbiting around the line of the central magnetic field the way planets orbit the sun. Unlike planets, the atoms can spin either way around the axis of rotation. About half will spin one way, and about half will spin the other. But not exactly half. There will be a slight imbalance in the number of atoms spinning one way or the other. The imbalance will consist of relatively few atoms compared to all the hydrogen atoms in the human body, but since the body is made of so many atoms, the total number of errant hydrogen spins will be large.

Once the atoms are lined up, pulses of radio waves will be sent into the tube. These will be tuned to the 'frequency' of the hydrogen atoms, called the Larmor frequency. When it hits the atoms, they will absorb the radio wave's energy and flip their spins. When it switches off, they gradually return to their original state. Sensors monitor that return, and translate it into pictures.

These pictures are extremely accurate, because auxiliary magnets can tweak the magnetic field exerted by the large magnet. By doing this, they can localize the area being covered and examine the patient's body 'slice by slice'. Sometimes, to get an even clearly picture, patients are injected with dye. Different areas of the body absorb things differently, so doctors can get a clear view of where each kind of tissue is and how well it's functioning.