teach me ct scan brain with pathologic findings with real pics
CT brain pathology findings hyperdense hypodense examples radiology education
https://radiologykey.com/imaging-the-head-and-brain
CT brain scan pathology real images epidural subdural subarachnoid hemorrhage infarct tumor radiology teaching
| Tissue | HU | Appearance |
|---|---|---|
| Air | -1000 to -600 | Black |
| Fat | -100 to -60 | Very dark |
| Water / CSF | 0-18 | Dark gray |
| White matter | 30-34 | Medium gray |
| Gray matter | 37-41 | Slightly brighter gray |
| Fresh blood (clotted) | 50-100 | White/bright |
| Bone | 600-2000 | Bright white |
| Stage | Time | CT Appearance |
|---|---|---|
| Acute | 0-7 days | Hyperdense (bright white), crescent-shaped |
| Subacute | 1-3 weeks | Isodense (same as brain - easy to miss!) |
| Chronic | >3 weeks | Hypodense (dark, like CSF) |
| Mixed density | Rebleed | Hyperdense + hypodense layers (hematocrit effect) |
The key CT clues for bilateral isodense SDH: sulci are absent ("supraphysiologic brain"), brain looks too full.



Emergency: Once large enough, EDH causes transtentorial herniation and death. Patients need emergent surgical evacuation.
ICH is distinguished from ischemic stroke by being hyperdense on non-contrast CT. Ischemic stroke is hypodense.
| Time | CT Finding |
|---|---|
| 0-6 hours | Normal OR subtle early signs |
| 6-24 hours | Hypodensity in vascular territory; loss of gray-white differentiation |
| 24h-3 days | Hypodense wedge-shaped area, max swelling by day 3 |
| 7-21 days | Progressive hypodensity, may show hemorrhagic transformation (gyral hyperdensity) |
| >21 days (chronic) | Gliosis, volume loss, sulcal widening adjacent to infarct |
A normal head CT in the first 3 hours of stroke symptoms does NOT exclude ischemic stroke. The most important role in that window is to exclude hemorrhage before giving thrombolytics (tPA/TNK).
| Finding | Density | Shape | Key Feature |
|---|---|---|---|
| Acute SDH | Hyperdense | Crescent | Crosses sutures |
| EDH | Hyperdense | Biconvex | Stops at sutures, lucid interval |
| SAH | Hyperdense | In cisterns/sulci | Fills CSF spaces |
| ICH | Hyperdense | Round/ovoid, in parenchyma | Hypertensive locations |
| Acute infarct (>6h) | Hypodense | Wedge, vascular territory | Loss of gray-white diff. |
| Tumor | Variable | Round/irregular, any location | Ring enhancement, vasogenic edema |
| Abscess | Hypodense core | Round | Smooth ring enhancement |
| Hydrocephalus | Dark | Enlarged ventricles | Temporal horn > 2mm |
ct brain normal with landmarks and pointing each structure ct brain film real time make it easy to learn
normal CT brain axial anatomy labeled landmarks real scan teaching radiology
CT brain axial levels labeled anatomy posterior fossa pons cerebellum basal ganglia ventricles cortex e-anatomy imaios
site:imaios.com CT brain axial labeled anatomy cerebellum pons midbrain cisterns

| Structure | What It Is | Clinical Relevance |
|---|---|---|
| Foramen ovale | Opening in sphenoid bone | Transmits CN V3 (mandibular nerve) |
| Foramen spinosum | Hole in sphenoid | Middle meningeal artery passes through - rupture = epidural hematoma |
| Foramen lacerum | Irregular opening at skull base | Internal carotid passes through |
| Carotid canal | Channel for ICA | ICA dissection visible here on CT-A |
| External acoustic meatus | Ear canal | Fractures here can cause hemotympanum |
| Maxillary sinus | Air-filled paranasal sinus | Dark (air-density); opacification = sinusitis/fracture |
| Nasal septum | Bony midline partition | Deviation, fractures |
Tip: Use bone window settings at this level. Brain window will not show these fine bony details.
| Structure | Appearance | Notes |
|---|---|---|
| Pons | Gray, butterfly-shaped, anterior | Contains CN VI, VII, VIII nuclei |
| Cerebellum | Two hemispheres + vermis (midline) | Coordinates movement; look for midline symmetry |
| Fourth ventricle | Dark midline CSF space between pons and cerebellum | Obstructed = hydrocephalus |
| Cerebellopontine (CP) angle | CSF space at junction of cerebellum + pons | Site of acoustic neuromas (CN VIII tumors) |
| Basilar artery | Small bright dot anterior to pons | May appear hyperdense if thrombosed |
| Mastoid air cells | Honeycomb black (air) behind ear | Opacification = mastoiditis |
| Temporal lobes | Gray matter lateral to pons |
Tip: The posterior fossa has lots of streak artifact from dense surrounding bone (petrous bone). This is NOT pathology.
| Structure | What to Look For |
|---|---|
| Suprasellar cistern | Star-shaped CSF space - should be DARK. If white = subarachnoid blood! |
| Sylvian fissures | Dark CSF-filled grooves lateral to midbrain - if white = SAH |
| Interpeduncular cistern | CSF between cerebral peduncles |
| Midbrain | Central gray structure at this level |
| Temporal horns | Thin slit lateral ventricle horns - if >2mm = early hydrocephalus |
The "5 cisterns" rule: Suprasellar, sylvian (×2), ambient (×2) = all should appear dark (CSF). Filling with blood = subarachnoid hemorrhage.

| Structure | Appearance | Clinical Notes |
|---|---|---|
| Frontal lobe | Anterior gray-white brain | |
| Temporal lobe | Lateral brain, at sides | |
| Parietal lobe | Posterior-lateral | |
| Occipital lobe | Posterior | |
| Insula (insular lobe) | Buried cortex, lateral | Insular ribbon sign - loss = early MCA stroke |
| Frontal horn of lateral ventricle | Dark CSF, anterior | Should be symmetric |
| Third ventricle | Thin dark midline slit | Widened = hydrocephalus |
| Lateral ventricle (atrium) | Posterior dark CSF space | |
| Choroidal fissure | CSF cleft near hippocampus | |
| Basal nuclei (ganglia) | Deep gray structures, slightly brighter than white matter | Hypertensive bleed favorite spot |
| Diencephalon (thalamus) | Paired gray masses on either side of 3rd ventricle |
From outside → in (lateral to medial):
Insular cortex
↓
Extreme capsule (thin white matter)
↓
Claustrum
↓
External capsule
↓
PUTAMEN (lateral basal ganglia - most common hypertensive bleed site)
↓
INTERNAL CAPSULE (posterior limb = motor/sensory tracts)
↓
GLOBUS PALLIDUS (medial to putamen)
↓
THALAMUS (next to 3rd ventricle)
↓
Third ventricle (midline CSF)
↓
CAUDATE HEAD (anterolateral wall of lateral ventricle)
Memory tip - "Hypertensive bleeds like to happen at the 4 Ps": Putamen, Pons, cerebellar Peduncle, Parieto-occipital (lobar - amyloid).

| Structure | Notes |
|---|---|
| Falx cerebri | Bright white midline dural fold - normally midline |
| Lateral ventricles (body) | Large dark CSF spaces |
| Third ventricle | Midline slit between thalami |
| Thalamus | Oval gray structures flanking 3rd ventricle |
| Temporal horn of lateral ventricle | Inferior horn - dilated = hydrocephalus or temporal lobe atrophy |
| Corona radiata | White matter tracts above basal ganglia |
| Choroid plexus | Calcified dots in ventricles (normal variant - bright white) |
| Ambient cistern | CSF around midbrain |
| Tentorium cerebelli | Bright line separating posterior fossa from supratentorial |
| Tentorial notch (incisura) | Opening in tentorium - herniation happens through here |
| Pontocerebellar cistern | CSF space below cerebellum |
| Structure | Notes |
|---|---|
| Centrum semiovale | Upper white matter; where white matter lesions appear (MS, small vessel disease) |
| Falx cerebri | Midline bright dural fold |
| Superior sagittal sinus | Bright structure in midline - DO NOT confuse with subarachnoid blood |
| Sulci and gyri | Should be symmetric; effaced unilaterally = edema/mass; bilaterally widened = atrophy |
| Parietal lobe | Dominant lobe at this level |

| Structure | What to Look For |
|---|---|
| Diploe | Spongy bone between inner and outer tables - appears darker than cortical bone |
| Frontal bone / Parietal bone / Occipital bone | Know which sutures separate them |
| Frontal sinus | Air-filled space in forehead - opacification = sinusitis |
| Calvaria | The skull cap - look for fractures (linear lucent lines) |
| Venous grooves | Normal channels on inner skull surface - don't mistake for fractures |
| Groove for superior sagittal sinus | Midline groove on inner calvaria |
| Frontal crest | Bony ridge where falx attaches anteriorly |
Fracture vs. venous groove: Fractures are straighter, cross sutures, and don't branch. Venous grooves branch and follow predictable paths.

| Structure | Notes |
|---|---|
| Corpus callosum | Genu (front), trunk, splenium (back) - connects hemispheres |
| Septum pellucidum | Thin membrane between lateral ventricles |
| Fornix | Curved white matter tract; part of limbic circuit |
| Anterior & posterior commissures | Midline crossing fiber bundles |
| Pericallosal cistern | CSF above corpus callosum |
| Chiasmatic cistern | Around optic chiasm - optic neuritis/aneurysms here |
| Interpeduncular cistern | Between cerebral peduncles |
| Quadrigeminal cistern | Posterior to midbrain (tectum) |
| Ambient cistern | Around midbrain laterally |
| Vermis of cerebellum | Midline cerebellar structure |
| Posterior cerebellomedullary cistern | Large cistern (cisterna magna) posterior to cerebellum |

See cerebellum + pons? → POSTERIOR FOSSA level
See midbrain + suprasellar? → TENTORIAL / BASAL CISTERN level
See basal ganglia + thalamus? → BASAL GANGLIA level (most important!)
See corpus callosum only? → VENTRICULAR level
See only white matter + sulci? → HIGH CONVEXITY level
| Tissue | HU | Looks Like |
|---|---|---|
| Air (sinuses, ventricles) | -1000 | Black |
| Fat (subcutaneous, orbit) | -100 | Very dark gray |
| CSF (ventricles, cisterns, sulci) | 0-18 | Dark gray |
| White matter | 30-34 | Medium gray |
| Gray matter (cortex, deep nuclei) | 37-41 | Slightly brighter medium gray |
| Fresh blood (clot) | 50-100 | Bright white |
| Calcification / Bone | 600-2000 | Brilliant white |
The gray-white difference is subtle but critical. Loss of this differentiation is the earliest CT sign of ischemic stroke.
ct brain point and landmark on real time film normal anatomy teach me easist way
normal CT brain annotated labeled real film axial slices all levels anatomy teaching
ls /home/daytona/workspace/ && python3 -c "import PIL; print('PIL OK')" && python3 -c "import requests; print('requests OK')"
mkdir -p /home/daytona/workspace/ct-brain-atlas/raw && cd /home/daytona/workspace/ct-brain-atlas/raw && python3 -c " import requests, os imgs = { 'axial_basal_ganglia.jpg': 'https://cdn1.imaios.com/i/images/3/3/2/2/472233-1-eng-GB/brain-ct-axial.jpg?caption=1&q=75&w=1280&s=9f4a6d0e46ac7abdfa410dd8f7907413', 'bone_skull.jpg': 'https://cdn1.imaios.com/i/images/8/6/3/2/472368-1-eng-GB/brain-ct-bones.jpg?caption=1&q=75&w=1280&s=9cbe741ff3807b36e1b7eca6994b25c6', 'cranial_base.jpg': 'https://cdn1.imaios.com/i/images/2/2/4/2/472422-1-eng-GB/brain-ct-cranial-base.jpg?caption=1&q=75&w=1280&s=d0cf67f2623720e995dbf1887c8b8554', 'coronal.jpg': 'https://cdn1.imaios.com/i/images/7/8/2/2/472287-1-eng-GB/brain-ct-coronal.jpg?caption=1&q=75&w=1280&s=34a2301a42f296a949e8f8651f9f18ac', 'sagittal_cisterns.jpg': 'https://cdn1.imaios.com/i/images/0/6/2/2/472260-1-eng-GB/brain-ct-sagittal.jpg?caption=1&q=75&w=1280&s=ba5c2bdad196e90936cfa62f93bf0441', 'sagittal_vessels.jpg': 'https://cdn1.imaios.com/i/images/1/4/3/2/472341-1-eng-GB/brain-ct-dural-venous-sinus.jpg?caption=1&q=75&w=1280&s=7f28d46a0fc4ba8612d51b1a2a617ffa', } headers = {'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36'} for name, url in imgs.items(): r = requests.get(url, headers=headers, timeout=15) if r.status_code == 200: with open(name,'wb') as f: f.write(r.content) print(f'OK {name} {len(r.content)} bytes') else: print(f'FAIL {name} {r.status_code}') "
~/ct-brain-atlas/build_atlas.py
"""
CT Brain Normal Anatomy Atlas
Builds annotated teaching images for each CT level with numbered callouts.
"""
from PIL import Image, ImageDraw, ImageFont
import os, math
RAW = "/home/daytona/workspace/ct-brain-atlas/raw"
OUT = "/home/daytona/workspace/ct-brain-atlas/output"
os.makedirs(OUT, exist_ok=True)
# ── Colour palette ─────────────────────────────────────────────────────────────
DOT_COLORS = {
"yellow": (255, 230, 0),
"cyan": ( 0, 220, 255),
"lime": (100, 255, 60),
"orange": (255, 140, 0),
"pink": (255, 80, 180),
"white": (255, 255, 255),
"red": (255, 60, 60),
"sky": ( 80, 180, 255),
}
# Each annotation: (number, label_text, dot_xy_pct, label_side, color)
# dot_xy_pct = (x%, y%) as fraction of image width/height
ANNOTATIONS = {
# ── AXIAL – BASAL GANGLIA LEVEL ───────────────────────────────────────────
"axial_basal_ganglia.jpg": dict(
title="AXIAL CT – BASAL GANGLIA LEVEL\n(Most important level to master)",
bg_color=(10, 10, 30),
items=[
(1, "Frontal Lobe", (0.40, 0.12), "right", "lime"),
(2, "Temporal Lobe", (0.22, 0.42), "left", "lime"),
(3, "Parietal Lobe", (0.28, 0.78), "left", "lime"),
(4, "Occipital Lobe", (0.47, 0.88), "right", "lime"),
(5, "Insula (insular lobe)", (0.30, 0.31), "left", "yellow"),
(6, "Frontal Horn (Lat.Vent.)", (0.56, 0.22), "right", "cyan"),
(7, "3rd Ventricle", (0.55, 0.36), "right", "cyan"),
(8, "Lateral Ventricle Atrium", (0.59, 0.68), "right", "cyan"),
(9, "Choroidal Fissure", (0.62, 0.58), "right", "sky"),
(10, "Basal Nuclei (Ganglia)", (0.42, 0.34), "left", "orange"),
(11, "Thalamus (Diencephalon)", (0.47, 0.42), "left", "orange"),
(12, "Falx Cerebri (midline)", (0.50, 0.50), "right", "white"),
]
),
# ── BONE / SKULL WINDOW ───────────────────────────────────────────────────
"bone_skull.jpg": dict(
title="AXIAL CT – BONE WINDOW\n(Skull, calvaria, fractures)",
bg_color=(10, 10, 30),
items=[
(1, "Frontal Sinus (air = black)", (0.38, 0.07), "right", "cyan"),
(2, "Frontal Bone", (0.28, 0.13), "left", "white"),
(3, "Squamous Part", (0.21, 0.22), "left", "white"),
(4, "Frontal Crest", (0.31, 0.28), "left", "yellow"),
(5, "Venous Grooves", (0.74, 0.27), "right", "orange"),
(6, "Calvaria (skull cap)", (0.78, 0.34), "right", "white"),
(7, "Diploe (spongy bone)", (0.80, 0.42), "right", "yellow"),
(8, "Parietal Bone", (0.22, 0.50), "left", "pink"),
(9, "Gr. for Sup. Sagittal Sinus", (0.24, 0.62), "left", "orange"),
(10, "Occipital Bone", (0.25, 0.72), "left", "white"),
(11, "Brain Parenchyma (grey/white)", (0.56, 0.50), "right", "lime"),
]
),
# ── CRANIAL BASE ──────────────────────────────────────────────────────────
"cranial_base.jpg": dict(
title="AXIAL CT – CRANIAL BASE LEVEL\n(Foramina, sinuses, ear canals)",
bg_color=(10, 10, 30),
items=[
(1, "Nasal Septum", (0.46, 0.08), "right", "white"),
(2, "Maxillary Sinus (air)", (0.63, 0.30), "right", "cyan"),
(3, "Foramen Ovale (CN V3)", (0.32, 0.44), "left", "yellow"),
(4, "Foramen Spinosum\n(mid. meningeal a.)", (0.34, 0.51), "left", "orange"),
(5, "Foramen Lacerum", (0.35, 0.57), "left", "pink"),
(6, "Carotid Canal (ICA)", (0.30, 0.66), "left", "red"),
(7, "Ext. Acoustic Meatus", (0.25, 0.72), "left", "lime"),
(8, "Posterior Fossa\n(cerebellum)", (0.50, 0.80), "right", "sky"),
]
),
# ── CORONAL VIEW ─────────────────────────────────────────────────────────
"coronal.jpg": dict(
title="CORONAL CT – VENTRICULAR ANATOMY\n(Ventricles, thalami, white matter)",
bg_color=(10, 10, 30),
items=[
(1, "Falx Cerebri", (0.49, 0.06), "right", "white"),
(2, "Lateral Ventricle (body)", (0.36, 0.18), "left", "cyan"),
(3, "3rd Ventricle", (0.56, 0.26), "right", "cyan"),
(4, "Choroid Plexus (3rd vent)", (0.55, 0.22), "right", "yellow"),
(5, "Corona Radiata", (0.34, 0.36), "left", "lime"),
(6, "Choroid Plexus (lat.vent)", (0.30, 0.42), "left", "yellow"),
(7, "Thalamus", (0.30, 0.55), "left", "orange"),
(8, "Temporal Horn (lat.vent)", (0.64, 0.50), "right", "sky"),
(9, "Ambient Cistern", (0.60, 0.44), "right", "cyan"),
(10, "Tentorium Cerebelli", (0.58, 0.62), "right", "pink"),
(11, "Cerebellar Hemisphere", (0.46, 0.78), "right", "lime"),
(12, "Pontocerebellar Cistern", (0.55, 0.88), "right", "cyan"),
]
),
# ── SAGITTAL – CISTERNS ───────────────────────────────────────────────────
"sagittal_cisterns.jpg": dict(
title="SAGITTAL CT – CISTERNS & MIDLINE STRUCTURES\n(Corpus callosum, CSF spaces)",
bg_color=(10, 10, 30),
items=[
(1, "Trunk of Corpus Callosum", (0.69, 0.07), "right", "lime"),
(2, "Genu of Corpus Callosum", (0.31, 0.22), "left", "lime"),
(3, "Splenium Corpus Callosum", (0.71, 0.25), "right", "lime"),
(4, "Septum Pellucidum", (0.26, 0.10), "left", "yellow"),
(5, "Fornix", (0.30, 0.32), "left", "yellow"),
(6, "Anterior Commissure", (0.27, 0.44), "left", "orange"),
(7, "Pericallosal Cistern", (0.24, 0.16), "left", "cyan"),
(8, "Chiasmatic Cistern", (0.24, 0.56), "left", "cyan"),
(9, "Interpeduncular Cistern", (0.66, 0.40), "right", "cyan"),
(10, "Quadrigeminal Cistern", (0.70, 0.36), "right", "sky"),
(11, "Vermis of Cerebellum", (0.71, 0.56), "right", "pink"),
(12, "Posterior Cerebellomedullary\nCistern (Cisterna Magna)", (0.70, 0.74), "right", "cyan"),
]
),
# ── SAGITTAL – VESSELS ────────────────────────────────────────────────────
"sagittal_vessels.jpg": dict(
title="SAGITTAL CT – CEREBRAL VESSELS & DURAL SINUSES\n(CTA / contrast-enhanced)",
bg_color=(10, 10, 30),
items=[
(1, "Superior Sagittal Sinus", (0.68, 0.13), "right", "sky"),
(2, "Inferior Sagittal Sinus", (0.67, 0.07), "right", "sky"),
(3, "Internal Cerebral Veins", (0.66, 0.22), "right", "sky"),
(4, "Vein of Galen", (0.66, 0.30), "right", "sky"),
(5, "Straight Sinus", (0.66, 0.38), "right", "sky"),
(6, "Confluence of Sinuses\n(Torcular Herophili)", (0.68, 0.56), "right", "sky"),
(7, "Anterior Cerebral A. (ACA)", (0.28, 0.36), "left", "red"),
(8, "Ant. Communicating A.\n(most common aneurysm)", (0.28, 0.44), "left", "red"),
(9, "Basilar Artery", (0.27, 0.54), "left", "red"),
(10, "Vertebral A. (V4)", (0.32, 0.46), "left", "red"),
(11, "Occipital Sinus", (0.68, 0.80), "right", "sky"),
]
),
}
def try_get_font(size):
"""Try to load a TTF font, fall back to default."""
paths = [
"/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf",
"/usr/share/fonts/truetype/liberation/LiberationSans-Bold.ttf",
"/usr/share/fonts/truetype/freefont/FreeSansBold.ttf",
"/usr/share/fonts/TTF/DejaVuSans-Bold.ttf",
]
for p in paths:
if os.path.exists(p):
return ImageFont.truetype(p, size)
return ImageFont.load_default()
def draw_callout(draw, dot_xy, number, label, side, color_name, font_label, font_num):
"""Draw a numbered callout: filled circle with number + line + label text."""
col = DOT_COLORS.get(color_name, (255,255,255))
cx, cy = int(dot_xy[0]), int(dot_xy[1])
# Dot (filled circle with dark border)
r = 14
draw.ellipse([cx-r, cy-r, cx+r, cy+r], fill=(0,0,0), outline=col, width=2)
draw.ellipse([cx-r+2, cy-r+2, cx+r-2, cy+r-2], fill=col)
# Number inside dot
num_str = str(number)
bbox = font_num.getbbox(num_str)
nw, nh = bbox[2]-bbox[0], bbox[3]-bbox[1]
draw.text((cx - nw//2, cy - nh//2 - 1), num_str, fill=(0,0,0), font=font_num)
# Leader line
line_len = 55
if side == "right":
lx2 = cx + r + line_len
else:
lx2 = cx - r - line_len
draw.line([(cx + (r if side=="right" else -r), cy), (lx2, cy)], fill=col, width=2)
# Label text (possibly multi-line)
lines = label.split("\n")
line_h = font_label.getbbox("A")[3] + 3
total_h = len(lines) * line_h
ty = cy - total_h // 2
for i, line in enumerate(lines):
bbox = font_label.getbbox(line)
tw = bbox[2] - bbox[0]
if side == "right":
tx = lx2 + 6
else:
tx = lx2 - tw - 6
# Shadow
draw.text((tx+1, ty + i*line_h + 1), line, fill=(0,0,0), font=font_label)
# Text
draw.text((tx, ty + i*line_h), line, fill=col, font=font_label)
def annotate_image(src_path, spec, out_path):
img = Image.open(src_path).convert("RGB")
W, H = img.size
# Add padding on right (or left+right) for labels
PAD_TOP = 85
PAD_SIDE = 0
canvas = Image.new("RGB", (W + PAD_SIDE*2, H + PAD_TOP), spec["bg_color"])
canvas.paste(img, (PAD_SIDE, PAD_TOP))
draw = ImageDraw.Draw(canvas)
font_title = try_get_font(22)
font_label = try_get_font(17)
font_num = try_get_font(13)
# Title
title_lines = spec["title"].split("\n")
for i, tl in enumerate(title_lines):
draw.text((18, 8 + i*28), tl, fill=(255,220,60), font=font_title)
# Draw each annotation
for item in spec["items"]:
num, label, (px, py), side, color = item
# Convert pct to pixel coords (offset by PAD)
cx = PAD_SIDE + int(px * W)
cy = PAD_TOP + int(py * H)
draw_callout(draw, (cx, cy), num, label, side, color, font_label, font_num)
# Legend: number list at bottom
# (skip to keep it clean)
canvas.save(out_path, quality=95)
print(f" Saved: {out_path}")
print("Building CT Brain Atlas annotations...")
for fname, spec in ANNOTATIONS.items():
src = os.path.join(RAW, fname)
out = os.path.join(OUT, fname.replace(".jpg", "_annotated.jpg"))
if os.path.exists(src):
annotate_image(src, spec, out)
else:
print(f" MISSING: {src}")
print("\nDone!")
cd /home/daytona/workspace/ct-brain-atlas && python3 build_atlas.py
~/ct-brain-atlas/build_pdf.py
"""
Assembles the annotated CT images + reference tables into a single PDF atlas.
"""
from reportlab.lib.pagesizes import A4, landscape
from reportlab.platypus import SimpleDocTemplate, Image as RLImage, Paragraph, Spacer, Table, TableStyle, PageBreak, HRFlowable
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib import colors
from reportlab.lib.units import cm, mm
from reportlab.lib.enums import TA_CENTER, TA_LEFT
import os
OUT_DIR = "/home/daytona/workspace/ct-brain-atlas/output"
PDF_PATH = "/home/daytona/workspace/ct-brain-atlas/CT_Brain_Normal_Anatomy_Atlas.pdf"
# Page size: A4 landscape for wide CT images
doc = SimpleDocTemplate(
PDF_PATH,
pagesize=landscape(A4),
rightMargin=1.5*cm, leftMargin=1.5*cm,
topMargin=1.2*cm, bottomMargin=1.2*cm
)
styles = getSampleStyleSheet()
# Custom styles
title_style = ParagraphStyle('AtlasTitle',
fontSize=26, fontName='Helvetica-Bold',
textColor=colors.HexColor('#FFD700'),
backColor=colors.HexColor('#0A0A1E'),
spaceAfter=6, alignment=TA_CENTER,
borderPad=8, leading=32
)
subtitle_style = ParagraphStyle('Subtitle',
fontSize=13, fontName='Helvetica',
textColor=colors.HexColor('#AADDFF'),
alignment=TA_CENTER, spaceAfter=4
)
section_style = ParagraphStyle('Section',
fontSize=16, fontName='Helvetica-Bold',
textColor=colors.HexColor('#FFD700'),
spaceBefore=8, spaceAfter=4
)
body_style = ParagraphStyle('Body',
fontSize=11, fontName='Helvetica',
textColor=colors.HexColor('#E8E8E8'),
spaceAfter=3, leading=15
)
table_header_style = ParagraphStyle('TH',
fontSize=10, fontName='Helvetica-Bold',
textColor=colors.white, alignment=TA_CENTER
)
small_style = ParagraphStyle('Small',
fontSize=9, fontName='Helvetica',
textColor=colors.HexColor('#CCCCCC'),
alignment=TA_CENTER, spaceAfter=2
)
BG = colors.HexColor('#0A0A1E')
TABLE_BG = colors.HexColor('#0D1B2A')
TABLE_HDR = colors.HexColor('#1A3A5C')
TABLE_ALT = colors.HexColor('#0F2030')
GOLD = colors.HexColor('#FFD700')
CYAN = colors.HexColor('#00DCFF')
def make_ref_table(headers, rows):
"""Build a styled reference table."""
data = [headers] + rows
col_widths = None
t = Table(data, colWidths=col_widths, repeatRows=1)
ts = TableStyle([
('BACKGROUND', (0,0), (-1,0), TABLE_HDR),
('TEXTCOLOR', (0,0), (-1,0), colors.white),
('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'),
('FONTSIZE', (0,0), (-1,0), 10),
('ALIGN', (0,0), (-1,-1), 'CENTER'),
('VALIGN', (0,0), (-1,-1), 'MIDDLE'),
('GRID', (0,0), (-1,-1), 0.5, colors.HexColor('#334455')),
('ROWBACKGROUNDS', (0,1), (-1,-1), [TABLE_BG, TABLE_ALT]),
('TEXTCOLOR', (0,1), (-1,-1), colors.HexColor('#D0E8FF')),
('FONTNAME', (0,1), (-1,-1), 'Helvetica'),
('FONTSIZE', (0,1), (-1,-1), 9),
('TOPPADDING', (0,0), (-1,-1), 4),
('BOTTOMPADDING', (0,0), (-1,-1), 4),
('LEFTPADDING', (0,0), (-1,-1), 6),
])
t.setStyle(ts)
return t
# Page width for landscape A4
PW = landscape(A4)[0] - 3*cm # usable width
story = []
# ══════════════════════════════════════════════════════════════════
# COVER PAGE
# ══════════════════════════════════════════════════════════════════
story.append(Spacer(1, 2.5*cm))
story.append(Paragraph("🧠 CT Brain – Normal Anatomy Atlas", title_style))
story.append(Spacer(1, 0.4*cm))
story.append(Paragraph("Real CT Films with Labeled Landmarks • All Axial Levels • Coronal • Sagittal", subtitle_style))
story.append(Spacer(1, 0.3*cm))
story.append(HRFlowable(width="100%", thickness=1.5, color=GOLD, spaceAfter=6))
story.append(Paragraph("How to Read a Head CT", section_style))
intro_text = [
("<b>Orientation:</b> Images viewed from BELOW looking UP. Patient's LEFT = your RIGHT (like looking up from feet).", body_style),
("<b>Density basics:</b> Brighter = more dense (hyperdense). Darker = less dense (hypodense).", body_style),
("<b>Systematic approach – \"Blood Can Be Very Bad\":</b> B = Blood • C = Cisterns • B = Brain • V = Ventricles • B = Bone", body_style),
]
for txt, sty in intro_text:
story.append(Paragraph(txt, sty))
story.append(Spacer(1, 0.3*cm))
# HU Table
story.append(Paragraph("Hounsfield Units (HU) – CT Density Reference", section_style))
hu_table = make_ref_table(
["Tissue", "HU Range", "Appearance on CT", "Clinical Importance"],
[
["Air (sinuses, lungs)", "-1000 to -600", "BLACK", "Pneumocephalus if in brain"],
["Fat", "-100 to -60", "Very dark gray", "Lipoma, dermoid cyst"],
["Water / CSF", "0 to 18", "Dark gray", "Ventricles, cisterns, sulci"],
["White matter", "30 – 34", "Medium gray", "Periventricular changes in MS"],
["Gray matter (cortex)", "37 – 41", "Slightly brighter", "Earliest stroke: grey-white loss"],
["Fresh blood (clot)", "50 – 100", "BRIGHT WHITE", "Hemorrhage; SDH, EDH, SAH, ICH"],
["Calcification / Bone", "600 – 2000", "BRILLIANT WHITE", "Pineal calcification (normal)"],
]
)
story.append(hu_table)
story.append(Spacer(1, 0.4*cm))
story.append(Paragraph("Levels from Bottom to Top (Inferior → Superior)", section_style))
levels_table = make_ref_table(
["Level", "Key Structures Visible", "What to Check"],
[
["1 – Cranial Base", "Foramina, sinuses, ear canals", "Foramen ovale, spinosum, carotid canal"],
["2 – Posterior Fossa", "Cerebellum, pons, 4th ventricle", "4th ventricle open? CP angle clear?"],
["3 – Suprasellar", "Midbrain, basal cisterns, temporal horns","5-pointed cistern open = normal"],
["4 – Basal Ganglia ★", "Basal ganglia, thalamus, lat. ventricles","MOST IMPORTANT LEVEL – check symmetry"],
["5 – Body of Ventricles", "Corpus callosum, lat. ventricles, corona", "Ventricle size; midline shift?"],
["6 – High Convexity", "White matter (centrum semiovale)", "Sulci symmetric? SAH in sulci?"],
["7 – Vertex", "Cortex, sulci, superior sagittal sinus", "Bilateral atrophy vs. normal aging"],
]
)
story.append(levels_table)
story.append(PageBreak())
# ══════════════════════════════════════════════════════════════════
# IMAGE PAGES – one per annotated CT
# ══════════════════════════════════════════════════════════════════
image_specs = [
("axial_basal_ganglia_annotated.jpg",
"LEVEL 4 – AXIAL: BASAL GANGLIA (Most Important Level)",
"This level shows the deepest brain structures. Memorise the layout: cortex → insula → putamen → internal capsule → globus pallidus → thalamus → 3rd ventricle → caudate.",
[
["#", "Structure", "Density", "Clinical Pearl"],
["1", "Frontal Lobe", "Gray (cortex) + white", "Personality, motor planning; glioblastoma common here"],
["2", "Temporal Lobe", "Gray + white", "Memory (hippocampus); herpes encephalitis"],
["3", "Parietal Lobe", "Gray + white", "Spatial awareness, sensory cortex"],
["4", "Occipital Lobe", "Gray + white", "Visual cortex; posterior circulation stroke → vision loss"],
["5", "Insula", "Gray cortex", "Insular Ribbon Sign = earliest MCA stroke sign"],
["6", "Frontal Horn Lat.Vent.", "Dark (CSF)", "Enlarged = hydrocephalus"],
["7", "3rd Ventricle", "Dark slit (CSF)", "Widened in hydrocephalus / thalamic atrophy"],
["8", "Lateral Vent. Atrium", "Dark (CSF)", "Choroid plexus calcification = normal"],
["9", "Choroidal Fissure", "Dark (CSF)", "Dilated = temporal lobe atrophy"],
["10", "Basal Ganglia", "Slightly bright (gray)", "Hypertensive bleed favorite site (putamen)"],
["11", "Thalamus", "Slightly bright (gray)", "Deep infarcts; thalamic bleed = drowsiness"],
["12", "Falx Cerebri", "Bright (dura)", "Should be MIDLINE; shift = mass effect"],
]
),
("bone_skull_annotated.jpg",
"BONE WINDOW – SKULL ANATOMY",
"Always switch to bone window to assess the calvaria. Linear lucent lines = fractures. Diploe = spongy bone between inner and outer cortical tables.",
[
["#", "Structure", "Notes", "Pathology to Look For"],
["1", "Frontal Sinus", "Air = black", "Opacification = sinusitis; fracture → pneumocephalus"],
["2", "Frontal Bone", "Bright white", "Linear fracture = lucent line crossing sutures"],
["3", "Squamous Part", "Temporal bone squama", "Temporal bone fracture → epidural hematoma"],
["4", "Frontal Crest", "Falx attachment", "Landmark for midline"],
["5", "Venous Grooves", "Branch; don't cross sutures","Don't mistake for fracture – grooves branch"],
["6", "Calvaria", "3 layers: inner/outer/diploe","Depressed fracture → surgical elevation"],
["7", "Diploe", "Spongy, slightly darker", "Lytic lesion = metastasis / myeloma"],
["8", "Parietal Bone", "Behind temporal", "Parietal fracture can injure SSS"],
["9", "Sup. Sagittal Sinus Groove", "Midline groove", "SSS thrombosis → venous infarct"],
["10","Occipital Bone", "Posterior", "Contrecoup injury from frontal impact"],
["11","Brain parenchyma", "Gray (brain window better)", "Use brain window to assess brain, bone window for skull"],
]
),
("cranial_base_annotated.jpg",
"LEVEL 1 – CRANIAL BASE (Lowest Slices)",
"The base of the skull shows important foramina and paranasal sinuses. Essential for trauma and skull base tumour evaluation.",
[
["#", "Structure", "Contents", "Clinical Pearl"],
["1", "Nasal Septum", "Bone + cartilage", "Deviation normal; septal haematoma in trauma"],
["2", "Maxillary Sinus", "Air (black)", "Opacification = sinusitis, fracture, blood"],
["3", "Foramen Ovale", "CN V3 (mandibular nerve)", "Perineural spread of parotid tumours"],
["4", "Foramen Spinosum", "Middle meningeal artery", "Rupture = epidural haematoma"],
["5", "Foramen Lacerum", "Fibrocartilage/ICA", "Skull base tumour spread"],
["6", "Carotid Canal", "Internal carotid artery", "ICA dissection visible on CT-A"],
["7", "Ext. Acoustic Meatus","Ear canal", "Haemotympanum in temporal bone fracture"],
["8", "Posterior Fossa", "Cerebellum occupies this", "Foramen magnum = brainstem exits here"],
]
),
("coronal_annotated.jpg",
"CORONAL CT – VENTRICULAR ANATOMY",
"The coronal plane shows the relationship between ventricles, thalami, and white matter tracts. Best for assessing hydrocephalus and temporal horn dilatation.",
[
["#", "Structure", "Normal Appearance", "Pathology"],
["1", "Falx Cerebri", "Midline bright dural fold", "Shift = subdural / mass"],
["2", "Lateral Ventricle", "Symmetric dark CSF spaces", "Asymmetric = obstruction"],
["3", "3rd Ventricle", "Midline slit", "Widened = hydro / atrophy"],
["4", "Choroid Plexus", "Calcified dots (normal)", "Xanthogranulomas – benign"],
["5", "Corona Radiata", "White matter tracts", "MS plaques / lacunar infarcts"],
["6", "Caudate Tail", "Lateral ventricle wall", "Caudate atrophy = Huntington's"],
["7", "Thalamus", "Oval gray masses", "Bilateral lesions = metabolic / Wernicke's"],
["8", "Temporal Horn", "Thin slit (<2mm)", ">2mm = early hydrocephalus or atrophy"],
["9", "Ambient Cistern", "CSF around midbrain", "Effaced = transtentorial herniation!"],
["10", "Tentorium Cerebelli", "Bright dural shelf", "Landmark separating supra from infratentorial"],
["11", "Cerebellar Hemi.", "Gray-white folia pattern", "Infarct in PICA = lateral medullary syndrome"],
["12", "Pontocerebellar Cist.","CSF space", "Mass = acoustic neuroma"],
]
),
("sagittal_cisterns_annotated.jpg",
"SAGITTAL CT – CISTERNS & CORPUS CALLOSUM",
"The sagittal plane reveals midline structures and subarachnoid cisterns beautifully. Cisterns should all be DARK (CSF). White = subarachnoid haemorrhage.",
[
["#", "Structure", "Function", "Clinical Pearl"],
["1", "Corpus Callosum (trunk)", "Connects hemispheres", "Genu: frontal; Splenium: parietal/occipital"],
["2", "Genu Corpus Callosum", "Frontal connections", "Butterfly glioma crosses here"],
["3", "Splenium Corp. Call.", "Posterior connections", "Disconnection syndrome if severed"],
["4", "Septum Pellucidum", "Between lateral ventricles", "Absent = holoprosencephaly"],
["5", "Fornix", "Hippocampal output tract", "Atrophy in Alzheimer's disease"],
["6", "Anterior Commissure", "Connects temporal lobes", "Landmark for stereotactic surgery"],
["7", "Pericallosal Cistern", "CSF above corpus callosum", "SAH: blood fills this cistern"],
["8", "Chiasmatic Cistern", "Around optic chiasm", "Aneurysm of ACA / Acomm ruptures here"],
["9", "Interpeduncular Cist.", "Between cerebral peduncles", "SAH: star-shaped bleed here"],
["10", "Quadrigeminal Cistern", "Posterior to midbrain", "Effaced = upward transtentorial herniation"],
["11", "Vermis Cerebellum", "Midline coordination", "Atrophy = alcoholism"],
["12", "Cisterna Magna", "Large posterior CSF space", "Mega cisterna magna = normal variant"],
]
),
("sagittal_vessels_annotated.jpg",
"SAGITTAL CT – CEREBRAL VESSELS & DURAL SINUSES (CTA)",
"CT angiography shows arteries (bright with contrast) and dural venous sinuses. Key for stroke, aneurysm, and venous thrombosis.",
[
["#", "Structure", "Type", "Clinical Pearl"],
["1", "Superior Sagittal Sinus", "Venous sinus", "Thrombosis → headache + venous infarct (paradoxical)"],
["2", "Inferior Sagittal Sinus", "Venous sinus", "Joins straight sinus at falx free edge"],
["3", "Internal Cerebral Veins", "Deep vein", "Drains basal ganglia / thalamus"],
["4", "Vein of Galen", "Deep vein", "AVM of Galen in neonates → high-output cardiac failure"],
["5", "Straight Sinus", "Venous sinus", "Connects deep veins to torcular"],
["6", "Torcular Herophili", "Venous sinus", "Confluence at internal occipital protuberance"],
["7", "Anterior Cerebral A.", "Artery", "Supplies medial frontal/parietal; A1/A2 aneurysms"],
["8", "Anterior Communicating A.", "Artery", "Most common intracranial aneurysm site!"],
["9", "Basilar Artery", "Artery", "Top of basilar occlusion = 'locked-in' or coma"],
["10", "Vertebral A. (V4)", "Artery", "Dissection after neck manipulation"],
["11", "Occipital Sinus", "Venous sinus", "Variable; present in ~50%"],
]
),
]
for img_file, section_title, description, table_data in image_specs:
img_path = os.path.join(OUT_DIR, img_file)
if not os.path.exists(img_path):
print(f" Missing image: {img_path}")
continue
# Section header
story.append(Paragraph(section_title, section_style))
story.append(HRFlowable(width="100%", thickness=1, color=GOLD, spaceAfter=4))
story.append(Paragraph(description, body_style))
story.append(Spacer(1, 0.25*cm))
# Image — fit to available width
from PIL import Image as PILImage
pil = PILImage.open(img_path)
iw, ih = pil.size
max_w = PW
max_h = 10.5*cm
scale = min(max_w/iw, max_h/ih)
disp_w = iw * scale
disp_h = ih * scale
story.append(RLImage(img_path, width=disp_w, height=disp_h))
story.append(Spacer(1, 0.3*cm))
# Reference table
story.append(make_ref_table(table_data[0], table_data[1:]))
story.append(PageBreak())
# ══════════════════════════════════════════════════════════════════
# QUICK-REFERENCE BACK PAGE
# ══════════════════════════════════════════════════════════════════
story.append(Paragraph("QUICK-REFERENCE: What Am I Looking At?", section_style))
story.append(HRFlowable(width="100%", thickness=1, color=GOLD, spaceAfter=6))
story.append(Paragraph("<b>Which level am I at? → Look for these landmarks:</b>", body_style))
landmark_table = make_ref_table(
["If you see...", "You are at...", "Key structures to identify"],
[
["Cerebellum + pons + 4th ventricle", "Posterior fossa", "Cerebellum, pons, CP angles, mastoid air cells"],
["Midbrain + 5-pointed cistern", "Suprasellar level", "Basal cisterns, temporal horns, ambient cistern"],
["Basal ganglia + thalamus + lat.vent.", "Basal ganglia ★", "Putamen, caudate, internal capsule, 3rd ventricle"],
["Corpus callosum only (no BG)", "Body of ventricles", "Body lat.vent., corpus callosum, corona radiata"],
["White matter only, many sulci", "High convexity", "Centrum semiovale, superior sulci, falx"],
["Cortex only, narrow slices", "Vertex", "Superior sagittal sinus, sulci, parietal cortex"],
]
)
story.append(landmark_table)
story.append(Spacer(1, 0.4*cm))
story.append(Paragraph("<b>Density quick-reference (no numbers needed – just remember):</b>", body_style))
density_table = make_ref_table(
["If it looks...", "It is probably...", "Abnormal if..."],
[
["Black (darkest)", "Air or fat", "Air in brain parenchyma = pneumocephalus"],
["Dark gray", "CSF (ventricles, cisterns)", "Absent cisterns = brainstem compression"],
["Medium gray", "Brain tissue (normal)", "Focal hypodensity = edema / infarct"],
["Slightly brighter", "Gray matter vs white matter","Loss of contrast = early ischemic stroke"],
["Bright white", "Fresh blood / calcium", "New hyperdensity = hemorrhage"],
["Brilliant white", "Bone / iodine contrast", "Dense MCA = thrombosis!"],
]
)
story.append(density_table)
story.append(Spacer(1, 0.4*cm))
story.append(Paragraph("<b>The 5 Cisterns to ALWAYS check (should all be DARK):</b>", body_style))
cistern_table = make_ref_table(
["Cistern", "Location", "If white/filled = "],
[
["Suprasellar cistern", "Above pituitary, star-shaped", "Subarachnoid haemorrhage (SAH)"],
["Sylvian fissure (×2)", "Between frontal + temporal lobes", "SAH or subdural spreading"],
["Ambient cistern (×2)", "Around midbrain laterally", "Herniation effacing it = emergency"],
["Quadrigeminal cistern", "Posterior to midbrain (pineal)", "Upward transtentorial herniation"],
["Interpeduncular cistern", "Between cerebral peduncles", "Aneurysm / SAH from Acomm rupture"],
]
)
story.append(cistern_table)
story.append(Spacer(1, 0.4*cm))
story.append(Paragraph("Source: e-Anatomy / IMAIOS (Micheau & Hoa, 2022) • Neuroanatomy through Clinical Cases 3rd Ed. • Brigham & Women's Head CT Guide", small_style))
# Build
doc.build(story)
print(f"\nPDF atlas saved to:\n {PDF_PATH}")
cd /home/daytona/workspace/ct-brain-atlas && python3 build_pdf.py 2>&1
ls -lh /home/daytona/workspace/ct-brain-atlas/CT_Brain_Normal_Anatomy_Atlas.pdf && ls -lh /home/daytona/workspace/ct-brain-atlas/output/
python3 -c " from PIL import Image img = Image.open('/home/daytona/workspace/ct-brain-atlas/output/axial_basal_ganglia_annotated.jpg') print(f'Size: {img.size}, Mode: {img.mode}') # Verify image content - check it is not blank import numpy as np arr = np.array(img) print(f'Min: {arr.min()}, Max: {arr.max()}, Mean: {arr.mean():.1f}') print('Image OK') "
CT Brain Normal Anatomy Atlas
PDF Document · PDF
| Image | Level | Structures Labeled |
|---|---|---|
axial basal ganglia annotated Image · JPG | ⭐ Most important level | 12 structures: frontal/temporal/parietal/occipital lobes, insula, ventricles, basal ganglia, thalamus, falx |
bone skull annotated Image · JPG | Skull/calvaria | 11 structures: frontal bone, diploe, venous grooves, sinuses, parietal/occipital bones, sagittal sinus groove |
cranial base annotated Image · JPG | Lowest level | 8 structures: foramen ovale, foramen spinosum, carotid canal, maxillary sinus, ear canal |
coronal annotated Image · JPG | Ventricular anatomy | 12 structures: lateral ventricles, 3rd ventricle, thalamus, corona radiata, tentorium, temporal horn |
sagittal cisterns annotated Image · JPG | Midline structures | 12 structures: corpus callosum genu/trunk/splenium, all cisterns, fornix, commissures |
sagittal vessels annotated Image · JPG | Cerebrovascular | 11 structures: ACA, AComm, basilar artery, SSS, straight sinus, vein of Galen, torcular |
Show real pathology examples: hemorrhage vs infarct vs tumor on the same anatomy
CT brain ischemic stroke MCA infarct hypodense wedge real scan labeled teaching radiology
mkdir -p /home/daytona/workspace/ct-brain-atlas/pathology && cd /home/daytona/workspace/ct-brain-atlas/pathology && python3 -c " import requests imgs = { # From textbooks (orris CDN) 'ich_temporal.png': 'https://cdn.orris.care/cdss_images/7cc35d765867ed0e514c3b2c567af15ef930b966901b9e83443c259540e3b81d.png', 'sah_cisterns.png': 'https://cdn.orris.care/cdss_images/756de02eb6c0b258d6d92275421cbf02ac1c614620e157132109fb5f293892c5.png', 'sah_aneurysm.png': 'https://cdn.orris.care/cdss_images/7845f49ce847435117d63b1de4368a33ada3b7db76e8d19f16f7149873f37bc1.png', 'edh_pair.png': 'https://cdn.orris.care/cdss_images/9fd3febacd67f3f133aa40e7915c8263afe26d1a932f42074f23ecf5365172b4.png', 'sdh_acute.png': 'https://cdn.orris.care/cdss_images/f7700f44242f6eab6d2a5cff8fdefc39b93a4a29f4d263dd41f8fcf460dbc063.png', 'sdh_serial.png': 'https://cdn.orris.care/cdss_images/23625ee7d61e35212a7e6827338d698ad56d3c9168fc0fa2050f9585da55aca9.png', # MCA infarct from radiologymasterclass 'mca_infarct.jpg': 'https://www.radiologymasterclass.co.uk/images/ct/ct-brain/templates/mca_infarct/mca_large-12-02.jpg', } headers = {'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64)'} for name, url in imgs.items(): r = requests.get(url, headers=headers, timeout=15) if r.status_code == 200: with open(name,'wb') as f: f.write(r.content) print(f'OK {name} ({len(r.content)//1024}KB)') else: print(f'FAIL {name} {r.status_code}') "
~/ct-brain-atlas/build_pathology_atlas.py
"""
CT Brain Pathology Comparison Atlas
Builds annotated + side-by-side comparison pages for:
Hemorrhage (ICH, EDH, SDH, SAH) vs Ischemic Infarct vs Tumor
"""
from PIL import Image, ImageDraw, ImageFont
from reportlab.lib.pagesizes import A4, landscape
from reportlab.platypus import (SimpleDocTemplate, Image as RLImage, Paragraph,
Spacer, Table, TableStyle, PageBreak, HRFlowable)
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib import colors
from reportlab.lib.units import cm
from reportlab.lib.enums import TA_CENTER, TA_LEFT
import os, textwrap
RAW = "/home/daytona/workspace/ct-brain-atlas/pathology"
OUT = "/home/daytona/workspace/ct-brain-atlas/pathology_out"
PDF = "/home/daytona/workspace/ct-brain-atlas/CT_Brain_Pathology_Atlas.pdf"
os.makedirs(OUT, exist_ok=True)
# ── COLOURS ──────────────────────────────────────────────────────────────────
RED = (255, 50, 50)
YELLOW = (255, 230, 0)
CYAN = ( 0, 220, 255)
LIME = (100, 255, 60)
ORANGE = (255, 140, 0)
PINK = (255, 80, 180)
WHITE = (255, 255, 255)
SKY = ( 80, 180, 255)
GREEN = ( 60, 220, 120)
def try_font(size, bold=True):
paths = [
"/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf" if bold else
"/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf",
"/usr/share/fonts/truetype/liberation/LiberationSans-Bold.ttf",
"/usr/share/fonts/truetype/freefont/FreeSansBold.ttf",
]
for p in paths:
if os.path.exists(p):
return ImageFont.truetype(p, size)
return ImageFont.load_default()
def draw_arrow_label(draw, tip_xy, label, color, font, side="right", offset=60):
"""Draw a filled arrow + label. tip_xy = where arrow points."""
cx, cy = int(tip_xy[0]), int(tip_xy[1])
# Arrow line
if side == "right":
lx = cx + offset
else:
lx = cx - offset
draw.line([(cx, cy), (lx, cy)], fill=color, width=3)
# Arrowhead
ah = 8
if side == "right":
draw.polygon([(cx, cy), (cx+ah, cy-ah//2), (cx+ah, cy+ah//2)], fill=color)
else:
draw.polygon([(cx, cy), (cx-ah, cy-ah//2), (cx-ah, cy+ah//2)], fill=color)
# Label
lines = label.split("\n")
lh = font.getbbox("A")[3] + 2
th = len(lines) * lh
ty = cy - th//2
for i, line in enumerate(lines):
bbox = font.getbbox(line)
tw = bbox[2] - bbox[0]
if side == "right":
tx = lx + 4
else:
tx = lx - tw - 4
# shadow
draw.text((tx+1, ty+i*lh+1), line, fill=(0,0,0), font=font)
draw.text((tx, ty+i*lh), line, fill=color, font=font)
def draw_circle_marker(draw, xy, r, color):
cx, cy = int(xy[0]), int(xy[1])
for w in range(3, 0, -1):
draw.ellipse([cx-r-w, cy-r-w, cx+r+w, cy+r+w], outline=(0,0,0), width=1)
draw.ellipse([cx-r, cy-r, cx+r, cy+r], outline=color, width=3)
def add_title_bar(draw, text, W, col, font):
draw.rectangle([0, 0, W, 46], fill=(10,10,30))
bbox = font.getbbox(text)
tw = bbox[2]-bbox[0]
draw.text(((W-tw)//2, 8), text, fill=col, font=font)
def annotate(src, out_name, title, annotations, title_color=YELLOW, crop=None):
"""
annotations: list of (tip_xy_pct, label, color, side)
tip_xy_pct: (x%, y%) of the *image* (after any crop)
"""
img = Image.open(src).convert("RGB")
if crop:
img = img.crop(crop) # (left, top, right, bottom)
W, H = img.size
PAD = 50 # top title bar
canvas = Image.new("RGB", (W, H + PAD), (10,10,30))
canvas.paste(img, (0, PAD))
draw = ImageDraw.Draw(canvas)
font_title = try_font(20)
font_label = try_font(15)
add_title_bar(draw, title, W, title_color, font_title)
for (px, py), label, color, side in annotations:
tip = (int(px * W), PAD + int(py * H))
draw_arrow_label(draw, tip, label, color, font_label, side)
draw_circle_marker(draw, tip, 6, color)
out_path = os.path.join(OUT, out_name)
canvas.save(out_path, quality=95)
print(f" {out_path}")
return out_path
print("Building pathology annotations...")
paths = {}
# ─────────────────────────────────────────────────────────────────────────────
# 1. ICH – Intracerebral Hemorrhage (right temporal lobe)
# ─────────────────────────────────────────────────────────────────────────────
paths["ich"] = annotate(
os.path.join(RAW, "ich_temporal.png"),
"ich_annotated.jpg",
"INTRACEREBRAL HEMORRHAGE (ICH) – Right Temporal Lobe",
[
((0.30, 0.35), "HYPERDENSE MASS\n(50-100 HU = fresh blood)", RED, "right"),
((0.22, 0.28), "Round/oval shape\n= ICH characteristic", YELLOW, "right"),
((0.52, 0.50), "Contralateral\nnormal brain\n(gray = correct density)", LIME, "left"),
((0.18, 0.55), "Skull (white)\n= bone", WHITE, "right"),
],
title_color=RED
)
# ─────────────────────────────────────────────────────────────────────────────
# 2. SAH – Subarachnoid Hemorrhage (diffuse, sulci & cisterns)
# ─────────────────────────────────────────────────────────────────────────────
paths["sah"] = annotate(
os.path.join(RAW, "sah_cisterns.png"),
"sah_annotated.jpg",
"SUBARACHNOID HEMORRHAGE (SAH) – Blood fills CSF spaces",
[
((0.72, 0.22), "HYPERDENSE BLOOD\nin sulci & cisterns", RED, "left"),
((0.30, 0.18), "Blood in\nright sulci", ORANGE, "right"),
((0.47, 0.48), "Interhemispheric\nfissure blood", RED, "right"),
((0.48, 0.70), "Blood tracking\nalong gyri", ORANGE, "left"),
((0.58, 0.35), "Ventricles\nstill dark (ok)", CYAN, "left"),
],
title_color=ORANGE
)
# ─────────────────────────────────────────────────────────────────────────────
# 3. SAH (aneurysmal) – LEFT panel (basal cisterns level)
# Crop left half of the paired image
# ─────────────────────────────────────────────────────────────────────────────
img_sah2 = Image.open(os.path.join(RAW, "sah_aneurysm.png")).convert("RGB")
W2, H2 = img_sah2.size
left_half = img_sah2.crop((0, 0, W2//2, H2))
left_half.save(os.path.join(RAW, "sah_basilar_left.png"))
paths["sah_basilar"] = annotate(
os.path.join(RAW, "sah_basilar_left.png"),
"sah_basilar_annotated.jpg",
"SAH – Basilar Aneurysm Rupture (Basal Cisterns + IVH)",
[
((0.50, 0.30), "Bilateral\nhyperdense blood\nin cisterns", RED, "left"),
((0.28, 0.52), "Blood in\n3rd ventricle\n(IVH)", ORANGE, "right"),
((0.52, 0.64), "Enlarged temporal\nhorns = acute\nhydrocephalus!", YELLOW, "left"),
((0.75, 0.55), "Blood layering\nin posterior\nhorn (CSF level)", RED, "left"),
],
title_color=ORANGE
)
# ─────────────────────────────────────────────────────────────────────────────
# 4. EDH – Epidural Hematoma (left panel of pair = brain window)
# ─────────────────────────────────────────────────────────────────────────────
img_edh = Image.open(os.path.join(RAW, "edh_pair.png")).convert("RGB")
W3, H3 = img_edh.size
edh_brain = img_edh.crop((0, 0, W3//2, H3))
edh_brain.save(os.path.join(RAW, "edh_brain.png"))
paths["edh"] = annotate(
os.path.join(RAW, "edh_brain.png"),
"edh_annotated.jpg",
"EPIDURAL HEMATOMA (EDH) – Lens / Biconvex Shape",
[
((0.15, 0.35), "BICONVEX\nhyperdense\ncollection\n= EDH", RED, "right"),
((0.28, 0.52), "Brain pushed\nmedially\n(mass effect)", YELLOW, "right"),
((0.60, 0.50), "Contralateral\nnormal brain", LIME, "left"),
((0.50, 0.25), "Falx cerebri\n(midline)", WHITE, "right"),
],
title_color=RED
)
# ─────────────────────────────────────────────────────────────────────────────
# 5. SDH acute – Acute Subdural Hematoma
# ─────────────────────────────────────────────────────────────────────────────
paths["sdh"] = annotate(
os.path.join(RAW, "sdh_acute.png"),
"sdh_annotated.jpg",
"ACUTE SUBDURAL HEMATOMA (SDH) – Crescent Shape + Midline Shift",
[
((0.15, 0.38), "CRESCENT-SHAPED\nhyperdense SDH\n(crosses sutures)", RED, "right"),
((0.60, 0.40), "MIDLINE SHIFT\nto left = mass effect\n(brain swelling)", YELLOW, "left"),
((0.48, 0.48), "Falx displaced\nto left", ORANGE, "right"),
((0.78, 0.35), "Compressed\nright hemisphere", PINK, "left"),
],
title_color=RED
)
# ─────────────────────────────────────────────────────────────────────────────
# 6. MCA infarct – Ischemic Stroke
# ─────────────────────────────────────────────────────────────────────────────
paths["infarct"] = annotate(
os.path.join(RAW, "mca_infarct.jpg"),
"mca_infarct_annotated.jpg",
"ISCHEMIC STROKE – MCA Territory Infarct (HYPODENSE)",
[
((0.32, 0.35), "LARGE HYPODENSE\nwedge = MCA\nterritory infarct", CYAN, "right"),
((0.40, 0.52), "Loss of\ngray-white\ndifferentiation", YELLOW, "right"),
((0.62, 0.38), "Mass effect:\nventricle\ncompressed", ORANGE, "left"),
((0.70, 0.55), "Contralateral\nnormal\nbrain density", LIME, "left"),
((0.46, 0.22), "Falx still\nmidline (no\nlarge shift yet)", WHITE, "right"),
],
title_color=CYAN
)
print("\nAll pathology images annotated.")
print("\nBuilding PDF...")
# ─────────────────────────────────────────────────────────────────────────────
# PDF ATLAS
# ─────────────────────────────────────────────────────────────────────────────
doc = SimpleDocTemplate(PDF, pagesize=landscape(A4),
rightMargin=1.2*cm, leftMargin=1.2*cm,
topMargin=1*cm, bottomMargin=1*cm)
styles = getSampleStyleSheet()
BG = colors.HexColor('#0A0A1E')
GOLD_C= colors.HexColor('#FFD700')
CYAN_C= colors.HexColor('#00DCFF')
RED_C = colors.HexColor('#FF3232')
GRN_C = colors.HexColor('#64FF3C')
def sty(name, **kw):
return ParagraphStyle(name, **kw)
title_sty = sty('T', fontSize=24, fontName='Helvetica-Bold',
textColor=GOLD_C, alignment=TA_CENTER, spaceAfter=4, leading=30)
sub_sty = sty('S', fontSize=11, fontName='Helvetica',
textColor=colors.HexColor('#AADDFF'), alignment=TA_CENTER, spaceAfter=6)
sec_sty = sty('Sec', fontSize=15, fontName='Helvetica-Bold',
textColor=GOLD_C, spaceBefore=6, spaceAfter=3)
body_sty = sty('B', fontSize=10, fontName='Helvetica',
textColor=colors.HexColor('#E0E8FF'), spaceAfter=2, leading=14)
small_sty = sty('Sm', fontSize=8, fontName='Helvetica',
textColor=colors.HexColor('#AAAAAA'), alignment=TA_CENTER)
def make_table(headers, rows, col_widths=None):
data = [headers] + rows
t = Table(data, colWidths=col_widths, repeatRows=1)
ts = TableStyle([
('BACKGROUND', (0,0), (-1,0), colors.HexColor('#1A3A5C')),
('TEXTCOLOR', (0,0), (-1,0), colors.white),
('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'),
('FONTSIZE', (0,0), (-1,0), 9),
('ALIGN', (0,0), (-1,-1), 'CENTER'),
('VALIGN', (0,0), (-1,-1), 'MIDDLE'),
('GRID', (0,0), (-1,-1), 0.5, colors.HexColor('#334455')),
('ROWBACKGROUNDS', (0,1), (-1,-1),
[colors.HexColor('#0D1B2A'), colors.HexColor('#0F2030')]),
('TEXTCOLOR', (0,1), (-1,-1), colors.HexColor('#D0E8FF')),
('FONTNAME', (0,1), (-1,-1), 'Helvetica'),
('FONTSIZE', (0,1), (-1,-1), 8),
('TOPPADDING', (0,0), (-1,-1), 3),
('BOTTOMPADDING', (0,0), (-1,-1), 3),
('LEFTPADDING', (0,0), (-1,-1), 5),
])
t.setStyle(ts)
return t
PW = landscape(A4)[0] - 2.4*cm # usable width
def img_flowable(path, max_w, max_h):
from PIL import Image as PILImage
pil = PILImage.open(path)
iw, ih = pil.size
scale = min(max_w/iw, max_h/ih)
return RLImage(path, width=iw*scale, height=ih*scale)
story = []
# ── COVER ────────────────────────────────────────────────────────────────────
story.append(Spacer(1, 1.5*cm))
story.append(Paragraph("🧠 CT Brain – Pathology Comparison Atlas", title_sty))
story.append(Paragraph("Real CT Films: Hemorrhage • Infarct • Tumor • Side-by-Side", sub_sty))
story.append(HRFlowable(width="100%", thickness=1.5, color=GOLD_C, spaceAfter=8))
story.append(Paragraph("The #1 Rule: Bright = Blood / Bone / Calcium | Dark = CSF / Edema / Infarct", body_sty))
story.append(Spacer(1, 0.3*cm))
# Master comparison table
story.append(Paragraph("Master Comparison: Hemorrhage vs Infarct vs Tumor", sec_sty))
comp_table = make_table(
["Condition", "CT Density", "Shape", "Location", "Time Course", "Emergency?"],
[
["ICH", "HYPERDENSE (white)", "Round/oval", "Deep: putamen, thalamus,\npons, cerebellum", "Sudden onset", "YES – urgent BP control"],
["EDH", "HYPERDENSE (white)", "BICONVEX\n(lens-shaped)", "Between skull & dura\n(temporal most common)", "Minutes-hours\n(lucid interval)", "SURGICAL EMERGENCY"],
["Acute SDH", "HYPERDENSE (white)", "CRESCENT\n(concave)", "Between dura & arachnoid\n(crosses sutures)", "Trauma → rapid", "Often surgical"],
["Chronic SDH", "HYPODENSE (dark)", "Crescent", "Same as SDH", "Weeks-months", "Conservative vs burr hole"],
["SAH", "HYPERDENSE (white)", "Fills sulci &\ncisterns", "CSF spaces: Sylvian,\nbasal cisterns, sulci", "Thunderclap HA\n'worst of life'", "YES – secure aneurysm"],
["Ischemic Stroke", "HYPODENSE (dark)", "WEDGE (vascular\nterritory)", "Cortex + white matter\n(respects vascular territory)", ">6h for CT change\nfirst 3h often normal", "YES – tPA window"],
["Tumor (GBM)", "Mixed/ring", "Round, irregular", "Any location – no\nvascular territory pattern", "Weeks of\nwaxing symptoms", "Neurosurgery referral"],
["Abscess", "Hypodense core\n+ ring enhance", "Round, smooth ring", "Any – often frontal\nor temporal", "Days-weeks\nfever + neuro signs", "Drain + antibiotics"],
]
)
story.append(comp_table)
story.append(PageBreak())
# ── HEMORRHAGE SECTION ────────────────────────────────────────────────────────
story.append(Paragraph("SECTION 1: HEMORRHAGE – 'Bright White = Blood'", sec_sty))
story.append(HRFlowable(width="100%", thickness=1, color=RED_C, spaceAfter=6))
story.append(Paragraph(
"All hemorrhages appear <b>HYPERDENSE (bright white)</b> on non-contrast CT in the acute phase "
"because clotting blood has high HU (50-100). They differ in <b>SHAPE and LOCATION</b>.",
body_sty))
story.append(Spacer(1, 0.3*cm))
# 4 hemorrhage images in 2x2 grid
hem_imgs = [
(paths["ich"], "ICH – Round hyperdense mass\nIN brain parenchyma\nHypertensive bleed (putamen)"),
(paths["edh"], "EDH – Biconvex lens shape\nBETWEEN skull & dura\nArterial (middle meningeal a.)"),
(paths["sdh"], "SDH – Crescent shape\nOver brain convexity\nVenous (bridging veins)"),
(paths["sah"], "SAH – Fills cisterns & sulci\nIN subarachnoid space\nAneurysm rupture"),
]
cell_w = PW / 2 - 0.5*cm
cell_h = 8.5*cm
grid_data = [[],[]]
for i, (p, cap) in enumerate(hem_imgs):
cell = [img_flowable(p, cell_w, cell_h - 1.2*cm),
Paragraph(cap, small_sty)]
grid_data[i//2].append(cell)
# Flatten for table
t_data = []
for row in grid_data:
t_data.append(row)
grid = Table(t_data, colWidths=[cell_w, cell_w])
grid.setStyle(TableStyle([
('ALIGN', (0,0),(-1,-1),'CENTER'),
('VALIGN', (0,0),(-1,-1),'TOP'),
('GRID', (0,0),(-1,-1), 1, colors.HexColor('#334455')),
('BACKGROUND',(0,0),(-1,-1), colors.HexColor('#05050F')),
('TOPPADDING',(0,0),(-1,-1),4),
('BOTTOMPADDING',(0,0),(-1,-1),4),
]))
story.append(grid)
story.append(PageBreak())
# ── SAH BASILAR – separate page ───────────────────────────────────────────────
story.append(Paragraph("EXTRA: SAH from Basilar Artery Aneurysm + Hydrocephalus", sec_sty))
story.append(HRFlowable(width="100%", thickness=1, color=colors.HexColor('#FF8C00'), spaceAfter=6))
story.append(Paragraph(
"Basilar artery aneurysm rupture fills the <b>basal cisterns</b> and can cause <b>intraventricular hemorrhage (IVH)</b> "
"and <b>acute hydrocephalus</b> (enlarged temporal horns). Life-threatening emergency.",
body_sty))
story.append(Spacer(1, 0.2*cm))
story.append(img_flowable(paths["sah_basilar"], PW * 0.55, 11*cm))
story.append(Spacer(1, 0.3*cm))
story.append(make_table(
["Finding on CT", "Meaning", "Why it happens"],
[
["Blood in basal cisterns", "SAH – subarachnoid hemorrhage", "Blood fills CSF space around brainstem"],
["Hyperdense 3rd ventricle", "Intraventricular hemorrhage (IVH)", "Blood enters via foramen of Monro"],
["Enlarged temporal horns", "ACUTE HYDROCEPHALUS", "Blood blocks arachnoid granulations → CSF backup"],
["Blood-CSF level in vent.", "Hematocrit effect", "Dense blood sinks below lighter CSF"],
]
))
story.append(PageBreak())
# ── ISCHEMIC INFARCT ──────────────────────────────────────────────────────────
story.append(Paragraph("SECTION 2: ISCHEMIC STROKE / INFARCT – 'Dark Wedge = Dead Brain'", sec_sty))
story.append(HRFlowable(width="100%", thickness=1, color=CYAN_C, spaceAfter=6))
story.append(Paragraph(
"Ischemic stroke appears <b>HYPODENSE (dark)</b> because dead neurons swell with water. "
"Key: the hypodensity follows a <b>VASCULAR TERRITORY</b> (wedge-shaped), not random. "
"First 3-6 hours CT may be <b>completely normal</b> – this does NOT exclude stroke!",
body_sty))
story.append(Spacer(1, 0.2*cm))
infarct_time_table = make_table(
["Time Since Stroke", "CT Appearance", "What You See", "Action"],
[
["0 – 3 hours\n(Hyperacute)", "NORMAL or subtle", "Loss of gray-white diff.\nInsular ribbon sign\nHyperdense MCA sign", "Give tPA if eligible!\nCT normal ≠ no stroke"],
["3 – 6 hours\n(Early acute)", "Subtle HYPODENSITY", "Faint dark area in\ncortex/basal ganglia", "Still tPA window\nConsider thrombectomy"],
["6 – 24 hours\n(Acute)", "Clear HYPODENSITY", "Wedge dark area\nSulcal effacement\nMass effect", "Thrombectomy if LVO\nAntiplatelets/anticoag"],
["1 – 7 days\n(Subacute)", "Dense hypodensity\n+ mass effect", "Max swelling, midline\nshift if large\n'Fogging' = isodense", "Monitor for herniation\nHemicraniectomy if needed"],
["> 3 weeks\n(Chronic)", "VERY HYPODENSE\n(CSF-like)", "Encephalomalacia\nEx vacuo ventricle\nwidened sulci", "Rehab, secondary\nprevention"],
]
)
story.append(infarct_time_table)
story.append(Spacer(1, 0.3*cm))
story.append(img_flowable(paths["infarct"], PW * 0.5, 10*cm))
story.append(PageBreak())
# ── KEY DIFFERENTIATORS ────────────────────────────────────────────────────────
story.append(Paragraph("SECTION 3: HOW TO TELL THEM APART – Quick Differentiator", sec_sty))
story.append(HRFlowable(width="100%", thickness=1, color=GRN_C, spaceAfter=6))
diff_table = make_table(
["Question to Ask", "Hemorrhage", "Infarct", "Tumor"],
[
["What color?", "WHITE (hyperdense)", "DARK (hypodense)", "Variable (mixed/ring)"],
["What shape?", "Round / crescent / fills\ncisterns (depends on type)", "WEDGE following\nvascular territory", "Round, irregular –\nNOT vascular pattern"],
["Is it in the cortex only?", "No – all layers involved", "Yes (cortex + white matter)", "May spare cortex early"],
["Any surrounding edema?", "Rim of dark edema in\ndays 2-3", "IS the edema", "Prominent\nfinger-like vasogenic edema"],
["Midline shift?", "Yes if large", "Yes if large + swollen", "Yes if large"],
["Ring enhancement\n(with contrast)?", "No", "No (except subacute gyral)", "YES – irregular ring\n= GBM / mets / abscess"],
["Fits vascular territory?", "No (except\nhemorrhagic infarct)", "YES – always", "No – random location"],
["Onset?", "Sudden (seconds)", "Sudden (seconds-minutes)", "Gradual (days-weeks)"],
["Fever?", "No", "No", "Possible if abscess"],
]
)
story.append(diff_table)
story.append(Spacer(1, 0.5*cm))
story.append(Paragraph("<b>The 3 Golden Questions when you see an abnormality on CT:</b>", body_sty))
q_table = make_table(
["Question", "Answer → Diagnosis"],
[
["Is it WHITE (hyperdense)?", "→ Think BLOOD (hemorrhage of any type)"],
["Is it DARK (hypodense)?", "→ Think INFARCT (if wedge/vascular) or TUMOR EDEMA (if finger-like)"],
["Does it have a ring on contrast?", "→ Think GBM, metastasis, or brain abscess"],
],
col_widths=[PW*0.38, PW*0.58]
)
story.append(q_table)
story.append(Spacer(1, 0.4*cm))
story.append(Paragraph(
"Sources: Frameworks for Internal Medicine | Adams & Victor's Neurology 12e | "
"Plum & Posner's Stupor and Coma | Bailey & Love's Surgery 28e | "
"Radiologymasterclass.co.uk | PMC CT Imaging in Neurocritical Care",
small_sty))
doc.build(story)
print(f"\nPDF saved: {PDF}")
cd /home/daytona/workspace/ct-brain-atlas && python3 build_pathology_atlas.py 2>&1
ls -lh /home/daytona/workspace/ct-brain-atlas/CT_Brain_Pathology_Atlas.pdf && ls -lh /home/daytona/workspace/ct-brain-atlas/pathology_out/
CT Brain Pathology Atlas
PDF Document · PDF

ich annotated
Image · JPG

edh annotated
Image · JPG

sdh annotated
Image · JPG

sah annotated
Image · JPG

sah basilar annotated
Image · JPG

mca infarct annotated
Image · JPG
| Question | Answer |
|---|---|
| Is it WHITE? | → BLOOD (ICH = in brain, EDH = biconvex, SDH = crescent, SAH = fills cisterns) |
| Is it DARK + wedge-shaped? | → ISCHEMIC INFARCT (follows vascular territory) |
| Ring on contrast CT? | → TUMOR (GBM/mets = thick irregular ring) or ABSCESS (thin smooth ring) |
| Shape | = Diagnosis |
|---|---|
| Round white blob IN brain | = ICH |
| Biconvex (lens) white at skull edge | = EDH (arterial, lucid interval) |
| Crescent white over convexity | = SDH (venous, crosses sutures) |
| White filling sulci/cisterns | = SAH (aneurysm until proven otherwise) |
| Dark wedge in vascular territory | = Ischemic stroke |
| Dark area + finger-like extensions | = Tumor with vasogenic edema |
| Dark core + bright ring + contrast | = GBM or abscess |
Generate a clinical decision tree: 'How to read a head CT in 60 seconds'
ls /home/daytona/workspace/ct-brain-atlas/ && python3 -c "import PIL, reportlab; print('deps OK')"
teach me in easy way multiple myeloma consultant level and at the end of discussion arrange mcqs for better understanding
MGUS (monoclonal gammopathy of undetermined significance)
↓ ~1%/year progress
Smoldering MM (asymptomatic)
↓ ~10%/year progress
Symptomatic MM (active myeloma - treat!)

| Variant | Description |
|---|---|
| Typical | Eccentric nucleus, perinuclear clearing (Golgi), "clock-face" chromatin |
| Plasmablast | Vesicular chromatin, single prominent nucleolus - aggressive |
| Flame cell | Fiery red cytoplasm |
| Mott cell | Multiple "grape-like" cytoplasmic droplets (Russell bodies) |
| Russell bodies | Cytoplasmic Ig globules |
| Dutcher bodies | Nuclear Ig inclusions |
| Condition | Plasma Cells in BM | M Protein | Symptoms | Action |
|---|---|---|---|---|
| MGUS | <10% | IgG/A/M <30g/L or urine <500mg/24h | None | Watch: 1%/year → MM |
| Smoldering MM | 10-30% | IgG/A ≥30g/L or urine ≥500mg/24h | None (no CRAB) | Watch or trial |
| Symptomatic MM | ≥10% or plasmacytoma | Present (or nonsecretory) | CRAB / SLiM | Treat now |
| Solitary plasmacytoma | Normal BM | Usually none | Single bone/soft tissue lesion | Radiotherapy |
| Plasma cell leukemia | >20% circulating PCs | Present | Aggressive | Treat urgently |
| POEMS syndrome | Present | VEGF elevated | Polyneuropathy, organomegaly, endocrinopathy, M-protein, skin | Complex Rx |
| Letter | Criterion | Threshold |
|---|---|---|
| C - Hypercalcemia | Ca >0.25 mmol/L above ULN | or >2.75 mmol/L (>11 mg/dL) |
| R - Renal insufficiency | CrCl <40 mL/min | or creatinine >177 μmol/L (>2 mg/dL) |
| A - Anemia | Hb >20g/L below LLN | or Hb <100 g/L |
| B - Bone lesions | ≥1 osteolytic lesion | on X-ray, CT, or PET-CT |
| Letter | Criterion | Value |
|---|---|---|
| Sixty | Clonal BM plasma cells | ≥60% |
| Light chains | Involved:uninvolved FLC ratio | ≥100 |
| MRI | Focal lesions on MRI | >1 focal lesion |
Key teaching point: A patient with ≥60% plasma cells in the marrow but NO CRAB = still symptomatic myeloma and needs treatment - this is the SLiM criteria update (IMWG 2014).


| Test | Finding | What It Means |
|---|---|---|
| SPEP | M-spike in gamma region | Monoclonal protein - proceed to immunofixation |
| Serum immunofixation | Confirms class (IgG/A/M/D/E) + light chain (κ or λ) | IgG most common (~55%), IgA (~20%) |
| Serum free light chains | Κ or λ, ratio (normally 0.26-1.65) | High ratio = light chain restricted, ratio ≥100 = SLiM criteria |
| Urine SPEP + immunofixation (24h) | Bence Jones protein | Free light chains excreted in urine |
| Bone marrow biopsy/aspirate | Plasma cell % (≥10%), clonality | Gold standard for diagnosis |
| Stage | β2-Microglobulin | Albumin | Median OS |
|---|---|---|---|
| I | <3.5 mg/L | ≥35 g/L | 62 months |
| II | Neither I nor III | - | 44 months |
| III | ≥5.5 mg/L | - | 29 months |
Note: Chromosome 13q deletion and t(11;14) alone do NOT predict high-risk disease.


| Class | Agent | Mechanism | Key Toxicity |
|---|---|---|---|
| Proteasome inhibitor (PI) | Bortezomib (V) | Blocks 26S proteasome → unfolded protein accumulation → apoptosis | Peripheral neuropathy, thrombocytopenia |
| PI (2nd gen) | Carfilzomib (K) | Irreversible PI - more potent | Cardiotoxicity, hypertension |
| PI (oral) | Ixazomib | Oral PI | Nausea, diarrhoea |
| IMiD | Lenalidomide (R) | Cereblon binding → Ikaros/Aiolos degradation → anti-MM effect | DVT! (give prophylactic aspirin/anticoag), myelosuppression |
| IMiD | Thalidomide | Older agent, more neuropathy | Neuropathy, DVT, teratogenesis |
| IMiD (3rd gen) | Pomalidomide | Used in relapsed/refractory | Cytopenias |
| Anti-CD38 Ab | Daratumumab (D) | CD38 is highly expressed on plasma cells | Infusion reactions (premedicate), infections |
| Anti-SLAMF7 Ab | Elotuzumab | Immune-activating via NK cells | Infusion reactions |
| Alkylating agent | Melphalan | DNA cross-linking | Myelosuppression |
| Corticosteroid | Dexamethasone | Anti-myeloma + anti-inflammatory | Hyperglycaemia, Cushingoid features |
| BCL-2 inhibitor | Venetoclax | For t(11;14) patients specifically | Tumour lysis syndrome |
| BCMA-targeted | Teclistamab, Carvykti (CAR-T) | Bispecific T-cell engager / CAR-T | CRS, neurotoxicity |
Allogenic SCT is rarely used - high treatment-related mortality; reserved for very young high-risk patients on clinical trials.
| Complication | Treatment |
|---|---|
| Bone disease | Bisphosphonates (zoledronic acid) for all with bone involvement; RANKL inhibitor (denosumab) if renal failure |
| Spinal cord compression | Dexamethasone immediately + urgent radiotherapy/surgery |
| Hypercalcaemia | IV saline + bisphosphonates ± calcitonin |
| Renal failure | Hydration; avoid nephrotoxins; bortezomib-based Rx (not renal dose-adjusted); dialysis if severe |
| Anaemia | EPO agents; blood transfusions |
| Infections | Prophylactic acyclovir (with bortezomib), IVIG if recurrent serious infections; pneumococcal/influenza vaccines |
| DVT (with IMiDs) | Aspirin or LMWH depending on risk |
| Hyperviscosity | Plasmapheresis |
Rouleaux formation is characteristic but NOT specific - also seen in lupus, early HIV, other hypergammaglobulinaemia states.
teach me diabetes mellitus briefly with types and with complications specially focu on diabetic foot thier examination investigation and management with classfifcation get materal from harrison and more other books if relevant make it precise detailed and relavant
An error occurred (ValidationException) when calling the ConverseStream operation: The model returned the following errors: messages.13.content.30.image.source.base64.data: At least one of the image dimensions exceed max allowed size for many-image requests: 2000 pixels
We encountered an error while processing your request. Please try again or reach out to us for help.