If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

Magnetic resonance imaging (MRI)

What is MRI?

Magnetic Resonance Imaging (MRI) is one way for healthcare professionals to look inside your body and see what is going on inside it without having to cut open your body. While there are lots of different ways to take pictures inside your body such as x-rays, computerized tomography (CT) scans, ultrasounds and so on, MRIs produce far more detailed images of the structure of a patient’s blood vessels, nerves, bones, and organs.

How does MRI work?

An MRI takes pictures of places in your body that contain water, and the detail in these images comes from the ways that different tissues interfere with the electromagnetic waves coming from water molecules. The idea of water releasing electromagnetic waves may seem pretty exotic, but it turns out that most molecules do it all the time---the signals that they emit are just so tiny that you’d only notice them if you went looking for them. An MRI is just a device that first excites water molecules into releasing waves, and then records the locations of those waves with high accuracy.
Your body is pretty much entirely made of water. Blood vessels, lymph nodes, and even solid bones are soaked with water molecules, each of which contains two hydrogen atoms. At the center of each hydrogen atom sits a nucleus consisting of a single proton, which can be visualized as a tiny bar magnet with a “north” and “south” pole. Just like the “north” and “south” poles of a needle on a compass tend to align with the magnetic poles of the earth, in the presence of strong magnetic fields each proton in water twists its orientation so that it aligns with the field. When health care providers first turn on the MRI machine, a very strong, constant magnetic field forms that remains in place for the duration of the measurement, and this super-strong field makes all the protons try to line up with the poles of the field. This lining-up doesn’t mess up any of the chemical properties of the tissues, so your body continues to function normally while the doctor makes the measurement.
But while this really strong constant magnetic field makes all the protons want to line up, the MRI machine intentionally disrupts this field by sending a brief pulse of an additional, weaker electromagnetic field. This weaker pulse points in a different direction than the constant magnetic field, and so it disrupts the protons so that they become misaligned with the constant field. After the pulse ends the protons are left askew, but then they gradually re-align with the original constant field. You can think of it as the tiny jiggle that occurs in a compass needle when a weak magnet passes by. The compass normally points north, but the weak magnet causes the compass needle to jiggle slightly.
However, unlike the needle of a normal-sized compass, the direction that the protons can align has single, well defined levels in a manner very similar to the different energy levels of electrons around an atom’s nucleus. Just as electrons in atomic energy levels can absorb and re-emit photons when changing energy levels, the gradual realignment of the nuclear magnetic spin results in the emission of low-energy, radio frequency photons. The time and amount of re-alignment changes based on the thickness and hardness of the tissue where the water molecules are sitting, and so carefully monitoring of the arrival of re-emitted photons in the MRI’s detectors allows the locations and shapes of different tissues to be identified.
Because different places in the body contain different amounts of water, MRI detects the electromagnetic fields of the atoms in water molecules and uses this to determine differences in the density and shape of tissues throughout the body.
Diagram of magnetic fields' effect on proton alignment

Where else is this effect useful?

MRI uses the same physical effect as Nuclear Magnetic Resonance (NMR) spectroscopy, in which the identity of an unknown compound (like a potential new drug) may be identified by the resonant properties (the jiggling of protons) of the atoms that comprise it. In fact, the only reason that the technique is called MRI and not NMR is because it premiered during the Cold War, during which patients were hesitant to undergo any sort of “nuclear” treatment!
NMR spectroscopy was originally developed to help chemists who had created strange compounds that they couldn’t identify. In the technique (and just as in MRI), an unknown sample is placed in a static magnetic field, briefly excited with radio-frequency photons (light), and then allowed to re-emit those photons. NMR works because the characteristic frequency of the re-emitted photons varies very slightly based on the structure of the molecule. A proton all by itself may absorb and reemit 900 MHz photons, but when it gets near other charges (such as in a large hydrocarbon chain), the magnetic field around it is gets twisted and distorted and so its resonant frequency may shift to something like 906 MHz. This means that NMR may be used to generate “spectra” corresponding to the amount of resonance at various frequencies, which in turn reveals details of the structure of molecules. So if a chemist looks at the NMR spectrum of her unknown sample and sees a huge peak near 906 MHz, then she knows that her sample probably has at least one hydrocarbon chain somewhere on it.
The main difference between NMR spectroscopy and MRI imaging is that NMR generates information (a spectrum of light corresponding to chemical structure) based on the frequency of emitted radiation (which is related to the speed of the jiggling protons). MRI instead generates information (images of the body) using the intensity of radiation (the quantity of re-emitted photons) arriving from various parts of body. Protons in dense or solid structures tend to be more or less prone to misalignment when the disrupting radio waves are applied to the body’s tissue, resulting in a lower number of re-emitted photons coming from that region and thus a darker area in the resulting image.

What methods are used to make MRI work even better?

Generally, using stronger stationary magnetic fields results in nicer MRI images. Because the water molecules in the body are warm, they are constantly jiggling around and colliding with one another. This jiggling tends to knock the alignment of protons in random directions, and so if the stationary magnetic field is too weak, these thermal forces will prevent protons from lining up, resulting in a dimmer MRI image.
The images get even better when the radio waves are applied multiple times, with the images from each subsequent re-emission merged together to yield a final, combined image. It’s like taking the same picture multiple times on your camera and blending them together in your favorite image editor to get a better exposed image. The main limitation of this method is ensuring that the patient lies still long enough that the image doesn’t get blurry!
Sometimes there is not enough difference in structure between two tissues to see them using MRI. For example, a healthcare provider may want to check out an unusual blood vessel (such as a blood vessel with a blood clot), but such an image may be difficult to see because the neighboring fat and muscle tissue re-emit photons at a similar rate as the blood vessel. There just isn’t enough contrast between the different structures. To solve this problem, the healthcare provider may inject a contrast agent, such as Gadolinium (III), into the patient’s bloodstream. Atoms of Gd(III) have really unusual electrical properties that cause them to disrupt the effective magnetic field experienced by protons in the bloodstream, which in turn changes the amount of photons that the protons will absorb and emit. This causes the blood vessels to stand out from neighboring tissues in subsequent MRI images.

Consider the following… fMRI

We’ve all seen news articles describing how different parts of the brain become active during tasks like eating or talking. These striking images of brains owe their clarity to yet another modification of MRI, known as Functional MRI (fMRI).
Some bodily processes actually change tissues in ways that are noticeable on an MRI. For example, when tissues stretch or swell, the distribution of protons in that part of the body can change enough that a detectable change will occur in the MRI signal coming from that part of the body. This means that MRIs can be used to create movies that reveal details of events over time in a patient’s body. The simplest case involves imaging moving structures like the heart or lungs, which can help pinpoint abnormal valves or blood vessels that wouldn’t stand out in a still image. In a recently-developed fMRI, information about the changing distribution of oxygen in the brain is generated based on the unique magnetic properties of blood containing oxygen versus blood without oxygen. In oxygenated blood, the electrons from the oxygen molecules tend to block applied magnetic fields, effectively screening the hydrogens in water molecules from the applied magnetic field and decreasing the rapidness with which they will align with it. Deoxygenated blood does not have this screening effect, and so the protons align much faster---leading to more radio-frequency photons visible to the MRI detector. Because the changing distribution of oxygenated blood in the brain is known to correlate with neural activity, fMRI can be used to image the parts of a patient’s brain that become active and inactive during various tasks. This makes fMRI a very useful tool for neuroscientists and psychologists.

Want to join the conversation?

  • piceratops ultimate style avatar for user Isaac Deatherage
    Can someone explain this MRI MCAT passage Q to me?
    Question: "The frequency of the applied RF signal used to excite spins is directly proportional to the magnitude of the static magnetic field used to align the spins, with proportionality constant 555 hz/T. If the strength of the applied field is known to be 20 T plus or minus 3 T, which of the following correctly describes the uncertainty in the INVERSE frequency (1/frequency)?"
    Answer: "Error propagation for inverse proportionalities works differently than it does for direct proportionalities. The error of a reciprocal relation, B = k / (1/ω), is given by ΔB = [k / (1/ω)^2]Δ(1/ω). Alternately, the error must be a smaller quantity than 1/15 s, which would be the error in the case where the inverse frequency and the magnetic field were directly proportional. The result of substituting the given values for ΔB, B, and k is 3/2000 s."
    (9 votes)
    Default Khan Academy avatar avatar for user
    • orange juice squid orange style avatar for user Jay P
      Let f_B = frequency of static magnetic field, f_b = frequency of RF signal.

      Given: f_B = 5*(20 +/- 3). So, f_B = (100 +/- 15) Hz, and 1/f_B = 1/(100 +/- 15).

      Error values give us a range of how high or how low the values could fluctuate.

      Assume, u = 1/f_B = 1/(100 + 15) and v = 1/f_B = 1/(100 - 15).
      We get, u = 1/115 and v = 1/85.
      We know that there should be some fixed constant (say m) and some error (say e), such that, u = m +/- e = 1/115 and v = m +/- e = 1/85

      Arbitrarily, we assign, u = m + e and v = m - e.
      So, m + e = 1/115 and m - e = 1/85, i.e., 1/115 - e = 1/85 + e.
      Therefore, (1/115 - 1/85) = 2e.
      => 1/5(1/23 - 1/17) = 2e
      => 1/10[(17-23)/17*23] = e.
      So, e = 3/2000 (denominator is approx.)

      You wrote the proportionality constant as 555 Hz/T instead of 5 Hz/T, so maybe this error is messing your calculation up.
      (2 votes)
  • duskpin tree style avatar for user Maiar
    What would happen if the radio frequency is applied first without aligning the protons first using the strong external magnet ?
    (3 votes)
    Default Khan Academy avatar avatar for user
    • duskpin seed style avatar for user marsya
      My guess is that you couldn't calculate the intensity of the re-emitted photons since there would be nothing to compare it to. In my opinion aligning serves as inicial point from which you can deflect and then realign the protons and based on which the computer calculates and project the image.
      (3 votes)
  • leafers ultimate style avatar for user ff142
    How does MRI specifically target only water molecules/atoms and not other molecules/atoms?
    (1 vote)
    Default Khan Academy avatar avatar for user
    • blobby green style avatar for user ITVband
      Specifically, it is because the RF radiation will only cause an atom to precess (move from the low energy state aligned with the constant magnetic field to the high energy state of being in opposition to the constant magnetic field) at a very specific frequency - hence the "resonance" part of the MRI title.

      The Larmor frequency for hydrogen protons is 42.58mhz at 1 Tesla. Whilst everything is aligned with the magnetic field - beaming in RF at 42.58mhz will only cause hydrogen protons to precess.
      (3 votes)
  • blobby green style avatar for user Harsha Kumar
    What do they mean by gradient echo or spin echo in MRI ? Thanks
    (1 vote)
    Default Khan Academy avatar avatar for user
    • blobby green style avatar for user ommahajan001
      In magnetic resonance, a spin echo is the refocusing of spin magnetisation by a pulse of resonant electromagnetic radiation.[1] Modern nuclear magnetic resonance (NMR) and magnetic resonance imaging (MRI) make use of this effect.

      The NMR signal observed following an initial excitation pulse decays with time due to both spin relaxation and any inhomogeneous effects which cause different spins in the sample to precess at different rates. The first of these, relaxation, leads to an irreversible loss of magnetisation. However, the inhomogeneous dephasing can be removed by applying a 180° inversion pulse that inverts the magnetisation vectors.[2] Examples of inhomogeneous effects include a magnetic field gradient and a distribution of chemical shifts. If the inversion pulse is applied after a period t of dephasing, the inhomogeneous evolution will rephase to form an echo at time 2t. In simple cases, the intensity of the echo relative to the initial signal is given by e–2t/T2 where T2 is the time constant for spin-spin relaxation. The echo time (TE) is the time between the excitation pulse and the peak of the signal.[3]

      Echo phenomena are important features of coherent spectroscopy which have been used in fields other than magnetic resonance including laser spectroscopy[4] and neutron scattering. Echoes were first detected in nuclear magnetic resonance by Erwin Hahn in 1950,[5] and spin echoes are sometimes referred to as Hahn echoes. In nuclear magnetic resonance and magnetic resonance imaging, radiofrequency radiation is most commonly used.[6][7]

      In 1972 F. Mezei introduced spin echo neutron scattering, a technique that can be used to study magnons and phonons in single crystals.[8] The technique is now applied in research facilities using triple axis spectrometers.
      (1 vote)
  • piceratops ultimate style avatar for user Isaac Deatherage
    I have a Q about FT-NMR (only) and how it relates to other science I need for the MCAT such as this article on MRI. NMR is done in a spectrometer, which makes me think of light and this electromagnetic spectrum (light) used is in the radio frequency. How does this EM radiation connect to an applied (external) B in a simple equation or 2 (not complicated beyond scope of MCAT)? I know that EM waves have perpendicular magnetic and electric fields (B perp. to E). And how does this relate to giving a high frequency pulse? The section on magnetism was scarce, so I'm having a hard time relating all the concepts. Basically:
    1. How does I (current) relate to B (Mag field) relate to Q (charge) relate to E (elec field) relate to f (freq) in cause and effect?
    2. How does this all relate to NMR?
    3. How can all the above be connected in equation form?

    This is a great article about it but it doesn't answer my Qs: https://www2.chemistry.msu.edu/faculty/reusch/virttxtjml/spectrpy/nmr/nmr2.htm#pulse
    (1 vote)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user hanrahanj2014
    What is the difference between an event-related fMRI design and a block fMRI design?
    (1 vote)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user savannah.johnson2
    what is the process of the MRI using radio waves Im not understanding that part
    (1 vote)
    Default Khan Academy avatar avatar for user
  • female robot amelia style avatar for user ambersmith
    I NEED the answer to this question
    - how does an MRI machine use EM (electromagnetic) waves?

    Thank you!
    ~Amber Smith
    (1 vote)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user sarah azrai
    What is the function of magnets in an MRI?
    (1 vote)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user marilynachadwick
    can fMRI be used to determine a person's level of engagement in a task such as participation in a conversation?
    (1 vote)
    Default Khan Academy avatar avatar for user
    • piceratops ultimate style avatar for user Micah Carmichael
      It can, to an extent. I've previously done research with a tool called an Epoch that was essentially a small, wearable (and albeit low grade) fMRI, that if you pre-programmed a certain thought pattern to adhere to a certain motion (say, if someone thought about a vivid shade of blue, the ball on screen would rotate right) it would later be performed. We used it informally to just test if it could monitor concentration on one or two images, motions, etc and could then determine the individual likely went "off-topic" when the object on screen stopped moving. I'm sure as there is more research and technological advances, we will be able to fine tune or make new tools to measure much more complex tasks, like attention to a single conversation.
      (1 vote)