Deep Learning in Healthcare — X-Ray Imaging (Part 1 — Basics of X-Rays)

This is Part 1 of a series of articles on the usage of Deep Learning with a focus on X-Ray Imaging (Chest X-rays). Here we will discuss the basics of X-rays, from its history to working principle to image formation.

Arjun Sarkar
Towards Data Science

--

X-Ray imaging is one of the oldest and still one of the most prevalent methods of medical imaging. X-ray is the life-saving technology that was actually invented by accident. German physicist Wilhelm Roentgen discovered the technology when he was doing experiments with electron beams in gas discharge tubes. While doing this experiment he noticed that while electrons beams were running, a fluorescent screen in his lab started glowing green. Now, this is not an uncommon phenomenon, but Roentgen’s screen was blocked by heavy cardboard which he thought would block the radiation. The interesting aspect about his discovery was that he found that this was some kind of penetrating radiation, but could not exactly figure out what it actually was.

The magic happened when a hand was placed in front of the beam, and it created an image of the bones, on the screen. This breakthrough made X-rays of perfect use immediately after it’s discovery. This double discovery (X-rays and its application) marked arguably one of the biggest discoveries in the field of medical imaging in human history.

It gave professionals a chance to see ailments inside the human body without the need for any kind of invasive surgery. It even allowed them to see soft tissues with slight modifications.

Figure 1. First X-Ray image (By Wilhelm Röntgen. — [1], Public Domain, https://commons.wikimedia.org/w/index.php?curid=5059748)

So what are X-Rays?

You can think of X-Rays as light rays. Both are electromagnetic energy carried in waves by photons. The main difference between these two waves is the energy level or wavelength of the rays. We as humans have the ability to sense light rays in the wavelength of visible light. But shorter and longer wavelengths fall outside our visible spectrum. X-rays are shorter and higher energy waves.

Figure 2. Light Spectrum (By Ulflund — This figure is a compilation of different images from Wikimedia commons.The graph at the top I have made myself, originally uploaded as my own work. The crystallography image is from File: Lysozym diffraction.png by user: Del45. The mammography image is from File:40F MLO DMMG.png by Nevit Dilmen (talk). The CT image is from File:Ct-workstation-neck.jpg by User: ChumpusRex.The luggage scanner image is from File: Luggage screening at VTBS.JPG by user User: Mattes., CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=22545004)

How do X-rays work?

X-rays are produced by the movement of electrons within atoms. The specific energy level of a given X-ray is dependent on how far the electron dropped between orbitals in an atom.

When any given photon collides with another atom, the atom can absorb the energy of the photon, and boost an electron to a greater level. In this case, the energy of the photon has to match the energy difference between the two electrons. If this doesn't occur then the photon can not cause a shift between orbitals.

This means that as photons from X-rays pass through the body each tissue’s atoms absorb or react to photons differently. Soft tissues are composed of smaller atoms, so they don't absorb X-rays well due to the photon's high energy.

On the other hand, the calcium atoms of bones are much larger, so they do absorb the X-ray photons and thus result in a different view on the X-ray image.

Inside an X-ray Machine:

Figure 3. Inside an X-Ray Machine (By Daniel W. Rickey — Own work, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=16622562)

Inside an X-ray machine, there is an electrode pair, a cathode, and an anode. The apparatus is placed inside a vacuum tube usually made of glass. The cathode is usually a heated filament and the anode is a flat disk made of Tungsten. As the cathode is heated up, under a high potential difference, electrons spurt out of the cathode and move towards the anode. Due to the high voltage across the electrode pair, electrons travel at an extremely high velocity towards the anode. The electrons finally hit the tungsten atoms of the anode and knock off loose electrons in the lower orbitals of the atoms. As electrons fall from the higher orbitals to these lower energy levels, the extra energy is released in the form of photons or X-rays. This is how X-rays are produced.

But in case, when soft tissues need to be examined, then a contrast media needs to be added. Contrast media are generally liquids that are opaque to X-rays and collect in soft tissues. To examine blood vessels, doctors inject this media into veins. Often these images are viewed in real-time using Flouroscopes.

Figure 4. Viewing soft tissue during Cholecystectomy (By HenrikP — Medical x-ray (flouroscopy), Public Domain, https://commons.wikimedia.org/w/index.php?curid=318366)

X-ray image formation:

To get an image from an X-ray machine, doctors use a film or a sensor on the other side of the patient. When X-rays travel through the body they can interact with many atoms along the path. What is finally recorded in the film or detector is the sum of all those interactions.

Figure 5. X-Ray image formation (By BruceBlaus — Own work, CC BY-SA 4.0, https://commons.wikimedia.org/w/index.php?curid=44921292)
Figure 6. Chest X-Ray (By Diego Grez — Radiografía_pulmones_Francisca_Lorca.jpg, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=10302947)

References:

  1. “X-Rays”. Science Mission Directorate. NASA.
  2. Novelline, Robert (1997). Squire’s Fundamentals of Radiology. Harvard University Press. 5th edition. ISBN 0–674–83339–2.
  3. ^ “X-ray”. Oxford English Dictionary (3rd ed.). Oxford University Press. September 2005.

--

--