Give me detailed classification of stroke including all the types & then detailed about circle of willi's - PG level answer with using textbook like Susan B O sullivan

| Type | Duration | Definition |
|---|---|---|
| TIA (Transient Ischemic Attack) | <24 hours (typically <1 hour) | Transient neurological deficit, no infarction on MRI |
| RIND (Reversible Ischemic Neurological Deficit) | <72 hours | Now largely abandoned term |
| Completed Stroke | Permanent deficit | Established infarction |
| Stroke-in-evolution | Progressing | Worsening deficits over hours |
| Territory | Vessel | Key Deficits |
|---|---|---|
| Anterior | ACA | Contralateral leg > arm weakness (medial homunculus); abulia, alien hand |
| Middle | MCA (dominant) | Contralateral face/arm > leg weakness; Broca's or Wernicke's aphasia; hemianopia; hemisensory loss |
| Middle | MCA (non-dominant) | Contralateral face/arm > leg weakness; hemispatial neglect; anosognosia |
| Posterior | PCA | Contralateral hemianopia; cortical blindness (bilateral); thalamic pain; alexia without agraphia |
| Posterior fossa | Basilar / vertebral | Diplopia, dysarthria, dysphagia, ataxia, crossed sensorimotor deficits, locked-in syndrome |
| Brainstem | Perforators | Various alternating/crossed syndromes (Wallenberg, Weber, etc.) |


| Component | Origin |
|---|---|
| ACA (A1 segments - bilateral) | Terminal ICA |
| Anterior communicating artery (AComm) | Joins two ACAs |
| ICA (bilateral, supraclinoid) | Carotid system |
| PComm (bilateral) | ICA to PCA |
| PCA (P1 segments - bilateral) | Basilar tip |
| Basilar artery (top) | Vertebral junction |
| Site | Frequency | Clinical Pearl |
|---|---|---|
| AComm | ~30% | Most common; rupture causes SAH; may compress ACA |
| PComm (ICA-PComm junction) | ~25% | Presents with CN III palsy (ptosis, mydriasis, ophthalmoplegia) from compression of CN III |
| MCA bifurcation (M1-M2) | ~20% | Often presents with hemispheric hematoma |
| ICA bifurcation | ~10% | |
| Basilar tip | ~5-10% | "Top of the basilar" syndrome; bilateral PCA territory infarcts + thalamic infarcts |
| PICA origin | ~5% | Lateral medullary (Wallenberg) syndrome |
| Subtype | % of Ischemic Strokes | Key Investigation | Secondary Prevention |
|---|---|---|---|
| Large vessel atherosclerosis | ~25% | Carotid duplex, CTA/MRA | Antiplatelet + statin + revascularization if indicated |
| Cardioembolism | ~20% | Echocardiogram, Holter/telemetry | Anticoagulation (AF → warfarin/DOAC) |
| Small vessel (lacunar) | ~25% | MRI (DWI <1.5cm); BP control | Antiplatelet + aggressive BP/DM management |
| Other determined | ~5% | Hypercoag panel, vessel imaging | Depends on etiology |
| Cryptogenic/ESUS | ~25% | Prolonged cardiac monitoring | Antiplatelet; consider DOAC if high embolic risk |
| Hemorrhagic | ~20% total | CT head (gold standard acute) | BP control; reverse anticoagulation |
great now write it in notes formate flowchart easy to read & remember but coverd everything
STROKE
(Focal neuro deficit
of vascular origin)
│
┌─────────────────┴──────────────────┐
│ │
ISCHEMIC (80%) HEMORRHAGIC (20%)
│ │
┌─────┴──────┐ ┌─────────┴──────────┐
│ │ │ │
THROMBOTIC EMBOLIC INTRACEREBRAL SUBARACHNOID
(in situ) (distant HEMORRHAGE (ICH) HEMORRHAGE
source) ~15% (SAH) ~5%
│ │
↓ ↓
Large Cardiogenic
vessel OR Artery-to-
thrombosis artery
ISCHEMIC STROKE
│
┌─────────────┼──────────────┐──────────────┬────────────────┐
│ │ │ │ │
LARGE SMALL CARDIO- OTHER CRYPTO-
VESSEL VESSEL EMBOLIC CAUSE GENIC
ATHERO- (LACUNAR) │ │ (ESUS)
SCLEROSIS │ │ │
│ │ (see (see
~25% ~25% Box A) Box B) ~25%
~20% ~5%
┌─────────────────────────────────────────────────────────┐
│ MECHANISM: │
│ ► In-situ thrombosis on atherosclerotic plaque │
│ ► OR artery-to-artery embolism from proximal stenosis │
│ │
│ VESSELS: ICA > MCA > Vertebral > Basilar │
│ │
│ CLINICAL CLUES: │
│ ✦ Stuttering/stepwise onset │
│ ✦ Preceded by TIAs │
│ ✦ Cortical signs: aphasia, neglect, hemianopia │
│ │
│ CRITERIA: │
│ ► >50% stenosis on imaging │
│ ► Cortical or cerebellar infarct on MRI │
│ │
│ Rx: Antiplatelet + Statin + Revascularization │
└─────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────┐
│ MECHANISM: │
│ ► Lipohyalinosis / microatheroma of deep perforators │
│ ► Chronic hypertension → Charcot-Bouchard aneurysms │
│ │
│ SITES: Putamen > Thalamus > Pons > Internal capsule │
│ > Corona radiata │
│ │
│ CLASSIC SYNDROMES (must memorize): │
│ ✦ Pure Motor Hemiparesis → Post. limb IC / pons │
│ ✦ Pure Sensory Stroke → Thalamus (VPL) │
│ ✦ Sensorimotor Stroke → Thalamo-capsular │
│ ✦ Ataxic Hemiparesis → Pons / IC │
│ ✦ Dysarthria-Clumsy Hand → Pons / IC │
│ │
│ IMAGING: DWI infarct < 1.5 cm; no cortical involvement│
│ │
│ ⚠ CAVEAT: Deep WM infarcts can be embolic — always │
│ exclude large vessel + cardiac source first! │
│ │
│ Rx: Antiplatelet + strict BP/DM/lipid control │
└─────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────┐
│ MECHANISM: Embolus from heart → cerebral artery │
│ ~20% of all ischemic strokes │
│ │
│ BOX A — CARDIAC SOURCES │
│ ┌────────────────────────────────────────┐ │
│ │ HIGH RISK: │ │
│ │ ► Atrial fibrillation (LAA thrombus) │ │
│ │ ► Recent MI (mural thrombus) │ │
│ │ ► Prosthetic valve │ │
│ │ ► Dilated cardiomyopathy (low EF) │ │
│ │ ► Cardiac myxoma │ │
│ │ ► Infective endocarditis │ │
│ │ │ │
│ │ MEDIUM RISK: │ │
│ │ ► Patent foramen ovale (PFO) │ │
│ │ ► Atrial septal aneurysm │ │
│ │ ► Mitral valve prolapse │ │
│ └────────────────────────────────────────┘ │
│ │
│ CLINICAL CLUES: │
│ ✦ SUDDEN onset, maximal at onset │
│ ✦ Multiple territory infarcts → always cardiac │
│ ✦ Hemorrhagic transformation common │
│ ✦ May have AF on ECG/Holter │
│ │
│ Rx: Anticoagulation (warfarin / DOAC) │
└─────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────┐
│ BOX B — THINK "YOUNG STROKE" │
│ │
│ VASCULAR: │
│ ► Arterial dissection (carotid/vertebral) │
│ ► Fibromuscular dysplasia │
│ ► Moyamoya disease │
│ ► CADASIL (hereditary WM disease) │
│ │
│ INFLAMMATORY / VASCULITIS: │
│ ► Primary CNS vasculitis │
│ ► SLE, antiphospholipid syndrome │
│ ► Temporal arteritis, PAN, Wegener's │
│ │
│ HYPERCOAGULABLE: │
│ ► Protein C/S deficiency, Factor V Leiden │
│ ► Antithrombin III deficiency │
│ ► Prothrombin gene mutation │
│ ► Antiphospholipid antibodies │
│ ► Sickle cell, polycythemia, hyperviscosity │
│ │
│ INFECTIONS: HIV, syphilis, TB meningitis │
│ DRUGS: Cocaine, amphetamines │
│ OTHER: Migraine-associated infarction │
└─────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────┐
│ CRYPTOGENIC: No cause found after full workup │
│ │
│ ESUS (Embolic Stroke of Undetermined Source): │
│ ► Non-lacunar infarct on neuroimaging │
│ ► No AF detected │
│ ► No >50% ipsilateral large-artery stenosis │
│ ► No high-risk cardiac source │
│ ► Implies occult embolism │
│ │
│ Rx: Antiplatelet; prolonged cardiac monitoring │
└─────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────┐
│ MECHANISM: Global/regional hypoperfusion → │
│ ischemia at border zones between 2 territories │
│ │
│ ZONES & DEFICITS: │
│ ┌─────────────────────────────────────────┐ │
│ │ ACA-MCA watershed │ │
│ │ → Proximal arm > leg weakness │ │
│ │ → "MAN IN THE BARREL" syndrome │ │
│ │ │ │
│ │ MCA-PCA watershed │ │
│ │ → Higher-order visual disturbance │ │
│ │ → Transcortical aphasia │ │
│ │ → Balint syndrome (bilateral) │ │
│ └─────────────────────────────────────────┘ │
│ │
│ TRIGGERS: Cardiac arrest, severe hypotension, │
│ tight carotid stenosis + hypotensive │
│ episode │
└─────────────────────────────────────────────────────────┘
HEMORRHAGIC STROKE
│
┌─────────────┴───────────────┐
│ │
ICH SAH
(Intraparenchymal) (Subarachnoid)
~15% ~5%
│ │
├── HTN → basal ganglia ├── Berry aneurysm (85%)
│ putamen (MC) │ at CoW bifurcations
├── Amyloid angiopathy │
│ → lobar (elderly) ├── AVM rupture
├── AVM / cavernoma │
├── Anticoagulants └── Perimesencephalic
├── Cocaine nonaneurysmal SAH
├── Hemorrhagic transformation (benign; venous)
└── Cerebral venous thrombosis
┌──────────────────────────────────────────────────────────┐
│ SITE │ CAUSE │ KEY DEFICIT │
├──────────────────────────────────────────────────────────┤
│ Putamen (35%) │ HTN │ Contralat. motor + │
│ │ │ hemisensory │
├──────────────────────────────────────────────────────────┤
│ Thalamus (20%) │ HTN │ Sensory > motor; │
│ │ │ eye deviation DOWN │
├──────────────────────────────────────────────────────────┤
│ Pons (10%) │ HTN │ Quadriplegia; │
│ │ │ pinpoint pupils │
├──────────────────────────────────────────────────────────┤
│ Cerebellum │ HTN / AVM │ Ataxia; NO motor │
│ (15%) │ │ deficit initially │
├──────────────────────────────────────────────────────────┤
│ Lobar (WM) │ Amyloid │ Variable; elderly; │
│ │ angiopathy │ recurrent bleeds │
└──────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────┐
│ PRESENTATION: │
│ ✦ "THUNDERCLAP" headache — worst in life │
│ ✦ Sentinel headache days before (warning leak) │
│ ✦ Neck stiffness, photophobia, vomiting │
│ ✦ CN III palsy → PComm aneurysm │
│ │
│ ANEURYSM SITES AT CIRCLE OF WILLIS: │
│ AComm ~30% (MC overall) │
│ PComm ~25% (CN III palsy) │
│ MCA bifurc. ~20% │
│ ICA bifurc. ~10% │
│ Basilar tip ~5-10% (top of basilar syndrome) │
└─────────────────────────────────────────────────────────┘
DURATION OF DEFICIT
│
├── <24 hrs, no infarct on MRI ─── TIA
│ (typically <1 hour in practice)
│
├── Progressing over hours ──────── STROKE-IN-EVOLUTION
│
└── Permanent, established ──────── COMPLETED STROKE
AORTA
│
┌───────┴────────┐
│ │
BRACHIOCEPHALIC L. COMMON
ARTERY CAROTID
│
┌─┴──────────────┐
│ │
R. COMMON R. SUBCLAVIAN
CAROTID │
│ VERTEBRAL A.
│ │
CAROTID ascends through
BIFURCATION foramina
│ transversaria
│ │
├── ECA │
│ enters foramen
└── ICA magnum
│ │
(4 SEGMENTS) │
│ │
CERVICAL │
PETROUS ┌───┘
CAVERNOUS │
SUPRACLINOID ├── joins at
│ pontomedullary
│ junction
│
BASILAR
ARTERY
│
└── BASILAR TIP
│
┌────┴────┐
│ │
L.PCA R.PCA
ANTERIOR COMMUNICATING A. (AComm)
│
┌─────────┴────────┐
│ │
L.ACA R.ACA
│ │
L.ICA R.ICA
(supraclinoid) (supraclinoid)
│ │
L.PComm R.PComm
│ │
L.PCA R.PCA
└─────────┬────────┘
│
BASILAR TIP
(basilar artery)
COMPLETE RING present in only ~34% of individuals!
┌─────────────────────────────────────────────────────────┐
│ O — Ophthalmic artery │
│ (→ optic foramen; retinal supply) │
│ P — Posterior communicating artery (PComm) │
│ (→ links ICA to PCA; aneurysm → CN III palsy) │
│ A — Anterior choroidal artery │
│ (→ posterior limb IC, optic tract, hippocampus) │
│ A — Anterior cerebral artery (ACA) │
│ M — Middle cerebral artery (MCA) │
└─────────────────────────────────────────────────────────┘
┌──────────────┬──────────────────────────────────────────┐
│ SEGMENT │ COURSE / NOTE │
├──────────────┼──────────────────────────────────────────┤
│ Cervical │ Vertical in neck; NO branches │
├──────────────┼──────────────────────────────────────────┤
│ Petrous │ Carotid canal; horizontal bend │
├──────────────┼──────────────────────────────────────────┤
│ Cavernous │ S-curve = carotid siphon; within │
│ │ cavernous sinus │
├──────────────┼──────────────────────────────────────────┤
│ Supraclinoid│ Pierces dura; enters subarachnoid space │
│ (intracranial) gives OPAAM branches │
└──────────────┴──────────────────────────────────────────┘
VERTEBRAL ARTERY
├── Posterior inferior cerebellar a. (PICA)
│ → lateral medulla + inferior cerebellum
│ → PICA infarct = Wallenberg syndrome
├── Anterior spinal artery
└── Posterior spinal artery
BASILAR ARTERY
├── AICA (anterior inferior cerebellar a.)
│ → lateral pons + anterior inferior cerebellum
├── Pontine perforators
│ → medial pons
├── SCA (superior cerebellar a.)
│ → superior cerebellum + midbrain
└── PCA (terminal) × 2
→ occipital lobe + medial temporal + thalamus
┌──────────────────────────────────────────────────────────────┐
│ ARTERY │ TERRITORY │ INFARCT DEFICITS │
├──────────────────────────────────────────────────────────────┤
│ ACA │ Medial frontal + │ Leg > arm weakness │
│ │ anterior parietal │ Abulia, alien hand │
│ │ (medial homunculus) │ Urinary incontinence │
├──────────────────────────────────────────────────────────────┤
│ MCA │ Lateral convexity │ Face + arm > leg │
│ dominant │ frontal/parietal/temp. │ Broca's / Wernicke's │
│ │ │ Hemianopia │
├──────────────────────────────────────────────────────────────┤
│ MCA │ Same territory │ Face + arm > leg │
│ non-dom │ │ Hemispatial NEGLECT │
│ │ │ Anosognosia │
├──────────────────────────────────────────────────────────────┤
│ PCA │ Occipital, medial │ Homonymous hemianopia │
│ │ temporal, thalamus │ (macula SPARED) │
│ │ │ Thalamic pain │
│ │ │ Alexia w/o agraphia │
├──────────────────────────────────────────────────────────────┤
│ Basilar │ Pons, midbrain, │ Diplopia, dysarthria │
│ │ cerebellum │ Dysphagia, ataxia │
│ │ │ Crossed syndromes │
│ │ │ Locked-in (total occ) │
└──────────────────────────────────────────────────────────────┘
┌──────────────────────┬─────────────────────────────────────┐
│ ARTERY │ DEEP STRUCTURES SUPPLIED │
├──────────────────────┼─────────────────────────────────────┤
│ Lenticulostriate │ Putamen, caudate, globus pallidus, │
│ (from MCA M1) │ posterior limb internal capsule │
├──────────────────────┼─────────────────────────────────────┤
│ Heubner's recurrent │ Head of caudate, │
│ (from ACA A1-A2) │ anterior limb internal capsule │
├──────────────────────┼─────────────────────────────────────┤
│ Thalamoperforators │ Thalamus (medial, intralaminar) │
│ (from P1 / PComm) │ │
├──────────────────────┼─────────────────────────────────────┤
│ Ant. choroidal │ Post. limb IC, optic tract, │
│ (from ICA) │ hippocampus, lateral geniculate │
├──────────────────────┼─────────────────────────────────────┤
│ Pontine perforators │ Medial pons (paramedian) │
│ (from basilar) │ → lacunar strokes in pons │
└──────────────────────┴─────────────────────────────────────┘
CORONAL VIEW (simplified):
Medial surface Lateral surface
│ │
ACA territory MCA territory
│ │
←──── ACA-MCA WATERSHED ────→
(parasagittal strip)
DEFICIT: proximal arm/shoulder weakness
"MAN IN THE BARREL"
MCA territory PCA territory
│ │
←── MCA-PCA WATERSHED ──────→
(posterior parieto-occipital)
DEFICIT: visual processing, transcortical aphasia
┌─────────────────────────────────────────────────────────────┐
│ STROKE PEARLS — DON'T MISS │
├─────────────────────────────────────────────────────────────┤
│ ► Stroke ~80% ischemic / ~20% hemorrhagic │
│ ► TOAST: Large vessel 25% | Lacunar 25% | │
│ Cardioembolic 20% | Other 5% | Cryptogenic 25% │
│ ► Multiple territories = CARDIAC source until proven │
│ otherwise │
│ ► Deep WM infarct ≠ always lacunar; rule out emboli │
│ ► Complete CoW in only ~34% of people │
│ ► PComm aneurysm → CN III palsy (surgical emergency) │
│ ► AComm aneurysm = MC SAH site (~30%) │
│ ► Basilar tip occlusion = bilateral thalami + occipital │
│ lobes + cerebellar infarcts │
│ ► "Man in barrel" = ACA-MCA watershed │
│ ► Thunderclap headache = SAH until proven otherwise │
│ ► tPA window: 4.5 hours from onset │
│ ► Thrombectomy: up to 24 hours (with penumbral imaging) │
│ ► PICA infarct = Wallenberg syndrome │
│ (ipsilat. face numbness + contralat. body numbness) │
│ ► Putamen = MC site of HTN-related ICH │
└─────────────────────────────────────────────────────────────┘
ICA branches (supraclinoid): O P A A M
Ophthalmic
Posterior communicating
Anterior choroidal
Anterior cerebral
Middle cerebral
LACUNAR syndromes: "Pure Motor, Pure Sensory, Senso-Motor,
Ataxic Hemi, Dysarthria-Clumsy Hand"
HTN ICH sites (frequency): "Put That Pons Carefully Lobar"
Putamen > Thalamus > Pons >
Cerebellum > Lobar
SAH aneurysm sites: A-COMM is the MOST COMMON
P-COMM gives CN 3 compression
BASILAR TIP = bilateral PCA devastation
TOAST order: Large, Small, Cardio, Other, Cryptogenic
"Loud Students Create Outstanding Chaos"
Create a printable PDF quick reference card for stroke classification & CoW anatomy
ls -la /tmp/workspace/ 2>/dev/null || mkdir -p /tmp/workspace && echo "workspace ready"
mkdir -p /tmp/workspace/stroke-refcard && python3 -c "from reportlab.lib import colors; print('reportlab OK')"
~/stroke-refcard/build_card.py
"""
Stroke & Circle of Willis - Printable Quick Reference Card
A4 landscape, 2 pages — built with ReportLab
"""
from reportlab.lib.pagesizes import A4, landscape
from reportlab.lib import colors
from reportlab.lib.units import mm, cm
from reportlab.platypus import (
SimpleDocTemplate, Table, TableStyle, Paragraph, Spacer,
HRFlowable, KeepTogether
)
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_RIGHT
from reportlab.platypus.flowables import Flowable
from reportlab.graphics.shapes import Drawing, Rect, String, Line, Polygon
from reportlab.graphics import renderPDF
# ── Colour Palette ────────────────────────────────────────────────────────────
C_NAVY = colors.HexColor("#1a2e4a")
C_CRIMSON = colors.HexColor("#c0392b")
C_TEAL = colors.HexColor("#1abc9c")
C_AMBER = colors.HexColor("#f39c12")
C_PURPLE = colors.HexColor("#8e44ad")
C_BLUE = colors.HexColor("#2980b9")
C_GREEN = colors.HexColor("#27ae60")
C_ORANGE = colors.HexColor("#e67e22")
C_LIGHT = colors.HexColor("#ecf0f1")
C_DARKGRAY = colors.HexColor("#2c3e50")
C_MIDGRAY = colors.HexColor("#7f8c8d")
C_WHITE = colors.white
C_PALE_RED = colors.HexColor("#fdecea")
C_PALE_BLU = colors.HexColor("#e8f4fd")
C_PALE_GRN = colors.HexColor("#eafaf1")
C_PALE_YLW = colors.HexColor("#fef9e7")
C_PALE_PUR = colors.HexColor("#f5eef8")
C_PALE_TEA = colors.HexColor("#e8f8f5")
PAGE_W, PAGE_H = landscape(A4) # 297 × 210 mm
MARGIN = 8 * mm
# ── Style helpers ─────────────────────────────────────────────────────────────
def sty(name, **kw):
base = getSampleStyleSheet()["Normal"]
kw.setdefault("fontName", "Helvetica")
kw.setdefault("fontSize", 7.5)
kw.setdefault("leading", 10)
kw.setdefault("textColor", C_DARKGRAY)
return ParagraphStyle(name, parent=base, **kw)
H1 = sty("H1", fontName="Helvetica-Bold", fontSize=16, leading=20,
textColor=C_WHITE, alignment=TA_CENTER)
H2 = sty("H2", fontName="Helvetica-Bold", fontSize=9, leading=12,
textColor=C_WHITE, alignment=TA_CENTER)
H3 = sty("H3", fontName="Helvetica-Bold", fontSize=8, leading=11,
textColor=C_NAVY)
BODY= sty("BODY",fontSize=7, leading=9.5)
BODW= sty("BODW",fontSize=7, leading=9.5, textColor=C_WHITE)
BOLD= sty("BOLD",fontName="Helvetica-Bold", fontSize=7, leading=9.5)
BOLW= sty("BOLW",fontName="Helvetica-Bold", fontSize=7, leading=9.5, textColor=C_WHITE)
SML = sty("SML", fontSize=6.2, leading=8.5, textColor=C_MIDGRAY)
CTR = sty("CTR", fontSize=7, leading=9.5, alignment=TA_CENTER)
CTRB= sty("CTRB",fontName="Helvetica-Bold", fontSize=7.5, leading=10,
alignment=TA_CENTER, textColor=C_NAVY)
def P(txt, style=BODY): return Paragraph(txt, style)
def SP(h=2): return Spacer(1, h*mm)
def col_header(txt, bg=C_NAVY, fg=C_WHITE, size=8):
return Paragraph(f"<b>{txt}</b>",
sty("ch", fontName="Helvetica-Bold", fontSize=size,
leading=11, textColor=fg, alignment=TA_CENTER))
# ── Section title bar ─────────────────────────────────────────────────────────
def section_bar(txt, bg=C_NAVY, width=None):
w = width or (PAGE_W - 2*MARGIN)
d = Drawing(w, 14)
d.add(Rect(0, 0, w, 14, fillColor=bg, strokeColor=None))
d.add(String(6, 3.5, txt, fontName="Helvetica-Bold",
fontSize=8.5, fillColor=colors.white))
return d
# ── Flowable box ──────────────────────────────────────────────────────────────
class ColorBox(Flowable):
"""A filled rounded rectangle containing text lines."""
def __init__(self, lines, bg, w, h, text_color=C_DARKGRAY,
font="Helvetica", fsize=6.8, bold_first=False):
super().__init__()
self.lines = lines
self.bg = bg
self.w, self.h = w, h
self.text_color = text_color
self.font = font
self.fsize = fsize
self.bold_first = bold_first
def wrap(self, *args): return self.w, self.h
def draw(self):
c = self.canv
c.setFillColor(self.bg)
c.roundRect(0, 0, self.w, self.h, 3, fill=1, stroke=0)
c.setFillColor(self.text_color)
y = self.h - self.fsize - 3
for i, ln in enumerate(self.lines):
fn = ("Helvetica-Bold" if (i == 0 and self.bold_first)
else self.font)
c.setFont(fn, self.fsize)
c.drawString(5, y, ln)
y -= self.fsize + 2
if y < 3: break
# ══════════════════════════════════════════════════════════════════════════════
# PAGE 1
# ══════════════════════════════════════════════════════════════════════════════
def page1_elements():
elems = []
W = PAGE_W - 2*MARGIN # usable width
# ── MASTER HEADER ─────────────────────────────────────────────────────────
hdr = Drawing(W, 26)
hdr.add(Rect(0, 0, W, 26, fillColor=C_NAVY, strokeColor=None, rx=4, ry=4))
hdr.add(String(W/2, 15, "STROKE — QUICK REFERENCE CARD",
fontName="Helvetica-Bold", fontSize=13,
fillColor=colors.white, textAnchor="middle"))
hdr.add(String(W/2, 4, "Classification • Pathophysiology • TOAST • Circle of Willis",
fontName="Helvetica", fontSize=7,
fillColor=colors.HexColor("#bdc3c7"), textAnchor="middle"))
elems.append(hdr); elems.append(SP(2))
# ── ROW 1: Master tree + TOAST table ──────────────────────────────────────
# Left: Master stroke tree
tree_w = 88*mm
tree = Drawing(tree_w, 62)
tree.add(Rect(0, 0, tree_w, 62, fillColor=C_PALE_BLU, strokeColor=C_BLUE, strokeWidth=0.5, rx=3))
tree.add(String(tree_w/2, 52, "STROKE MASTER TREE",
fontName="Helvetica-Bold", fontSize=7.5,
fillColor=C_NAVY, textAnchor="middle"))
# stroke box
bx = 34; by = 40; bw = 38; bh = 10
tree.add(Rect(bx, by, bw, bh, fillColor=C_NAVY, rx=2))
tree.add(String(bx+bw/2, by+2.5, "STROKE",
fontName="Helvetica-Bold", fontSize=7.5,
fillColor=colors.white, textAnchor="middle"))
# branches
cx = bx + bw/2
tree.add(Line(cx-16, by, 28, 29, strokeColor=C_NAVY, strokeWidth=1))
tree.add(Line(cx+16, by, tree_w-28, 29, strokeColor=C_NAVY, strokeWidth=1))
# ischemic box
tree.add(Rect(tree_w-72, 18, 44, 12, fillColor=C_BLUE, rx=2))
tree.add(String(tree_w-72+22, 20.5, "ISCHEMIC 80%",
fontName="Helvetica-Bold", fontSize=7,
fillColor=colors.white, textAnchor="middle"))
# haem box
tree.add(Rect(4, 18, 44, 12, fillColor=C_CRIMSON, rx=2))
tree.add(String(26, 20.5, "HEMORRHAGIC 20%",
fontName="Helvetica-Bold", fontSize=7,
fillColor=colors.white, textAnchor="middle"))
# sub-branches ischemic
ix = tree_w-72+22
tree.add(Line(ix-10, 18, ix-16, 10, strokeColor=C_BLUE, strokeWidth=0.8))
tree.add(Line(ix+10, 18, ix+16, 10, strokeColor=C_BLUE, strokeWidth=0.8))
tree.add(Rect(tree_w-82, 1, 28, 10, fillColor=colors.HexColor("#d6eaf8"), rx=2))
tree.add(String(tree_w-82+14, 3, "Ischemic",
fontName="Helvetica", fontSize=5.5,
fillColor=C_BLUE, textAnchor="middle"))
tree.add(String(tree_w-82+14, -3.5, "(thrombotic/",
fontName="Helvetica", fontSize=5,
fillColor=C_BLUE, textAnchor="middle"))
tree.add(Rect(tree_w-50, 1, 28, 10, fillColor=colors.HexColor("#d6eaf8"), rx=2))
tree.add(String(tree_w-50+14, 3, "Embolic",
fontName="Helvetica", fontSize=5.5,
fillColor=C_BLUE, textAnchor="middle"))
# sub-branches haem
hx = 26
tree.add(Line(hx-10, 18, hx-8, 10, strokeColor=C_CRIMSON, strokeWidth=0.8))
tree.add(Line(hx+10, 18, hx+10, 10, strokeColor=C_CRIMSON, strokeWidth=0.8))
tree.add(Rect(2, 1, 22, 9, fillColor=colors.HexColor("#fadbd8"), rx=2))
tree.add(String(13, 3, "ICH ~15%",
fontName="Helvetica-Bold", fontSize=5.8,
fillColor=C_CRIMSON, textAnchor="middle"))
tree.add(Rect(26, 1, 22, 9, fillColor=colors.HexColor("#fadbd8"), rx=2))
tree.add(String(37, 3, "SAH ~5%",
fontName="Helvetica-Bold", fontSize=5.8,
fillColor=C_CRIMSON, textAnchor="middle"))
# Right: TOAST classification table
toast_w = W - tree_w - 4*mm
toast_data = [
[col_header("TOAST CLASSIFICATION OF ISCHEMIC STROKE", bg=C_BLUE, size=7.5)],
[Table(
[
[P("<b>SUBTYPE</b>", BOLD), P("<b>%</b>", BOLD),
P("<b>MECHANISM</b>", BOLD), P("<b>KEY FEATURE</b>", BOLD),
P("<b>Rx</b>", BOLD)],
[P("Large Vessel\nAtherosclerosis", BOLD),
P("~25%", CTR),
P("Thrombosis / A-to-A\nembolism at plaque"),
P("Stuttering onset\nTIAs; cortical signs\n>50% stenosis"),
P("Antiplatelet\n+ Statin\n+ Revasc.")],
[P("Small Vessel\n(Lacunar)", BOLD),
P("~25%", CTR),
P("Lipohyalinosis of\ndeep perforators\n(HTN)"),
P("DWI <1.5 cm; deep\nno cortical signs\n5 classic syndromes"),
P("Antiplatelet\nBP/DM/\nlipid control")],
[P("Cardioembolism", BOLD),
P("~20%", CTR),
P("Thrombus from\nheart → brain"),
P("Sudden onset;\nmulti-territory;\nHemorrhagic Tx"),
P("Anticoag.\n(DOAC/warfarin)")],
[P("Other Cause", BOLD),
P("~5%", CTR),
P("Dissection, vasculitis,\nhypercoag, Moyamoya\nCADASIL, sickle cell"),
P("Young stroke\nworkup; rare\netiologies"),
P("Cause-\nspecific")],
[P("Cryptogenic\n(ESUS)", BOLD),
P("~25%", CTR),
P("No cause found;\nESUS = non-lacunar\nno AF, no stenosis"),
P("Prolonged cardiac\nmonitoring;\noccult embolism"),
P("Antiplatelet;\nconsider\nDOAC")],
],
colWidths=[toast_w*0.18, toast_w*0.07, toast_w*0.26,
toast_w*0.28, toast_w*0.19],
style=TableStyle([
("BACKGROUND", (0,0), (-1,0), C_NAVY),
("TEXTCOLOR", (0,0), (-1,0), C_WHITE),
("FONTNAME", (0,0), (-1,0), "Helvetica-Bold"),
("FONTSIZE", (0,0), (-1,0), 6.5),
("ROWBACKGROUNDS", (0,1), (-1,-1),
[C_PALE_BLU, C_WHITE, C_PALE_BLU, C_WHITE, C_PALE_BLU]),
("GRID", (0,0), (-1,-1), 0.3, colors.HexColor("#bdc3c7")),
("VALIGN", (0,0), (-1,-1), "TOP"),
("TOPPADDING", (0,0), (-1,-1), 2),
("BOTTOMPADDING", (0,0), (-1,-1), 2),
("LEFTPADDING", (0,0), (-1,-1), 2),
])
)]
]
row1 = Table(
[[tree, Table(toast_data,
colWidths=[toast_w],
style=TableStyle([
("GRID", (0,0), (-1,-1), 0, colors.white),
("TOPPADDING", (0,0), (-1,-1), 0),
("BOTTOMPADDING", (0,0), (-1,-1), 0),
("LEFTPADDING", (0,0), (-1,-1), 0),
("RIGHTPADDING", (0,0), (-1,-1), 0),
]))]],
colWidths=[tree_w + 4*mm, toast_w],
style=TableStyle([
("VALIGN", (0,0), (-1,-1), "TOP"),
("LEFTPADDING", (0,0), (-1,-1), 0),
("RIGHTPADDING", (0,0), (-1,-1), 0),
("TOPPADDING", (0,0), (-1,-1), 0),
("BOTTOMPADDING", (0,0), (-1,-1), 0),
])
)
elems.append(row1); elems.append(SP(2))
# ── ROW 2: Lacunar syndromes | ICH locations | SAH pearls | Temporal ─────
# Lacunar syndromes
lac_data = [
[col_header("LACUNAR SYNDROMES", bg=C_TEAL)],
[Table([
[P("<b>SYNDROME</b>", BOLD), P("<b>SITE</b>", BOLD)],
[P("Pure Motor Hemiplegia"), P("Post. limb IC / Pons")],
[P("Pure Sensory Stroke"), P("Thalamus (VPL)")],
[P("Sensorimotor Stroke"), P("Thalamo-capsular")],
[P("Ataxic Hemiparesis"), P("Pons / IC")],
[P("Dysarthria-Clumsy Hand"), P("Pons / IC")],
], colWidths=[36*mm, 30*mm],
style=TableStyle([
("BACKGROUND", (0,0), (-1,0), C_TEAL),
("TEXTCOLOR", (0,0), (-1,0), C_WHITE),
("ROWBACKGROUNDS", (0,1),(-1,-1),[C_PALE_TEA, C_WHITE]*5),
("GRID", (0,0),(-1,-1), 0.3, colors.HexColor("#a9cce3")),
("FONTSIZE", (0,0),(-1,-1), 6.5),
("TOPPADDING", (0,0),(-1,-1), 1.5),
("BOTTOMPADDING", (0,0),(-1,-1), 1.5),
("LEFTPADDING", (0,0),(-1,-1), 2),
]))]
]
# ICH locations
ich_data = [
[col_header("ICH LOCATIONS (HTN)", bg=C_CRIMSON)],
[Table([
[P("<b>SITE</b>", BOLD), P("<b>%</b>", BOLD), P("<b>KEY SIGN</b>", BOLD)],
[P("Putamen"), P("35%",CTR), P("Contralat. motor+sensory")],
[P("Thalamus"), P("20%",CTR), P("Sensory>motor; downgaze")],
[P("Pons"), P("10%",CTR), P("Quadriplegia; pinpoint pupils")],
[P("Cerebellum"), P("15%",CTR), P("Ataxia; no early motor ↓")],
[P("Lobar (WM)"), P("20%",CTR), P("Amyloid angiopathy; elderly")],
], colWidths=[22*mm, 10*mm, 36*mm],
style=TableStyle([
("BACKGROUND", (0,0), (-1,0), C_CRIMSON),
("TEXTCOLOR", (0,0), (-1,0), C_WHITE),
("ROWBACKGROUNDS", (0,1),(-1,-1),[C_PALE_RED, C_WHITE]*5),
("GRID", (0,0),(-1,-1), 0.3, colors.HexColor("#f1948a")),
("FONTSIZE", (0,0),(-1,-1), 6.5),
("TOPPADDING", (0,0),(-1,-1), 1.5),
("BOTTOMPADDING", (0,0),(-1,-1), 1.5),
("LEFTPADDING", (0,0),(-1,-1), 2),
]))]
]
# SAH pearls
sah_data = [
[col_header("SAH ANEURYSM SITES", bg=C_PURPLE)],
[Table([
[P("<b>SITE</b>", BOLD), P("<b>%</b>", BOLD), P("<b>PEARL</b>", BOLD)],
[P("AComm"), P("30%",CTR), P("MC; behavioural Δ")],
[P("PComm"), P("25%",CTR), P("CN III palsy →surgical emerg.")],
[P("MCA bifurc."), P("20%",CTR), P("Hemispheric haematoma")],
[P("ICA bifurc."), P("10%",CTR), P("—")],
[P("Basilar tip"), P("8%",CTR), P("Bilateral PCA + thalami")],
], colWidths=[20*mm, 9*mm, 38*mm],
style=TableStyle([
("BACKGROUND", (0,0), (-1,0), C_PURPLE),
("TEXTCOLOR", (0,0), (-1,0), C_WHITE),
("ROWBACKGROUNDS", (0,1),(-1,-1),[C_PALE_PUR, C_WHITE]*5),
("GRID", (0,0),(-1,-1), 0.3, colors.HexColor("#c39bd3")),
("FONTSIZE", (0,0),(-1,-1), 6.5),
("TOPPADDING", (0,0),(-1,-1), 1.5),
("BOTTOMPADDING", (0,0),(-1,-1), 1.5),
("LEFTPADDING", (0,0),(-1,-1), 2),
]))]
]
# Temporal + treatment
temp_data = [
[col_header("TEMPORAL + TREATMENT", bg=C_AMBER)],
[Table([
[P("<b>TYPE</b>", BOLD), P("<b>DURATION</b>", BOLD)],
[P("TIA"), P("<24 h; no MRI infarct")],
[P("Stroke-in-evolution"), P("Progressing over hours")],
[P("Completed stroke"), P("Permanent deficit")],
[P("<b>tPA window</b>", BOLD), P("<b>≤4.5 hours</b>", BOLD)],
[P("<b>Thrombectomy</b>", BOLD), P("<b>Up to 24 h (LVO)</b>", BOLD)],
], colWidths=[28*mm, 36*mm],
style=TableStyle([
("BACKGROUND", (0,0), (-1,0), C_AMBER),
("TEXTCOLOR", (0,0), (-1,0), C_WHITE),
("ROWBACKGROUNDS", (0,1),(-1,-1),[C_PALE_YLW, C_WHITE]*5),
("BACKGROUND", (0,4), (-1,-1), colors.HexColor("#fdebd0")),
("GRID", (0,0),(-1,-1), 0.3, colors.HexColor("#f0b27a")),
("FONTSIZE", (0,0),(-1,-1), 6.5),
("TOPPADDING", (0,0),(-1,-1), 1.5),
("BOTTOMPADDING", (0,0),(-1,-1), 1.5),
("LEFTPADDING", (0,0),(-1,-1), 2),
]))]
]
def make_box(data, w):
return Table(data, colWidths=[w],
style=TableStyle([
("GRID", (0,0),(-1,-1), 0, colors.white),
("TOPPADDING", (0,0),(-1,-1), 0),
("BOTTOMPADDING", (0,0),(-1,-1), 0),
("LEFTPADDING", (0,0),(-1,-1), 0),
("RIGHTPADDING", (0,0),(-1,-1), 0),
]))
lw = 68*mm; iw = 70*mm; sw = 69*mm; tw = 66*mm
gap = (W - lw - iw - sw - tw) / 3
row2 = Table(
[[make_box(lac_data, lw),
make_box(ich_data, iw),
make_box(sah_data, sw),
make_box(temp_data, tw)]],
colWidths=[lw+gap, iw+gap, sw+gap, tw],
style=TableStyle([
("VALIGN", (0,0), (-1,-1), "TOP"),
("LEFTPADDING", (0,0), (-1,-1), 0),
("RIGHTPADDING", (0,0), (-1,-1), 0),
("TOPPADDING", (0,0), (-1,-1), 0),
("BOTTOMPADDING", (0,0), (-1,-1), 0),
])
)
elems.append(row2); elems.append(SP(2))
# ── BOTTOM PEARLS STRIP ───────────────────────────────────────────────────
pearls = [
"⚡ Multiple territories → CARDIAC source",
"⚡ Deep WM infarct ≠ always lacunar — exclude emboli",
"⚡ Thunderclap headache → SAH until proven otherwise",
"⚡ PComm aneurysm → CN III palsy (surgical emergency)",
"⚡ 'Man in barrel' → ACA-MCA watershed",
"⚡ ESUS = non-lacunar + no AF + no stenosis",
]
pearl_cells = [[P(f"<b>{p}</b>",
sty("pp", fontName="Helvetica-Bold", fontSize=6.2,
leading=8, textColor=C_NAVY))]
for p in pearls]
strip_tbl = Table(
[pearl_cells[i] for i in range(len(pearl_cells))],
colWidths=[W],
style=TableStyle([
("BACKGROUND", (0,0), (-1,-1), colors.HexColor("#fef9e7")),
("BOX", (0,0), (-1,-1), 0.5, C_AMBER),
("TOPPADDING", (0,0), (-1,-1), 1.5),
("BOTTOMPADDING", (0,0), (-1,-1), 1.5),
("LEFTPADDING", (0,0), (-1,-1), 4),
])
)
# Arrange pearls in 3 columns
pc = [P(f"<b>{p}</b>",
sty("pp2", fontName="Helvetica-Bold", fontSize=6,
leading=8.5, textColor=C_NAVY))
for p in pearls]
strip = Table(
[[pc[0], pc[1], pc[2]], [pc[3], pc[4], pc[5]]],
colWidths=[W/3, W/3, W/3],
style=TableStyle([
("BACKGROUND", (0,0), (-1,-1), colors.HexColor("#fef9e7")),
("BOX", (0,0), (-1,-1), 0.8, C_AMBER),
("INNERGRID", (0,0), (-1,-1), 0.3, colors.HexColor("#f9e79f")),
("TOPPADDING", (0,0), (-1,-1), 2),
("BOTTOMPADDING", (0,0), (-1,-1), 2),
("LEFTPADDING", (0,0), (-1,-1), 4),
])
)
elems.append(strip)
return elems
# ══════════════════════════════════════════════════════════════════════════════
# PAGE 2
# ══════════════════════════════════════════════════════════════════════════════
def page2_elements():
elems = []
W = PAGE_W - 2*MARGIN
# ── HEADER ────────────────────────────────────────────────────────────────
hdr = Drawing(W, 26)
hdr.add(Rect(0, 0, W, 26, fillColor=C_TEAL, strokeColor=None, rx=4, ry=4))
hdr.add(String(W/2, 15, "CIRCLE OF WILLIS — ANATOMY & CLINICAL CORRELATES",
fontName="Helvetica-Bold", fontSize=13,
fillColor=colors.white, textAnchor="middle"))
hdr.add(String(W/2, 4, "Neuroanatomy through Clinical Cases (Blumenfeld 3e) | Miller's Anesthesia 10e",
fontName="Helvetica", fontSize=7,
fillColor=colors.HexColor("#d5f5f0"), textAnchor="middle"))
elems.append(hdr); elems.append(SP(2))
# ── ROW 1: CoW diagram + ICA segments + Vertebrobasilar ───────────────────
# -- CoW schematic diagram (drawn) --
cow_w = 82*mm
cow_h = 95*mm
dg = Drawing(cow_w, cow_h)
dg.add(Rect(0, 0, cow_w, cow_h,
fillColor=colors.HexColor("#f0fafa"),
strokeColor=C_TEAL, strokeWidth=0.5, rx=4))
# Title
dg.add(String(cow_w/2, cow_h-8, "CIRCLE OF WILLIS — Inferior View",
fontName="Helvetica-Bold", fontSize=6.5,
fillColor=C_NAVY, textAnchor="middle"))
cx = cow_w / 2 # centre x
cy = 46 # centre y of the ring
def artery(x1,y1,x2,y2, col=C_CRIMSON, w=2):
dg.add(Line(x1,y1,x2,y2, strokeColor=col, strokeWidth=w))
def label(x,y,txt, col=C_NAVY, sz=5.5, anchor="start"):
dg.add(String(x,y,txt, fontName="Helvetica", fontSize=sz,
fillColor=col, textAnchor=anchor))
def blabel(x,y,txt, col=C_NAVY, sz=5.8, anchor="start"):
dg.add(String(x,y,txt, fontName="Helvetica-Bold", fontSize=sz,
fillColor=col, textAnchor=anchor))
# === DRAW THE RING ===
# Basilar artery (vertical centre-bottom)
artery(cx, 4, cx, cy-12, col=C_ORANGE, w=2.5)
blabel(cx+2, 8, "Basilar A.", col=C_ORANGE)
# Vertebrals
artery(cx-8, 4, cx, 10, col=C_ORANGE, w=1.5)
artery(cx+8, 4, cx, 10, col=C_ORANGE, w=1.5)
label(2, 2, "L. Vertebral", col=C_ORANGE, sz=5)
label(cx+10, 2, "R. Vertebral", col=C_ORANGE, sz=5)
# PCA left & right (from basilar tip)
artery(cx, cy-12, cx-22, cy-2, col=C_PURPLE, w=1.8)
artery(cx, cy-12, cx+22, cy-2, col=C_PURPLE, w=1.8)
label(4, cy-2, "L. PCA", col=C_PURPLE, sz=5.5)
label(cx+24, cy-2, "R. PCA", col=C_PURPLE, sz=5.5)
# PComm left & right (PCA to ICA)
artery(cx-22, cy-2, cx-22, cy+12, col=C_GREEN, w=1.5)
artery(cx+22, cy-2, cx+22, cy+12, col=C_GREEN, w=1.5)
label(2, cy+5, "PComm", col=C_GREEN, sz=5.2)
label(cx+24, cy+5, "PComm", col=C_GREEN, sz=5.2)
# ICA left & right (vertical)
artery(cx-22, cy+12, cx-22, cy+28, col=C_BLUE, w=2.5)
artery(cx+22, cy+12, cx+22, cy+28, col=C_BLUE, w=2.5)
label(2, cy+25, "L. ICA", col=C_BLUE, sz=5.5)
label(cx+24, cy+25, "R. ICA", col=C_BLUE, sz=5.5)
# ACA left & right (from ICA upward, then medial)
artery(cx-22, cy+28, cx-6, cy+38, col=colors.HexColor("#1a5276"), w=2)
artery(cx+22, cy+28, cx+6, cy+38, col=colors.HexColor("#1a5276"), w=2)
# AComm (horizontal top)
artery(cx-6, cy+38, cx+6, cy+38, col=C_GREEN, w=2)
blabel(cx-14, cy+41, "AComm", col=C_GREEN, sz=5.5, anchor="middle")
# ACA labels
label(2, cy+36, "L.ACA", col=colors.HexColor("#1a5276"), sz=5.5)
label(cx+10, cy+36, "R.ACA", col=colors.HexColor("#1a5276"), sz=5.5)
# MCA left & right (from ICA, lateral)
artery(cx-22, cy+20, cx-46, cy+20, col=colors.HexColor("#c0392b"), w=2)
artery(cx+22, cy+20, cx+46, cy+20, col=colors.HexColor("#c0392b"), w=2)
label(2, cy+22, "L.MCA", col=colors.HexColor("#c0392b"), sz=5.5)
label(cx+28, cy+22, "R.MCA", col=colors.HexColor("#c0392b"), sz=5.5)
# SCA
artery(cx, cy-6, cx-16, cy-14, col=C_ORANGE, w=1.2)
artery(cx, cy-6, cx+16, cy-14, col=C_ORANGE, w=1.2)
label(2, cy-16, "SCA", col=C_ORANGE, sz=5)
label(cx+17, cy-16, "SCA", col=C_ORANGE, sz=5)
# Anterior choroidal
artery(cx-22, cy+14, cx-36, cy+8, col=C_MIDGRAY, w=1)
label(2, cy+7, "Ant.Choroidal", col=C_MIDGRAY, sz=4.8)
# Ophthalmic
artery(cx-22, cy+26, cx-38, cy+32, col=C_MIDGRAY, w=1)
label(2, cy+30, "Ophthalmic A.", col=C_MIDGRAY, sz=4.8)
# Complete ring note
dg.add(Rect(10, cow_h-24, cow_w-20, 13,
fillColor=colors.HexColor("#fef9e7"),
strokeColor=C_AMBER, strokeWidth=0.7, rx=2))
dg.add(String(cow_w/2, cow_h-15,
"Complete ring: only ~34% of individuals",
fontName="Helvetica-Bold", fontSize=5.5,
fillColor=C_CRIMSON, textAnchor="middle"))
dg.add(String(cow_w/2, cow_h-22,
"Collateral flow when a branch is occluded",
fontName="Helvetica", fontSize=5.2,
fillColor=C_NAVY, textAnchor="middle"))
# ── ICA segments ──────────────────────────────────────────────────────────
ica_w = 62*mm
ica_data = [
[col_header("ICA SEGMENTS + OPAAM BRANCHES", bg=C_BLUE)],
[Table([
[P("<b>SEGMENT</b>", BOLD), P("<b>COURSE / NOTES</b>", BOLD)],
[P("1. Cervical"), P("Vertical in neck; NO branches")],
[P("2. Petrous"), P("Carotid canal; sharp horizontal bend")],
[P("3. Cavernous"), P("S-curve = carotid siphon within cavernous sinus")],
[P("4. Supraclinoid"),P("Pierces dura → subarachnoid space; gives OPAAM")],
[P("", BOLD), P("", BOLD)],
[P("<b>OPAAM MNEMONIC</b>", BOLD), P("<b>BRANCH</b>", BOLD)],
[P("O — Ophthalmic"), P("Retinal supply via optic foramen")],
[P("P — Post.Comm."), P("Links ICA → PCA; aneurysm → CN III palsy")],
[P("A — Ant.Choroidal"), P("Post. limb IC, optic tract, hippocampus")],
[P("A — Ant.Cerebral"), P("→ ACA (medial frontal/parietal)")],
[P("M — Mid.Cerebral"), P("→ MCA (lateral convexity; largest branch)")],
], colWidths=[28*mm, ica_w-28*mm],
style=TableStyle([
("BACKGROUND", (0,0), (-1,0), C_BLUE),
("TEXTCOLOR", (0,0), (-1,0), C_WHITE),
("BACKGROUND", (0,5), (-1,5), C_NAVY),
("TEXTCOLOR", (0,5), (-1,5), C_WHITE),
("ROWBACKGROUNDS", (0,1), (-1,4), [C_PALE_BLU, C_WHITE]*3),
("ROWBACKGROUNDS", (0,6), (-1,-1),[C_PALE_BLU, C_WHITE]*5),
("GRID", (0,0), (-1,-1), 0.3, colors.HexColor("#aed6f1")),
("FONTSIZE", (0,0), (-1,-1), 6.2),
("TOPPADDING", (0,0), (-1,-1), 1.5),
("BOTTOMPADDING", (0,0), (-1,-1), 1.5),
("LEFTPADDING", (0,0), (-1,-1), 2),
]))]
]
# ── Vertebrobasilar + territories ─────────────────────────────────────────
vb_w = W - cow_w - ica_w - 6*mm
vb_data = [
[col_header("VERTEBROBASILAR BRANCHES", bg=C_ORANGE)],
[Table([
[P("<b>ARTERY</b>", BOLD), P("<b>SUPPLIES</b>", BOLD)],
[P("PICA"), P("Lat.medulla + inf.cerebellum → Wallenberg")],
[P("Ant.Spinal"), P("Ant. 2/3 spinal cord")],
[P("AICA"), P("Lat.pons + ant.inf.cerebellum")],
[P("Pontine perf."), P("Medial pons (lacunar strokes)")],
[P("SCA"), P("Superior cerebellum + midbrain")],
[P("PCA"), P("Occipital lobe, med.temporal, thalamus")],
], colWidths=[18*mm, vb_w-18*mm],
style=TableStyle([
("BACKGROUND", (0,0), (-1,0), C_ORANGE),
("TEXTCOLOR", (0,0), (-1,0), C_WHITE),
("ROWBACKGROUNDS", (0,1),(-1,-1),[C_PALE_YLW, C_WHITE]*4),
("GRID", (0,0),(-1,-1), 0.3, colors.HexColor("#f0b27a")),
("FONTSIZE", (0,0),(-1,-1), 6.2),
("TOPPADDING", (0,0),(-1,-1), 1.5),
("BOTTOMPADDING", (0,0),(-1,-1), 1.5),
("LEFTPADDING", (0,0),(-1,-1), 2),
]))]
]
def wrap_box(data, w):
return Table(data, colWidths=[w],
style=TableStyle([
("GRID", (0,0),(-1,-1),0,colors.white),
("TOPPADDING",(0,0),(-1,-1),0),
("BOTTOMPADDING",(0,0),(-1,-1),0),
("LEFTPADDING",(0,0),(-1,-1),0),
("RIGHTPADDING",(0,0),(-1,-1),0),
]))
row1 = Table(
[[dg,
wrap_box(ica_data, ica_w),
wrap_box(vb_data, vb_w)]],
colWidths=[cow_w + 3*mm, ica_w + 3*mm, vb_w],
style=TableStyle([
("VALIGN",(0,0),(-1,-1),"TOP"),
("LEFTPADDING",(0,0),(-1,-1),0),
("RIGHTPADDING",(0,0),(-1,-1),0),
("TOPPADDING",(0,0),(-1,-1),0),
("BOTTOMPADDING",(0,0),(-1,-1),0),
])
)
elems.append(row1); elems.append(SP(2))
# ── ROW 2: Vascular territories + Deep perforators + Watershed ───────────
# Territories
ter_w = 130*mm
ter_data = [
[col_header("VASCULAR TERRITORIES — INFARCT DEFICITS", bg=C_NAVY, size=7.5)],
[Table([
[P("<b>ARTERY</b>",BOLD), P("<b>TERRITORY</b>",BOLD),
P("<b>DOMINANT HEMISPHERE</b>",BOLD), P("<b>NON-DOMINANT</b>",BOLD)],
[P("<b>ACA</b>",sty("b",fontName="Helvetica-Bold",fontSize=7,
textColor=colors.HexColor("#1a5276"))),
P("Medial frontal + ant.parietal (leg homunculus)"),
P("Leg>arm weakness; abulia; alien hand; incontinence"), P("Same ± akinetic mutism")],
[P("<b>MCA</b>",sty("b2",fontName="Helvetica-Bold",fontSize=7,
textColor=colors.HexColor("#c0392b"))),
P("Lateral convexity — frontal/parietal/temporal"),
P("Face+arm>leg; Broca's or Wernicke's aphasia; hemianopia"),
P("Face+arm>leg; hemispatial NEGLECT; anosognosia")],
[P("<b>PCA</b>",sty("b3",fontName="Helvetica-Bold",fontSize=7,
textColor=C_PURPLE)),
P("Occipital, med.temporal, thalamus"),
P("Hemianopia (macular sparing); alexia w/o agraphia; thalamic pain"),
P("Hemianopia; prosopagnosia; cortical blindness if bilateral")],
[P("<b>Basilar</b>",sty("b4",fontName="Helvetica-Bold",fontSize=7,
textColor=C_ORANGE)),
P("Pons, midbrain, cerebellum"),
P("Diplopia, dysarthria, dysphagia, ataxia, crossed signs"),
P("Locked-in syndrome (total occlusion)")],
], colWidths=[14*mm, 40*mm, 38*mm, ter_w-92*mm],
style=TableStyle([
("BACKGROUND", (0,0),(-1,0), C_NAVY),
("TEXTCOLOR", (0,0),(-1,0), C_WHITE),
("ROWBACKGROUNDS",(0,1),(-1,-1),[C_PALE_BLU,C_WHITE]*5),
("GRID",(0,0),(-1,-1),0.3,colors.HexColor("#bdc3c7")),
("FONTSIZE",(0,0),(-1,-1),6.2),
("VALIGN",(0,0),(-1,-1),"TOP"),
("TOPPADDING",(0,0),(-1,-1),2),
("BOTTOMPADDING",(0,0),(-1,-1),2),
("LEFTPADDING",(0,0),(-1,-1),2),
]))]
]
# Deep perforators
dp_w = 70*mm
dp_data = [
[col_header("DEEP PERFORATING ARTERIES", bg=C_TEAL)],
[Table([
[P("<b>ARTERY</b>",BOLD), P("<b>FROM</b>",BOLD), P("<b>SUPPLIES</b>",BOLD)],
[P("Lenticulostriate"), P("MCA M1"), P("Putamen, caudate, post.limb IC")],
[P("Heubner's recurrent"),P("ACA A1-A2"),P("Head caudate, ant.limb IC")],
[P("Thalamoperforators"),P("P1/PComm"), P("Thalamus (medial/intralaminar)")],
[P("Ant.Choroidal"), P("ICA"), P("Post.limb IC, optic tract, hippocampus")],
[P("Pontine perforators"),P("Basilar"), P("Medial pons → lacunar strokes")],
], colWidths=[28*mm, 16*mm, dp_w-44*mm],
style=TableStyle([
("BACKGROUND",(0,0),(-1,0),C_TEAL),
("TEXTCOLOR", (0,0),(-1,0),C_WHITE),
("ROWBACKGROUNDS",(0,1),(-1,-1),[C_PALE_TEA,C_WHITE]*4),
("GRID",(0,0),(-1,-1),0.3,colors.HexColor("#a2d9ce")),
("FONTSIZE",(0,0),(-1,-1),6.2),
("VALIGN",(0,0),(-1,-1),"TOP"),
("TOPPADDING",(0,0),(-1,-1),2),
("BOTTOMPADDING",(0,0),(-1,-1),2),
("LEFTPADDING",(0,0),(-1,-1),2),
]))]
]
# Watershed zones
ws_w = W - ter_w - dp_w - 4*mm
ws_data = [
[col_header("WATERSHED ZONES", bg=C_AMBER)],
[Table([
[P("<b>ZONE</b>",BOLD), P("<b>DEFICIT</b>",BOLD)],
[P("ACA-MCA\n(parasagittal)"),P("'Man in Barrel'\nProximal arm > shoulder weakness")],
[P("MCA-PCA\n(post.parieto-occipital)"), P("Higher-order visual Δ\nTranscortical aphasia")],
[P("Internal\n(subcortical)"),P("Deep MCA superficial\nvs.deep border zone")],
[P(""),P("")],
[P("<b>TRIGGER:</b>",BOLD), P("Cardiac arrest,\nsevere hypotension,\nICA occlusion")],
], colWidths=[ws_w*0.42, ws_w*0.58],
style=TableStyle([
("BACKGROUND",(0,0),(-1,0),C_AMBER),
("TEXTCOLOR", (0,0),(-1,0),C_WHITE),
("ROWBACKGROUNDS",(0,1),(-1,-1),[C_PALE_YLW,C_WHITE]*4),
("BACKGROUND",(0,4),(-1,4),colors.HexColor("#fdebd0")),
("GRID",(0,0),(-1,-1),0.3,colors.HexColor("#f0b27a")),
("FONTSIZE",(0,0),(-1,-1),6.2),
("VALIGN",(0,0),(-1,-1),"TOP"),
("TOPPADDING",(0,0),(-1,-1),2),
("BOTTOMPADDING",(0,0),(-1,-1),2),
("LEFTPADDING",(0,0),(-1,-1),2),
]))]
]
def wrap_box2(data, w):
return Table(data, colWidths=[w],
style=TableStyle([
("GRID",(0,0),(-1,-1),0,colors.white),
("TOPPADDING",(0,0),(-1,-1),0),
("BOTTOMPADDING",(0,0),(-1,-1),0),
("LEFTPADDING",(0,0),(-1,-1),0),
("RIGHTPADDING",(0,0),(-1,-1),0),
]))
g = (W - ter_w - dp_w - ws_w) / 2
row2 = Table(
[[wrap_box2(ter_data, ter_w),
wrap_box2(dp_data, dp_w),
wrap_box2(ws_data, ws_w)]],
colWidths=[ter_w+g, dp_w+g, ws_w],
style=TableStyle([
("VALIGN",(0,0),(-1,-1),"TOP"),
("LEFTPADDING",(0,0),(-1,-1),0),
("RIGHTPADDING",(0,0),(-1,-1),0),
("TOPPADDING",(0,0),(-1,-1),0),
("BOTTOMPADDING",(0,0),(-1,-1),0),
])
)
elems.append(row2); elems.append(SP(2))
# ── BOTTOM MNEMONICS STRIP ────────────────────────────────────────────────
mn = [
[P("<b>OPAAM</b> (ICA branches):", BOLD),
P("Ophthalmic · Post.Comm · Ant.Choroidal · ACA · MCA")],
[P("<b>LACUNAR</b> (5 syndromes):", BOLD),
P("Pure Motor · Pure Sensory · Sensorimotor · Ataxic Hemi · Dysarthria-Clumsy Hand")],
[P("<b>ICH SITES</b> (frequency):", BOLD),
P("Put That Pons Carefully Lobar → Putamen > Thalamus > Pons > Cerebellum > Lobar")],
[P("<b>TOAST</b> order:", BOLD),
P('"Loud Students Create Outstanding Chaos" → Large · Small · Cardio · Other · Cryptogenic')],
]
mnem = Table(mn, colWidths=[40*mm, W-40*mm],
style=TableStyle([
("BACKGROUND",(0,0),(-1,-1),colors.HexColor("#f0f3ff")),
("BOX",(0,0),(-1,-1),0.8,C_NAVY),
("INNERGRID",(0,0),(-1,-1),0.3,colors.HexColor("#d6dbf5")),
("FONTSIZE",(0,0),(-1,-1),6.5),
("TOPPADDING",(0,0),(-1,-1),2.5),
("BOTTOMPADDING",(0,0),(-1,-1),2.5),
("LEFTPADDING",(0,0),(-1,-1),4),
("VALIGN",(0,0),(-1,-1),"MIDDLE"),
]))
elems.append(mnem)
# ── FOOTER ────────────────────────────────────────────────────────────────
elems.append(SP(1.5))
footer_txt = (
"Sources: Neuroanatomy through Clinical Cases 3e (Blumenfeld) · Tintinalli's Emergency Medicine · "
"Grainger & Allison's Diagnostic Radiology · Fuster & Hurst's The Heart 15e · Miller's Anesthesia 10e"
)
elems.append(P(footer_txt,
sty("ft", fontSize=5.2, leading=7, textColor=C_MIDGRAY,
alignment=TA_CENTER)))
return elems
# ══════════════════════════════════════════════════════════════════════════════
# BUILD PDF
# ══════════════════════════════════════════════════════════════════════════════
OUT = "/tmp/workspace/stroke-refcard/Stroke_CoW_QuickRef.pdf"
doc = SimpleDocTemplate(
OUT,
pagesize=landscape(A4),
leftMargin=MARGIN, rightMargin=MARGIN,
topMargin=MARGIN, bottomMargin=MARGIN,
)
story = page1_elements()
from reportlab.platypus import PageBreak
story.append(PageBreak())
story += page2_elements()
doc.build(story)
print(f"PDF saved to: {OUT}")
cd /tmp/workspace/stroke-refcard && python3 build_card.py 2>&1
ls -lh /tmp/workspace/stroke-refcard/Stroke_CoW_QuickRef.pdf
Stroke CoW QuickRef
PDF Document · PDF
vertebrobasilar artery syndrome comes under which classification?
| TOAST Subtype | How VBS fits |
|---|---|
| Large Vessel Atherosclerosis | Most common - atherosclerosis of vertebral/basilar arteries causing in-situ thrombosis or A-to-A embolism |
| Cardioembolism | Embolus from heart lodges in basilar artery - "top of the basilar" syndrome |
| Small Vessel (Lacunar) | Pontine perforator occlusion - causes brainstem lacunar syndromes (part of the VBS spectrum) |
| Other Cause | Vertebral artery dissection (young patients), vasculitis |
POSTERIOR CIRCULATION STROKE
│
┌──────┴───────┐
│ │
VERTEBRAL A. BASILAR A.
SYNDROME SYNDROME
│ │
├── PICA ├── AICA syndrome
│ (Wallenberg) ├── Pontine syndromes
├── Ant.Spinal ├── SCA syndrome
│ A. syndrome └── "Top of Basilar"
└── Medial syndrome
Medullary
syndrome
| Syndrome | Artery Occluded | TOAST | Special Note |
|---|---|---|---|
| Wallenberg (lateral medullary) | PICA or vertebral | Large vessel / Other | Ipsilat. face + contralat. body numbness - "crossed" signs |
| Medial medullary | Ant. spinal / vertebral perforator | Small vessel / Large vessel | Contralat. hemiplegia + ipsilat. tongue palsy |
| AICA syndrome | AICA | Large vessel | Ipsilat. hearing loss + facial palsy + ataxia |
| "Locked-in" syndrome | Basilar (total) | Large vessel / Cardioembolic | Quadriplegia + anarthria; eye movement preserved |
| Top of basilar | Basilar tip | Cardioembolic (MC) | Bilateral PCA + thalami; behavioral Δ + visual loss |
| Pontine lacunar | Pontine perforators | Small vessel | Pure motor hemiplegia / ataxic hemiparesis |
| SCA syndrome | SCA | Large vessel | Ipsilat. cerebellar ataxia + contralat. pain/temp loss |
VBS = Ischemic Stroke → Posterior Circulation → TOAST: Large Vessel Atherosclerosis (most common) OR Cardioembolism (basilar tip) OR Small Vessel (pontine perforators)