Welcome to chapter sixteen. Chapter fifteen gave you the framework: every modality measures one physical property, image quality trades against dose and time, and a test's usefulness depends on prevalence. This chapter opens the boxes. For X-ray, CT, MRI, ultrasound, nuclear medicine and PET, endoscopy, and the physiological tests of heart, lungs, sleep and nerves, we ask three questions. What physical interaction does it exploit? How is that turned into an image or a number? And what is it good for, what is it bad at, and what does it cost the patient?
You need this for practical reasons. A phantom must reproduce the property the device measures, X-ray attenuation for CT, relaxation times for MRI, acoustic impedance for ultrasound, or it teaches nothing. Software that handles these images must respect what the pixel values mean. Anything you take into a scanner room must be compatible with the physics in it. And you cannot hold a useful conversation with a radiographer, sonographer, physicist or physiologist unless you know what their machine does. There is a quieter reason too. A hospital basement full of superconducting magnets, particle accelerators, phased arrays and inverse problems is some of the most elegant engineering in existence.
Diagnosis is a sequence of questions, and each family of devices answers a different kind. What does it look like inside is answered by anatomical imaging. What is it doing is answered by functional imaging and physiological measurement. What can be seen directly is answered by endoscopy. What is it made of chemically is the laboratory. And what are the cells is answered by biopsy and histopathology. Most diagnoses use several of these in sequence, starting with a cheap, widely available test and moving to a more specific one only if a question remains. That sequencing explains why the expensive machines are not used first.
The single most important divide is whether a modality uses ionising radiation: photons energetic enough to knock electrons out of atoms and break chemical bonds, including those in DNA. X-ray imaging, CT, fluoroscopy and nuclear medicine do. MRI uses radio waves, a few tens to a few hundred megahertz. Pulse oximetry and optical coherence tomography use near infrared light, and endoscopy uses visible light. None of those is ionising. Ultrasound is not electromagnetic at all; it is mechanical pressure waves.
Ionising dose is expressed as effective dose in millisieverts, a weighted estimate of whole body risk for comparing procedures. A dental X-ray is about a day of natural background. A chest X-ray is a few days. A CT of the head is around two millisieverts, about eight months of background, and a CT of the abdomen and pelvis eight to ten. A PET-CT can be ten to twenty-five. These are typical figures for comparison, not measurements of harm to anyone. The risk from one diagnostic dose is small and statistical, larger for children, which is why every exposure must be justified and paediatric protocols are separately optimised.
An X-ray tube is a vacuum diode. A heated filament releases electrons, a high voltage of fifty to a hundred and fifty kilovolts accelerates them, and they slam into a tungsten target. As they decelerate they emit X-rays, mostly braking radiation. Only about one percent of the energy becomes X-rays; the rest is heat, which is why the anode is a spinning disc in an oil-cooled housing. The operator sets two things. The peak kilovoltage sets the energy of the photons, their penetrating power. The tube current multiplied by time sets the number of photons, which sets image noise and, proportionally, dose.
As the beam passes through tissue it is attenuated exponentially, the Beer–Lambert law again. Two interactions dominate. Photoelectric absorption swallows a photon outright, and its probability rises roughly with the cube of atomic number, so calcium in bone absorbs far more than soft tissue. That is where contrast comes from. Compton scatter deflects photons, fogging the image, and an anti-scatter grid of thin lead strips removes most of it. The result is a shadow. A radiograph shows five basic densities, air, fat, soft tissue, bone and metal, and everything a radiologist reads is a boundary between them. Iodine and barium make good contrast agents because their absorption edges sit right in the diagnostic energy range.
Plain radiography has a family. Mammography uses low voltage and firm compression, and tomosynthesis reconstructs thin slices. DEXA uses two photon energies and solves the pair of images for bone mineral alone, at a tiny dose. Fluoroscopy is continuous X-ray video for swallow studies and for placing lines and implants. Angiography injects iodine into vessels and subtracts a pre-contrast mask, leaving only the vessels. Dental cone-beam CT gives 3D at modest dose and feeds a major digital fabrication workflow. The fundamental limitation of all projection imaging is superimposition: something in front of a rib or behind the heart can be invisible. The solution is CT.
An X-ray tube and an opposed arc of detectors, sixty-four to three hundred and twenty rows in a modern scanner, rotate around the patient two to four times a second while the table moves through. Each detector reading is a line integral, the total attenuation along one ray. The task is to find the attenuation of every small volume element from hundreds of thousands of such sums. It is an inverse problem, and its mathematics, the Radon transform, was published in nineteen seventeen, decades before anyone could use it. The classical method is filtered back-projection. Modern scanners iterate, guessing an image, simulating its projections and correcting, and increasingly use deep learning. Both allow lower dose for the same quality.
A CT pixel is not a brightness. It is a calibrated measurement in Hounsfield units, with water at zero and air at minus a thousand. Fat sits around minus a hundred, soft tissue twenty to sixty, fresh clotted blood sixty to ninety, and cortical bone a thousand to two thousand. A screen shows a few hundred grey levels, so every CT image is displayed through a window, a centre and a width that map a band of values onto black to white. Brain, lung and bone windows show completely different things. For anyone writing imaging software, the window is a display transform, not the data. Segment and export on the stored values, after applying the rescale slope and intercept.
CT is fast, available around the clock, and excellent for bone, lung and acute bleeding. In a suspected stroke, a non-contrast head CT in minutes excludes bleeding before clot-busting drugs are given. Whole-body CT finds injuries in major trauma in one pass. CT pulmonary angiography shows clots in the lung arteries. Its costs are the highest routine diagnostic dose in medicine and the risks of iodinated contrast. Recognise its artefacts: streaks from metal, beam hardening as low-energy photons are filtered out by bone, motion and partial volume. Dual-energy and, since the early twenty-twenties, photon-counting CT are the newest developments.
Now MRI, the device engineers most often want explained, and one that repays the effort.
Step one, align. Hydrogen nuclei behave like tiny magnets, and in a field of one and a half or three tesla, thirty to sixty thousand times the Earth's field, a few parts per million more of them align with it than against it. Step two, excite. They precess at the Larmor frequency, forty-two point five eight megahertz per tesla, about sixty-four megahertz at one and a half tesla, the FM radio band. A radio pulse at exactly that frequency tips them over. Step three, listen: the precessing magnetisation induces a voltage in a receive coil. Step four, relax, at rates that depend on the tissue. Step five, encode and reconstruct: gradient coils make frequency depend on position, and a Fourier transform turns the data into an image.
Two relaxation processes return the system to equilibrium. In T1 relaxation the magnetisation regrows along the field; it is fast in fat and slow in free water. In T2 relaxation the precessing protons lose phase with each other and the signal decays; it is slow in free water. Those rates differ by tissue, and that is the source of MRI's contrast. The raw data are samples of the image's spatial-frequency spectrum, called k-space. Its centre holds overall contrast and its edges hold fine detail, which will feel familiar to a software developer. Much of modern MRI speed-up is about acquiring less of k-space. And the switched gradient coils make the scanner loud, often over a hundred decibels.
The operator chooses the contrast by choosing when to excite and when to listen, the repetition time and echo time. On a T1-weighted image fat is bright and fluid dark, which gives crisp anatomy. On T2, fluid is bright, and since most disease raises tissue water, lesions stand out. FLAIR suppresses free fluid to reveal lesions next to the ventricles. Diffusion-weighted imaging shows an acute stroke within minutes, long before CT changes. There are sequences for blood vessels, for brain activity through blood oxygenation, for the beating heart, and for chemical composition. MRI is first choice for brain, spine, joints, soft-tissue tumours and pelvis, but it is slow, expensive, loud and enclosed.
A clinical MRI magnet is superconducting and never switched off. It is at full field when the room is empty, at night, and during a fire. The commonest serious hazard is projectiles: oxygen cylinders, scissors, tools and wheelchairs pulled into the bore with enough force to kill, and the force rises steeply near the bore. Implants may move, heat or malfunction, and many are safe only under stated conditions. Radio frequency energy is limited by the specific absorption rate, and conductive loops, including cables and skin-to-skin contact, can burn. Access is controlled by zones one to four with screening of everything. A hand magnet test is not a safety assessment. Nothing you build enters the magnet room without the MR safety lead's approval.
An ultrasound transducer is an array of piezoelectric elements that deform when driven and generate a voltage when deformed. Each sends a short burst at two to eighteen megahertz and listens. Every boundary between tissues of different acoustic impedance reflects part of the pulse. The machine assumes sound travels at fifteen hundred and forty metres per second in soft tissue, and converts each echo's arrival time into depth, halving the round trip. Between fat and muscle about one percent is reflected. Between tissue and bone about forty percent, giving a bright echo and a shadow. Between tissue and air, more than ninety-nine point nine percent, which is why gel is essential and why ultrasound cannot see through gas.
Higher frequency means shorter wavelength and finer detail. At five megahertz the wavelength in tissue is about a third of a millimetre. But attenuation rises with frequency, about half a decibel per centimetre per megahertz, counted both ways. With a usable dynamic range of about sixty decibels, a three megahertz probe reaches about twenty centimetres, enough for abdomen and heart. A ten megahertz probe reaches about six centimetres, right for tendons, thyroid and needle guidance. That is why there are different probes for different jobs. Frame rate is limited too: each line must wait for the deepest echo, so deeper imaging means fewer frames per second.
Sound reflected from moving blood comes back shifted in frequency, by twice the transmit frequency times the blood speed times the cosine of the angle, divided by the speed of sound. Work the example in this photograph: three point eight megahertz, an angle of sixty degrees, a peak velocity of point eight eight metres per second. The shift is about two point two kilohertz, squarely audible, which is why Doppler machines have loudspeakers. Now see the measurement problem. The machine uses the angle the operator enters. At sixty degrees, a five degree error changes the reported velocity by about fifteen percent, and velocity thresholds grade narrowed arteries. A measurement is only as good as its least controlled input.
Ultrasound is real time, portable, cheap and free of ionising radiation. It is the first test for pregnancy, the gallbladder, kidneys, thyroid and deep vein thrombosis. Echocardiography is the workhorse of cardiology. Bedside point-of-care ultrasound answers yes-or-no questions in minutes, and ultrasound guides needles into vessels, nerves and lesions. Its limits are physics and people. It cannot see through bone or gas, and it is the most operator-dependent modality: the image exists only while someone holds the probe in the right place, and a missed view leaves no record. Machines display a thermal index and a mechanical index, and sonographers keep both low.
A radiopharmaceutical, a biologically meaningful molecule carrying a radioactive atom, distributes by physiology, and a camera detects what comes out. The workhorse is technetium ninety-nine m: one gamma ray at a hundred and forty kilo-electronvolts and a six hour half-life. A gamma camera needs a lead collimator to know where photons came from, and it rejects roughly nine thousand nine hundred and ninety-nine in ten thousand, so images are coarse and noisy. PET uses positron emitters. Each positron annihilates with an electron into two photons of five hundred and eleven kilo-electronvolts flying apart. A ring of detectors looks for coincident pairs, so no collimator is needed, and resolution is four to five millimetres.
The dominant PET tracer is FDG, glucose with radioactive fluorine. Cells take it up like glucose and trap it, so it maps glucose use. Many cancers light up, but so do the brain, heart, active muscle, infection and inflammation, and it is excreted into the bladder. Fluorine eighteen has a half-life of about a hundred and ten minutes, so it is made in a cyclotron and delivered the same morning. PET's headline number, the standardised uptake value, is a measurement with many confounders: glucose, timing, body composition, calibration, and decay correction. In this image's example, forget the decay correction and every value is wrong by a factor of about one point four six. It looks like a lab value; it behaves like a protocol.
Endoscopes put a light and camera inside the body and can take tissue, but they are invasive and hard to clean; outbreaks have been traced to duodenoscopes whose tips could not be reliably cleaned. Many common tests produce a signal rather than an image. The twelve lead ECG gives twelve views of the heart, and ambulatory recorders extend the window from a day to years. Automated blood pressure cuffs find mean pressure from the largest oscillation and estimate the rest, and a cuff too small for the arm over-reads. Spirometry distinguishes obstruction from restriction. Sleep studies record a dozen channels overnight. And for many diseases, above all cancer, a biopsy and histopathology settle what imaging only suggests.
This table shows typical first-line choices, to show the reasoning, not as clinical guidance. A possible fracture gets a plain X-ray. A suspected stroke gets a non-contrast CT, because bleeding must be excluded before clot-dissolving treatment. A suspected leg clot gets compression ultrasound. Gallstones are found by ultrasound. A torn ligament needs MRI. Cancer spread is staged with CT and often PET-CT. Breathlessness that might be asthma or COPD gets spirometry. Notice how often the first choice is the cheapest adequate test, and how often radiation dose shapes the decision for children and in pregnancy.
Look past the hardware and the same handful of ideas recur: exponential attenuation, inverse problems, Fourier transforms, time of flight, resonance and counting statistics. The last deserves its own slide, because it explains more than any other single fact about imaging. When you count random events, the noise is the square root of the count, so signal to noise also rises only as the square root. To halve the noise you need four times the counts: four times the dose, four times the scan time, or a detector four times as sensitive. That is why dose reduction is hard, why nuclear images are grainy, and why better reconstruction is worth so much engineering.
Very little of this is the scanner itself; most of it is everything that surrounds the scanner. CT phantoms can be machined from tissue-equivalent plastics or cast, with densities tuned to target Hounsfield values. MRI phantoms are agarose doped with paramagnetic salts in glass or acrylic containers. Ultrasound needs cast phantoms, probe holders and needle guides. Endoscopy needs storage and drying cabinets. Physiological measurement needs machined test fixtures, pressure and flow rigs, and electronic signal simulators for bench checking, never connected to a person. And there is excellent open software for CT, MRI, ultrasound, PET and ECG work on public data.
Three of the best projects in the whole book are in this chapter, and they use three different skill sets. A laparoscopic box trainer needs sheet material, a camera, lighting and well-designed tasks; it is cheap, wanted and squarely tier one. An ECG or monitor waveform simulator needs a microcontroller, a digital-to-analogue converter, a resistor network for realistic lead amplitudes and an enclosure, for checking and teaching equipment, never for a person. And a CT reconstruction from scratch, simulated projections with Poisson noise reconstructed three ways, teaches more about CT in a weekend than a month of reading.
An educator asks for a life-size knee model to strap into a knee coil on a real scanner table. Your first prototype has acetal bones joined with stainless screws, a cast silicone sleeve, a magnet catch for the kneecap, a coin-cell LED that lights when the leg is correctly rotated, a copper wire nerve, and a webbing strap with a steel buckle. The magnet is the worst item; near the bore it will be pulled violently. Replace the screws with nylon or PEEK and the buckle with plastic. Replace the LED circuit with an alignment mark, and the copper loop, which can heat, with a channel moulded into the silicone. Then follow the process: the MR safety lead decides, not you. Ask where an object will be used before you choose how to fasten it.
For the exercises: reconstruct a three by three grid of numbers from its row and column sums, then add diagonals, and see why CT needs hundreds of angles. Build time-of-flight ranging with a cheap ultrasonic sensor, in air and on objects only. Window a public CT scan and measure the Hounsfield units of air, fat, muscle and bone. Filter an image's k-space in Python. Plan an FDG dose against its decay, and simulate the square-root law. To exit, explain in two sentences each how X-ray, CT, MRI, ultrasound and PET work, and list the materials in an object for an MRI room with who makes the final call.
The limits. You cannot interpret a diagnostic image or trace; that is years of specialist training. You cannot operate diagnostic equipment on people; radiographers, sonographers, physiologists and technologists are trained and usually registered, and exposing someone to radiation needs a legal justification. You cannot declare anything MR Safe or radiation-safe; named specialists make those determinations. The test-choice table shows reasoning, not guidance. And knowing the physics is not a medical physics qualification. Next, treatment and life-support devices: how they work and what they are for.