HelpContactFor teachers and institutes
>_StemPy Lab
Mock TestsClasses

>_StemPy Lab

Learn. Solve. Code the solutions. Test yourself.

Live examsFree mock exams, timed and rankedEveryone starts together, and your score and rank come the moment it ends.See the exams →
Live examsInternational live exams are comingTell us which exam you want first. Timed practice papers are open now.See what is coming →

Learn

  • Physics
  • Chemistry
  • Mathematics
  • Biology
  • Python Programming
  • Statistics & Data Science
  • Computer Science
  • Space Science and Astronomy
  • Classes
  • Groups

Practice

  • Problems
  • Quizzes
  • Mock Tests
  • Prepare for an Exam
  • Question Sets
  • Exams
  • Certificates
  • Python Labs
  • AI Practice Generator
  • Student-Created Tests

Community

  • Discussions
  • Resources
  • Notes
  • Glossary
  • Blog

Account

  • Log in
© 2026 senLearn. All rights reserved.HelpFor SchoolsAboutContactPrivacy PolicyTerms of UseRefund Policy
X-Ray Imaging, CT and MRI
  1. 1Making X-rays: the tube and its spectrum
  2. 2Attenuation, contrast and the X-ray image
  3. 3Computed tomography and MRI in outline
  1. Physics
  2. /X-Ray Imaging, CT and MRI
  3. /Computed tomography and MRI in outline

Course 30.2·Lesson 3 of 3

Computed tomography and MRI in outline

A CT scanner turns a thin beam around the body and measures the attenuation along many lines. A computer then finds the value of each small block, called a voxel, of a slice. MRI uses no X-rays: hydrogen nuclei in a strong field resonate at f=42.58 MHz/T×Bf = 42.58\ \text{MHz/T} \times Bf=42.58 MHz/T×B and send back a radio signal.

Lesson 3 of 3Show all lessonsHide
X-Ray Imaging, CT and MRI
  1. 1Making X-rays: the tube and its spectrum
  2. 2Attenuation, contrast and the X-ray image
  3. 3Computed tomography and MRI in outline

Try the code and the simulations beside the lesson.

Beyond the shadow

A plain X-ray squashes the whole body into one flat shadow. A rib in front hides a lung behind it. How could we see one thin slice on its own? Two machines do it in very different ways: CT with X-rays, and MRI with magnetic fields and radio waves.

Computed tomography (CT)

Two linked pictures. On the left, a patient lies in a ring. An X-ray tube on the ring sends a thin fan of X-rays through one slice of the body to a curved row of detectors on the other side, and the tube and the detectors turn together around the patient. On the right, the slice is shown as a grid of four squares labelled A and B in the top row and C and D in the bottom row, with arrows that show four beam paths: along each row, down the left column, and along the diagonal from A to D. A note says the right column is used as a check.

In a CT scanner an X-ray tube sends a thin fan of X-rays through one slice of the body to a row of detectors. The tube and the detectors turn together around the patient. At each angle, each detector measures the total attenuation along its line. A computer then works out how much each small part of the slice absorbs.

  • The slice is divided into small squares called pixels. Each one has a thickness, so it is really a small block called a voxel.
  • The computer finds the attenuation of each voxel from the many line readings. This is reconstruction.
  • Slice after slice, the scanner builds a three-dimensional picture.

Worked example: four voxels

Here is the idea with four voxels, A and B on top, C and D below. Each reading is the sum of the voxels along its line: A+B=7A + B = 7A+B=7, C+D=11C + D = 11C+D=11, A+C=8A + C = 8A+C=8 and, along the diagonal, A+D=12A + D = 12A+D=12, in the same arbitrary units.

  1. Write all in terms of AAA. B=7−AB = 7 - AB=7−A, C=8−AC = 8 - AC=8−A and D=12−AD = 12 - AD=12−A.
  2. Use the bottom row. C+D=20−2A=11C + D = 20 - 2A = 11C+D=20−2A=11, so A=4.5A = 4.5A=4.5.
  3. The rest. B=2.5B = 2.5B=2.5, C=3.5C = 3.5C=3.5 and D=7.5D = 7.5D=7.5.
  4. Check with a reading we did not use. The right column gives B+D=10B + D = 10B+D=10. A real scanner takes the reading and finds 101010, so the values fit.

A real slice has hundreds of thousands of voxels and needs many thousands of readings, which is why CT needed fast computers.

The CT number

Scanners report each voxel as a CT number, in Hounsfield units (HU):

CT=1000(μ−μw)μw\displaystyle \text{CT} = \frac{1000(\mu - \mu_w)}{\mu_w}CT=μw​1000(μ−μw​)​

Here μw\mu_wμw​ is the coefficient of water. So water is 000 HU and air is about −1000-1000−1000 HU. Fat is a little below zero, soft tissue a little above, and dense bone near +1000+1000+1000 HU or more.

A CT scan shows soft tissues far better than a plain X-ray. It also gives a much larger dose, a few millisievert against about 0.020.020.02 millisievert for an X-ray of the chest. We return to dose in the next course.

MRI in outline

Magnetic resonance imaging uses the nuclei of hydrogen, which are single protons. The body is mostly water and fat, so it is full of them.

  • Tiny magnets. Each proton spins and acts as a tiny magnet. In a strong steady field BBB a small excess of them lines up with the field. They do not sit still: they precess about the field, like a tilted spinning top.
  • The Larmor frequency. The rate of precession is proportional to the field: f=42.58 MHz/T×Bf = 42.58\ \text{MHz/T} \times Bf=42.58 MHz/T×B for hydrogen. A scanner of 1.51.51.5 T gives 63.963.963.9 MHz, a radio frequency.
  • Resonance. A pulse of radio waves at exactly this frequency tips the protons away from the field.
  • Relaxation. After the pulse the protons return to line, and as they do they send out a weak radio signal. The time this takes differs from tissue to tissue, for example between fat and water. That gives contrast.
  • Where the signal came from. Extra coils add a small gradient, so the field, and so the frequency, changes along the body. A pulse at one frequency then excites only one slice.
A drawing of a patient lying inside a large ring magnet. Arrows show the strong steady field along the body. Inside, small coils make a gradient, so the field is a little stronger towards the head than towards the feet. A radio-frequency coil sends a short pulse and then picks up the weak signal that the hydrogen nuclei send back. A small graph beside it shows the resonant frequency rising in a straight line from the feet to the head.

The main field comes from a superconducting coil cooled by liquid helium. MRI uses no ionising radiation. It shows the brain and the joints very well. But any iron in the room, or in the patient, is pulled hard by the field, so metal is strictly kept out.

Set the gradient to 101010 mT/m. How much does the frequency change between z=0z = 0z=0 and z=0.1z = 0.1z=0.1 m? Now set the gradient to zero. Could the scanner tell the slices apart?

Practise with new numbers

Try it in Python

The program finds the four voxels from five readings, and the Larmor frequency at two field strengths.

Predict first. Which voxel absorbs the most? Then run it. Check with Show the answer.

1. Change the readings to top, bottom = 9, 5, left = 10 and diagonal = 6. What are the four voxels now?

2. Add 7.0 to the list of fields. What frequency does it need?

Common mistakes

  • Thinking CT uses a different kind of ray. It uses X-rays, as a plain radiograph does. The difference is the many angles and the computer.
  • Saying MRI uses X-rays or radioactivity. It uses a magnetic field and radio waves only.
  • Forgetting the gradient. Without it, every part of the body would resonate at the same frequency.
  • Mixing up pixel and voxel. A voxel is a pixel with a thickness, a small block of the slice.

Remember these

  • CT: a fan beam turns around the body, and a computer reconstructs the voxels of a slice.
  • CT number: 1000(μ−μw)/μw1000(\mu - \mu_w)/\mu_w1000(μ−μw​)/μw​. Water 000 HU, air about −1000-1000−1000 HU.
  • CT gives a much larger dose than a plain X-ray.
  • MRI: f=42.58 MHz/T×Bf = 42.58\ \text{MHz/T} \times Bf=42.58 MHz/T×B for hydrogen. A radio pulse at fff makes the protons resonate.
  • Relaxation times give contrast. A gradient picks the slice. No ionising radiation.

Check yourself

Try each one on your own first. If you are stuck, open a hint. Then check with Show the answer.

  1. A voxel has a CT number of 000 HU. What does it most likely hold?
  1. What frequency does a 3.03.03.0 T scanner use for hydrogen?
  1. Why is MRI chosen over CT for a scan of the brain of a child, when either would do?
  1. Why must a patient remove a steel hair clip before an MRI scan?

References

  • OpenStax College Physics 2e, Chapter 22 Magnetism, on more applications of magnetism (magnetic resonance imaging).
  • Cambridge International AS and A Level Physics (9702) syllabus, Medical physics, computed tomography.

Enroll free in X-Ray Imaging, CT and MRI

Every lesson is open to read. Enrolling also lets you:

  • Mark lessons done and carry on where you stopped.
  • Take the tests of this lesson and its course.
  • Count the course towards the certificate for its chapter.
No payment. You can leave at any time.

Problems (3)

A tiny model of a CT slice has four voxels, A and B in the top row and C and D in the bottom row…Hard · High School (11–12) · by StemPy Lab
In a CT scanner, water has µw = 0.190 cm⁻¹ for the beam used…Hard · High School (11–12) · by StemPy Lab
A 3.0 T MRI scanner adds a gradient of 20 mT/m along the body, so the field is 3.0 T at the centre…Advanced · High School (11–12) · by StemPy Lab
That was the last lessonBack to the course: take the test
← X-Ray Imaging, CT and MRI
← Attenuation, contrast and the X-ray imageNext →

Discussion (0)

Log in to join the discussion.

Loading…

about 30 min1 simulation1 practice question1 Python program5 questions to check yourself

This lesson is free to read. Enroll free to keep your place and take the tests.

Python Labs (1)

CT numbers and MRI frequencies in codePython Lab · by StemPy Lab

Question Sets (1)

X-Ray Imaging: Think It Through10 questions · by StemPy Lab

Notes (1)

X-Ray Imaging, CT and MRI: Quick RevisionNote · by StemPy Lab