A CT scanner reconstructs a map of X-ray attenuation coefficients μ for every pixel of a slice, converted to a standardized Hounsfield Unit scale where water is defined as 0 and air as -1000:
HU = 1000 × (μ_tissue − μ_water) / (μ_water − μ_air)
Real tissue spans roughly -1000 HU (air) to -700 HU (lung) to 0 HU (water) to 40-80 HU (soft tissue/blood) to 700-1500 HU (bone). A display can only show ~256 shades of gray, far fewer than this range, so radiologists pick a window — a center (level) and width — to linearly stretch the shades of interest to full contrast and clip everything else to solid black or white:
lower = WC − WW/2
upper = WC + WW/2
gray = clamp(255 × (HU − lower) / WW, 0, 255)
This exact per-pixel transform is recomputed live, every frame the sliders move, directly from the underlying HU map — nothing is pre-rendered.
- Window Center / Width sliders — set the HU range mapped to the 0-255 grayscale ramp; pixels below it clip to black, pixels above it clip to white.
- Presets — Lung (WC -600, WW 1500) reveals airway and parenchymal detail but flattens bone and soft tissue to white; Bone (WC 500, WW 2000) shows rib structure but flattens all soft tissue to one shade; Soft Tissue and Mediastinum windows narrow the range around 0-80 HU to separate organs, vessels and fat.
- Scanner Noise — toggles a realistic Gaussian HU perturbation (σ≈15 HU) that real CT detectors always add, so the windowed image looks like an actual noisy clinical slice rather than a flat illustration.
- The cross-section is synthetic but uses textbook HU values: air -1000, lung parenchyma -700, fat -90, chest-wall soft tissue 10-40, mediastinal soft tissue/heart 35-50, a great vessel ≈45, a dense 150 HU nodule, and a patchy rib shell at 600-900 HU.
Real-world relevance: this exact center/width mechanism is the "W/L" or "C/W" control on every PACS and DICOM viewer — the same raw slice data is windowed differently by a chest radiologist looking for a nodule than by an orthopedist checking a rib fracture. Hover the image to read the raw HU value under your cursor, exactly like a PACS crosshair readout.