35.09.01 · health-medicine / medical-diagnostics-imaging

Medical diagnostics and imaging — clinical reasoning and seeing inside the body

shipped3 tiersLean: none

Anchor (Master): Bushberg, The Essential Physics of Medical Imaging (4e, Lippincott, 2021); Webb, Physics of Medical Imaging (2e, 2012); primary sources Röntgen 1895, Hounsfield 1973, Lauterbur 1973, Bayes 1763

Intuition Beginner

When something feels wrong, you see a doctor. The doctor's first job is not to hand you a treatment — it is to figure out what is wrong. That process is called diagnosis. Diagnosis is detective work: gather clues, list the suspects, and use tests to narrow the list. A good clinician is part historian, part scientist, and part probability thinker.

The visit usually begins with a question and a story. "What brings you in?" Then comes the timeline of the problem: when it started, how it changed, what makes it better or worse, and what else is going on in your life. This is the history. Next comes the physical examination: listening to the heart, checking reflexes, feeling the abdomen, looking at the skin. The history and exam together point to the right diagnosis in most cases, before any machine is involved.

When the answer is not clear, the doctor orders tests. Blood tests count cells, measure chemicals, and hunt for microbes. Imaging lets us see inside the body without cutting it open. X-rays show bones. CT scans stack many X-ray views into a detailed cross-section. MRI uses strong magnets and radio waves to map soft tissue like the brain and joints. Ultrasound bounces high-pitched sound off organs to watch a beating heart or a moving fetus. Each modality asks the body a different question.

Here is the catch that surprises almost everyone: a positive test does not always mean you have the disease. Tests err in two directions. They can ring the alarm when nothing is wrong, or they can miss a real problem. Whether you should trust a test depends on how common the disease is in people like you. That single insight — the base rate — is the heart of this unit and the reason doctors think before they scan.

This unit covers the clinical encounter, the reasoning that turns symptoms into a diagnosis, the laboratory and imaging tools that extend human senses, and the probabilistic logic that keeps clinicians from over-trusting any single test. Every piece connects back to how the body works, how disease develops, and how treatment follows once the problem is named.

Visual Beginner

The table below compares the major ways modern medicine sees inside the body. Each modality measures a different physical property, which is why they are complementary rather than interchangeable.

Modality What it measures Best for Uses ionizing radiation?
X-ray Tissue density (shadow) Bones, chest, dental Yes
CT X-ray attenuation per slice Trauma, lungs, complex fractures Yes
MRI Hydrogen proton signal in a magnetic field Brain, spinal cord, joints, soft tissue No
Ultrasound Reflected sound waves Pregnancy, heart, gallbladder, blood flow No
PET Radioactive tracer metabolism Cancer staging, brain function Yes (tracer)
Pathology Cells and tissue under a microscope Confirming cancer, infection No

Worked example Beginner

A rare disease affects 1 in 100 people — a prevalence of 1 percent. A screening test is excellent: it correctly catches 99 of every 100 sick people, and it correctly clears 99 of every 100 healthy people. You take the test and it comes back positive. What is the chance you actually have the disease?

Most people guess around 99 percent. The true answer is about 50 percent. To see why, imagine testing 10,000 people drawn from the general population.

Group Number of people Test positive Test negative
Truly sick (1 percent) 100 99 1
Truly healthy (99 percent) 9,900 99 9,801

Of the 100 truly sick people, 99 test positive because the test catches 99 percent of real cases. Of the 9,900 healthy people, 99 also test positive, because the test gives a false alarm for 1 percent of healthy people. Add them up: 198 people test positive in total, but only 99 of those are truly sick.

The chance that a positive test reflects real disease is 99 out of 198, which is exactly one half. This quantity is the positive predictive value. Even a very good test produces mostly false alarms when the disease is rare. This is why doctors almost never screen the whole population for a rare disease with a single test, and why a positive result is usually followed by a second, more specific test before any treatment begins.

If the same test is used in a high-risk clinic where half the patients are truly sick, the picture reverses: the positive predictive value rises above 99 percent. Same test, different answer — because the base rate of disease changed.

Check your understanding Beginner

Formal definition Intermediate+

A diagnostic test is a procedure that returns a binary or continuous result intended to distinguish between two states of a patient: disease present () or disease absent (). The performance of a binary test is summarized by its agreement with a reference standard (often called the gold standard, frequently a pathology result).

The outcomes of a test applied to patients form a contingency table:

Disease No disease Row total
Test positive ()
Test negative ()
Column total

Here is true positives, false positives, false negatives, and true negatives, with .

Prevalence (pre-test probability) is the proportion of the tested population that has the disease:

Sensitivity (true positive rate, ) is the probability the test is positive given disease:

Specificity (true negative rate, ) is the probability the test is negative given no disease:

The two quantities a clinician actually wants are conditional on the test result rather than on the disease. The positive predictive value () is the probability of disease given a positive test:

The negative predictive value () is the probability of no disease given a negative test:

Two derived quantities govern how a test result should change a clinician's belief. The positive likelihood ratio measures how much a positive result shifts the odds of disease:

The negative likelihood ratio is

A useful rule of thumb: produces a large, often conclusive increase in the probability of disease, while produces a large decrease. Likelihood ratios have the convenient property of being independent of prevalence, unlike and .

The clinical reasoning that uses these definitions is the differential diagnosis: a ranked list of candidate diseases (the differentials) compatible with the history and exam. Each candidate carries a pre-test probability; each test result multiplies the odds by the corresponding likelihood ratio. This is diagnostic reasoning implemented as sequential Bayesian updating.

Key derivation Intermediate+

The fundamental result connecting the four test quantities is Bayes' theorem applied to diagnostic testing. For events (disease) and (positive test),

The denominator is the total probability of a positive test, obtained by conditioning on disease status:

Substituting the test-performance definitions and , and writing for prevalence, yields the predictive-value form of Bayes' theorem:

and, by an identical calculation,

A more practical form uses odds. Defining pre-test odds and post-test odds , the likelihood-ratio form of Bayes' theorem reads

which is the foundation of sequential diagnostic reasoning. Each independent test multiplies the odds by its own likelihood ratio.

Worked numeric verification

Take , , and prevalence . The predictive-value formula gives

confirming the 50 percent result obtained by counting in the Beginner worked example. In odds form, , , so , again giving .

Interpretation: prevalence dominates

The lesson is quantitative, not merely intuitive. The depends on prevalence through a ratio in which the numerator grows with the true-positive count and the denominator is dominated by false positives whenever is small. A test with fixed 99 percent sensitivity and specificity yields values of about 1.0 percent at prevalence , 9 percent at , 50 percent at , and 92 percent at . This is why population-wide screening for rare conditions generates cascades of false alarms, anxiety, and invasive follow-up — the false-positive cascade that anchors modern screening guidelines.

Bridge. This derivation builds toward the imaging-physics and ROC analysis of the Advanced section, and appears again in every clinical decision in the chronic-disease 35.03.01 and infectious-disease 35.02.01 units. The foundational reason diagnostic reasoning works at all is that a likelihood ratio re-scales odds multiplicatively; this is exactly the mechanism a clinician uses at the bedside, and the central insight generalises to any test, imaging modality, or biomarker whose error rates can be characterized. Putting these together, the bridge is a single multiplicative update rule that unifies history, laboratory values, and picture-based imaging into one coherent probabilistic framework.

Exercises Intermediate+

Lean formalization Intermediate+

Diagnostic test metrics are probabilistic and admit a Lean formalization. A contingency structure, together with the four ratios (sensitivity, specificity, predictive values) and Bayes' theorem, can in principle be stated in Mathlib's probability theory framework (ProbabilityTheory, conditional probability, cond). The theorems in the Full proof set below — monotonicity of in prevalence, and the likelihood-ratio odds rule — are statements of elementary real analysis and probability that Mathlib can host.

What Mathlib cannot currently host is the medical-physics content. The Beer-Lambert attenuation law, the Hounsfield scale, the Bloch equations governing nuclear magnetic resonance, -space Fourier reconstruction, and PET tracer kinetics have no representation in any proof-assistant library, and formalizing them would require building empirical physics models from scratch. Likewise there is no ontology of the clinical encounter, the differential diagnosis, or imaging-modality semantics. The lean_status is therefore none, and the formal gap note in the unit metadata records the scope of what would be required.

Advanced results Master

The physics of X-ray and CT: Beer-Lambert attenuation and Hounsfield units

A photon beam of incident intensity passing through tissue of thickness and linear attenuation coefficient emerges with intensity

the Beer-Lambert law. Different tissues attenuate by different amounts: bone has a large (calcium is dense and high-), while air and lung attenuate little. A projection radiograph records the integrated attenuation along each ray path as a single shadow value.

Computed tomography reconstructs a cross-sectional map of from hundreds of angular projections using filtered back-projection (the Radon transform and its inverse). Because raw attenuation coefficients are unwieldy, CT reports the Hounsfield scale:

which fixes water at HU and air at HU. Soft tissues cluster near to HU, fat near HU, bone above HU, and lung around HU. This standardized scale is what allows a clinician to read a CT slice in any hospital in the world and immediately compare tissue densities, and what makes CT exquisitely sensitive to blood (acute hemorrhage reads to HU against to HU brain tissue). The Hounsfield scale also encodes a quantitative handle on dose: because contrast grows with the difference in , dose-reduction strategies must preserve the contrast-to-noise ratio, trading image quality for lower cancer risk from ionizing radiation.

MRI: nuclear magnetic resonance and the Bloch equations

Magnetic resonance imaging exploits the fact that hydrogen nuclei (protons) in water and fat carry a magnetic moment. In a strong static field (typically tesla or tesla in clinical scanners), protons precess at the Larmor frequency

where is the proton gyromagnetic ratio. A radiofrequency pulse tips the net magnetization into the transverse plane; as it relaxes back, it induces a signal in a receiver coil. The longitudinal relaxation time and transverse relaxation time differ between tissues and are the source of MRI's extraordinary soft-tissue contrast.

The dynamics of the magnetization vector are governed by the Bloch equations:

which combine precession with exponential relaxation. A pulse sequence with repetition time and echo time produces a spin-echo signal amplitude

so by tuning and the scanner produces -weighted, -weighted, or proton-density-weighted images. Spatial encoding uses magnetic field gradients to make the Larmor frequency position-dependent, mapping the signal into -space, the spatial-frequency domain; a two-dimensional Fourier transform of -space reconstructs the image. Higher field strength ( T versus T) increases the signal-to-noise ratio roughly linearly in but also increases artifacts and energy deposition.

Ultrasound, PET, and nuclear medicine

Ultrasound emits a pulse of longitudinal sound (typically to MHz) and times the echoes returning from acoustic interfaces. The distance to a reflector is where m/s is the average speed of sound in soft tissue. Acoustic impedance determines how strongly each interface reflects sound; the reflection coefficient at a normal interface is . The Doppler shift measures blood-flow velocity, which is how echocardiography and vascular ultrasound quantify flow.

Positron emission tomography injects a radioactive tracer (most often fluorodeoxyglucose labeled with fluorine-18) and detects the pair of keV photons emitted in opposite directions when a positron annihilates. Coincidence detection localizes the decay along a line, and tomographic reconstruction recovers the tracer distribution. Because the tracer tags glucose metabolism, PET lights up the most metabolically active tissue — typically tumors and active brain regions — and is a cornerstone of cancer staging and functional neuroimaging. The radiation dose from a PET scan comes from the tracer itself, with biological half-life set by both radioactive decay (F half-life minutes) and physiological clearance.

Receiver operating characteristic curves and the ROC/AUC

A continuous test (a laboratory value, an imaging score) does not intrinsically have a single sensitivity and specificity; instead, each possible decision threshold produces a pair . Plotting sensitivity against over all thresholds gives the receiver operating characteristic (ROC) curve. The area under the curve (AUC) summarizes overall discriminative ability: is no better than chance, is perfect, and is generally considered excellent. A classical probabilistic interpretation is that the equals the probability that a randomly chosen diseased subject has a higher test value than a randomly chosen healthy subject. The ROC framework is also the conceptual backbone by which machine-learning classifiers are evaluated on diagnostic tasks, connecting clinical biostatistics to the learning-theory treatment in the statistics curriculum.

Pathology as the gold standard

For most cancers and many infections, the reference standard against which all other tests are measured is pathology: the examination of cells and tissue under a microscope, now augmented by immunohistochemistry and molecular profiling. A biopsy provides a physical sample of the diseased tissue itself, so pathology answers the diagnostic question by direct inspection rather than by inference from a proxy measurement. This is why a radiologist may describe a lung mass as "suspicious for malignancy" while the final diagnosis waits on the pathologist's report. Pathology is not infallible — sampling error, inter-observer disagreement, and ambiguous borderline lesions all occur — but it occupies the top of the diagnostic hierarchy because its measurement is closest to the disease itself.

Synthesis. Putting these together, diagnostic medicine is a single Bayesian engine wearing many sensor hats. The foundational reason each modality matters is that it contributes an independent likelihood ratio; this is exactly how a D-dimer, a CT slice with its Hounsfield densities, an MRI signal governed by the Bloch equations, and a pathology report all enter the same odds-multiplication rule derived in the Key derivation. The central insight generalises across every scale of observation, from a keV photon pair in PET to a cell under a microscope, and the bridge is that clinical reasoning, medical physics, and probability theory are three descriptions of one process: turning uncertain measurements into actionable belief about a hidden state.

Full proof set Master

Proposition 1 (monotonicity of in prevalence)

Let sensitivity and specificity be fixed. Then the positive predictive value

is strictly increasing in the prevalence .

Proof. Write and , so that . The denominator is linear in : . Differentiate using the quotient rule:

The numerator simplifies to , so

Because and , the numerator is strictly positive, and the squared denominator is positive everywhere on . Hence , which proves that is strictly increasing in prevalence. ∎

Corollary. For any test with , as , which is the quantitative statement behind the false-positive cascade: no fixed-accuracy test can sustain a meaningful in a sufficiently rare population.

Proposition 2 (likelihood-ratio odds rule)

Let be the event of disease with prior odds , and let be a positive test result with sensitivity and specificity . Then the posterior odds satisfy

Proof. By the definition of conditional probability, and . Taking the ratio eliminates :

Recognizing and gives as claimed. ∎

Iterated consequence. For conditionally independent tests, applying the rule sequentially yields , which is the formal foundation of sequential differential diagnosis. The conditional-independence hypothesis is the load-bearing assumption: when it fails (as it routinely does in clinical practice), the multiplicative rule overestimates the update and a joint likelihood is required.

Connections Master

The body the diagnostics interrogates

Every test in this unit is an attempt to learn the state of the organ systems, tissues, and feedback loops described in the human-body unit 35.01.01. A complete blood count is only interpretable against the physiology of hematopoiesis and homeostasis; an MRI brain scan is meaningless without the neuroanatomy of gray and white matter; the Hounsfield density of liver tissue presumes knowledge of hepatic architecture. Diagnostic reasoning is applied physiology, and the units are inseparable.

Disease as the target of diagnosis

Diagnostic tests exist to detect and characterize disease. The chronic-disease unit 35.03.01 motivates why cardiovascular risk scores, HbA1c measurement, and cancer staging matter: these are the conditions whose early detection changes outcomes. The infectious-disease unit 35.02.01 supplies the other great target of diagnosis — identifying a pathogen, quantifying immune response, and choosing between colonization and true infection. Imaging and laboratory medicine serve both, and the choice of test is governed by the differential diagnosis those units construct.

Treatment and the pharmacology that follows

A diagnosis without a treatment is a hollow victory. Once the diagnostic loop closes, the pharmacology unit 35.07.01 takes over: the named disease determines the drug, its dose, and its monitoring. Many laboratory tests in this unit (therapeutic drug monitoring, liver-function panels, renal-function panels) exist precisely to guide and safety-check pharmacotherapy, binding diagnostics and pharmacology into a single therapeutic loop.

Screening, populations, and public health

When a diagnostic test moves from a single sick patient to an entire asymptomatic population, the probabilistic analysis of this unit becomes a public-health question. The public-health and epidemiology unit 35.06.01 treats prevalence, incidence, and the balance of benefits and harms at scale, and the false-positive cascade derived above is the central reason screening programs are designed with great care rather than applied universally.

Toward computational and precision medicine

The ROC and AUC machinery introduced here is the same evaluation framework used by machine-learning classifiers, which the precision-medicine unit 35.08.03 pending extends to AI-assisted image reading, polygenic risk scores, and adaptive trial design. The unit on future medicine 35.08.01 carries these threads toward genomics-driven diagnostics and globally distributed decision support, where the same Bayesian engine runs on ever richer inputs.

Historical & philosophical context Master

Röntgen and the discovery of X-rays

In November 1895, Wilhelm Conrad Röntgen was experimenting with a cathode-ray tube covered in black cardboard when he noticed that a nearby barium platinocyanide screen fluoresced. Realizing that an unknown radiation was passing through the opaque covering, he spent seven weeks characterizing the new rays, which he named X-Strahlen for their unknown nature. On 22 December 1895 he made the now-famous radiograph of his wife Bertha's hand, her wedding ring visible as a dark circle against the ghostly bones [Röntgen 1895]. Within months, physicians were using X-rays to locate bullets and fractures; within a year, the first radiology journals appeared. Röntgen received the first Nobel Prize in Physics (1901) and, uniquely for the era, refused to patent the discovery, arguing that it belonged to humanity. The speed of clinical adoption — from laboratory curiosity to standard medical tool in under a decade — has few parallels in the history of science.

Computed tomography: Hounsfield and Cormack

The leap from projection radiographs to true cross-sectional imaging required mathematics as much as engineering. Allan Cormack, working alone in the 1950s and 1960s, developed the mathematical foundations of reconstructing a function from its line integrals (the Radon transform), publishing two papers that were largely ignored. Independently, Godfrey Hounsfield at EMI built the first practical computed-tomography scanner, producing the first clinical CT image of a patient's brain in 1971 at Atkinson Morley's Hospital in London [Hounsfield 1973]. The Hounsfield scale that bears his name standardized tissue density for all subsequent imaging. Cormack and Hounsfield shared the 1979 Nobel Prize in Physiology or Medicine — a notable instance of a physics-derived invention honored by the medical Nobel — underscoring that medical imaging is as much a mathematical as a technological achievement.

MRI: Lauterbur, Mansfield, and Damadian

Nuclear magnetic resonance was developed as a spectroscopic technique by Felix Bloch and Edward Purcell in 1946 (Nobel Prize 1952). The leap to imaging came in the early 1970s. Raymond Damadian reported in 1971 that tumor tissue had different NMR relaxation times from normal tissue, and filed an early patent on whole-body NMR scanning. Paul Lauterbur showed in 1973 that magnetic field gradients could encode spatial information into the NMR signal, producing the first two-dimensional NMR image, and Peter Mansfield developed the mathematical machinery of fast echo-planar imaging that made clinically practical MRI possible [Lauterbur 1973]. Lauterbur and Mansfield shared the 2003 Nobel Prize in Physiology or Medicine; Damadian's exclusion was controversial and he took out full-page newspaper advertisements protesting the decision.

Bayes and the probabilistic revolution in diagnosis

Thomas Bayes' essay on inverse probability was presented posthumously to the Royal Society by Richard Price in 1763 [Bayes 1763] and developed further by Laplace. For most of the twentieth century, clinical medicine reasoned in qualitative terms: a disease was either present or absent, a test positive or negative. The systematic application of Bayesian reasoning to clinical diagnosis — formalizing the way a history and exam set a pre-test probability that each test then updates — is largely a post-war achievement, associated with the work of Lee Lusted, Alvan Feinstein, and the evidence-based medicine movement of the 1990s. The philosophical lesson is durable: certainty is rarely available in medicine, and the honest unit of clinical reasoning is a probability that can be revised, not a verdict that stands alone.

Bibliography Master

Primary sources

  • Röntgen, W.C. (1895). "Ueber eine neue Art von Strahlen (Vorläufige Mitteilung)." Sitzungsberichte der Würzburger Physikalischen-Medicinischen Gesellschaft. [Röntgen 1895]
  • Bayes, T. (1763). "An Essay towards solving a Problem in the Doctrine of Chances." Philosophical Transactions of the Royal Society of London, 53, 370-418. [Bayes 1763]
  • Hounsfield, G.N. (1973). "Computerized transverse axial scanning (tomography): Part 1. Description of system." British Journal of Radiology, 46(552), 1016-1022. [Hounsfield 1973]
  • Lauterbur, P.C. (1973). "Image Formation by Induced Local Interactions: Examples Employing Nuclear Magnetic Resonance." Nature, 242, 190-191. [Lauterbur 1973]
  • Cormack, A.M. (1963-1964). "Representation of a Function by its Line Integrals, with some Radiological Applications." Journal of Applied Physics, 34(9), 2722-2727; 35(10), 2908-2913.

Bibtex

@article{rontgen1895,
  author  = {Röntgen, Wilhelm Conrad},
  title   = {Ueber eine neue Art von Strahlen},
  journal = {Sitzungsberichte der Würzburger Physikalischen-Medicinischen Gesellschaft},
  year    = {1895}
}
@article{bayes1763,
  author  = {Bayes, Thomas},
  title   = {An Essay towards solving a Problem in the Doctrine of Chances},
  journal = {Philosophical Transactions of the Royal Society of London},
  volume  = {53},
  pages   = {370--418},
  year    = {1763}
}
@article{hounsfield1973,
  author  = {Hounsfield, Godfrey N.},
  title   = {Computerized transverse axial scanning (tomography): Part 1. Description of system},
  journal = {British Journal of Radiology},
  volume  = {46},
  number  = {552},
  pages   = {1016--1022},
  year    = {1973}
}
@article{lauterbur1973,
  author  = {Lauterbur, Paul C.},
  title   = {Image Formation by Induced Local Interactions: Examples Employing Nuclear Magnetic Resonance},
  journal = {Nature},
  volume  = {242},
  pages   = {190--191},
  year    = {1973}
}
@article{cormack1963,
  author  = {Cormack, Allan M.},
  title   = {Representation of a Function by its Line Integrals, with some Radiological Applications},
  journal = {Journal of Applied Physics},
  volume  = {34},
  pages   = {2722--2727},
  year    = {1963}
}
@book{bushberg2021,
  author    = {Bushberg, Jerrold T. and Seibert, J. Anthony and Leidholdt, Edwin M. and Boone, John M.},
  title     = {The Essential Physics of Medical Imaging},
  edition   = {4},
  publisher = {Lippincott Williams \& Wilkins},
  year      = {2021}
}
@book{webb2012,
  author    = {Webb, Andrew G.},
  title     = {Physics of Medical Imaging},
  publisher = {Cambridge University Press},
  year      = {2012}
}
@book{bates2020,
  author    = {Bickley, Lynn S. and Szilagyi, Peter G. and Hoffman, Richard M. and Soriano, Richard P.},
  title     = {Bates' Guide to Physical Examination and History Taking},
  edition   = {13},
  publisher = {Lippincott},
  year      = {2020}
}
@book{guyton_hall2021,
  author    = {Hall, John E. and Hall, Michael E.},
  title     = {Guyton and Hall Textbook of Medical Physiology},
  edition   = {14},
  publisher = {Elsevier},
  year      = {2021}
}