Basic neuroanatomy and physiology

| Part | Structure | Key Function |
|---|---|---|
| Dendrites | Tapered extensions of the cell body | Receive input from other neurons |
| Soma (cell body) | Contains nucleus, Golgi apparatus, Nissl substance | Synthesizes macromolecules; integrates electrical signals |
| Axon | Single, cylindrical, may be myelinated; up to meters long | Conducts action potentials to target cells |
| Axon terminals | Vesicle-filled endings apposed to target cells | Transmit information via neurotransmitters |


| Lobe | Boundaries | Key Functions |
|---|---|---|
| Frontal | Anterior to central sulcus (of Rolando); above lateral sulcus (of Sylvius) | Motor control (primary motor cortex), executive function, speech production (Broca's area, left) |
| Parietal | Posterior to central sulcus | Somatosensory processing (primary sensory cortex), spatial integration |
| Temporal | Below lateral sulcus | Auditory processing, memory (hippocampus), language comprehension (Wernicke's area, left) |
| Occipital | Posterior; separated from parietal by parieto-occipital sulcus medially | Visual processing (primary visual cortex) |
| Tract | Location | Information Carried |
|---|---|---|
| Dorsal columns (gracile + cuneate fasciculi) | Posterior white matter | Fine touch, vibration, proprioception (ipsilateral) |
| Spinothalamic tract | Anterolateral | Pain and temperature (crosses within 1-2 segments of entry) |
| Corticospinal tract | Lateral and anterior white matter | Voluntary motor commands (crossed, from contralateral cortex) |

| Transmitter | Type | Main Actions |
|---|---|---|
| Glutamate | Excitatory | Primary fast excitatory transmitter (AMPA, NMDA receptors) |
| GABA | Inhibitory | Primary fast inhibitory transmitter; hyperpolarizes neurons |
| Acetylcholine (ACh) | Both | Neuromuscular junction; autonomic ganglia; cortical arousal |
| Dopamine | Modulatory | Motor control (nigrostriatal), reward (mesolimbic), prefrontal function |
| Serotonin (5-HT) | Modulatory | Mood, sleep, appetite; target of SSRIs |
| Norepinephrine | Modulatory | Arousal, attention, sympathetic tone |
| Glycine | Inhibitory | Spinal cord; brainstem interneurons |
CNS = Brain + Spinal Cord
PNS = Cranial nerves + Spinal nerves + Ganglia
Brain:
├── Cerebrum (4 lobes each hemisphere)
├── Diencephalon (thalamus, hypothalamus)
├── Basal Ganglia
├── Brainstem (midbrain → pons → medulla)
└── Cerebellum
Neuron signal:
Resting (~-70mV) → Depolarize to threshold → Na⁺ in (upstroke)
→ K⁺ out (repolarization) → Hyperpolarization → Return to rest
Ascending spinal tracts:
Dorsal columns → fine touch/proprioception (ipsilateral)
Spinothalamic → pain/temp (contralateral, crosses in cord)
Descending:
Corticospinal → voluntary movement (crosses at medullary pyramids)
Generate a quick reference PDF of major brain tracts and functions
ls -la /tmp/workspace/ 2>/dev/null || mkdir -p /tmp/workspace && echo "workspace ready"
mkdir -p /tmp/workspace/brain-tracts-pdf && cat > /tmp/workspace/brain-tracts-pdf/generate.py << 'PYEOF' from reportlab.lib.pagesizes import A4 from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle from reportlab.lib.units import cm, mm from reportlab.lib import colors from reportlab.platypus import ( SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle, HRFlowable, KeepTogether ) from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY # ── Output path ────────────────────────────────────────────────────────────── OUTPUT = "/tmp/workspace/brain-tracts-pdf/Brain_Tracts_Quick_Reference.pdf" # ── Color palette ───────────────────────────────────────────────────────────── NAVY = colors.HexColor("#0D2B4E") BLUE = colors.HexColor("#1A5276") TEAL = colors.HexColor("#1ABC9C") AMBER = colors.HexColor("#F39C12") RED = colors.HexColor("#C0392B") GREEN = colors.HexColor("#27AE60") PURPLE = colors.HexColor("#6C3483") LGRAY = colors.HexColor("#F2F4F7") DGRAY = colors.HexColor("#566573") WHITE = colors.white # ── Document ───────────────────────────────────────────────────────────────── doc = SimpleDocTemplate( OUTPUT, pagesize=A4, topMargin=1.5*cm, bottomMargin=1.8*cm, leftMargin=1.5*cm, rightMargin=1.5*cm, title="Brain Tracts Quick Reference", author="Orris Medical", ) W = A4[0] - 3*cm # usable width styles = getSampleStyleSheet() # ── Custom styles ───────────────────────────────────────────────────────────── def S(name, **kw): return ParagraphStyle(name, **kw) h1 = S("H1", fontSize=22, textColor=WHITE, alignment=TA_CENTER, fontName="Helvetica-Bold", spaceAfter=2) h2 = S("H2", fontSize=13, textColor=WHITE, alignment=TA_CENTER, fontName="Helvetica-Bold", spaceAfter=2) sec = S("SEC", fontSize=11, textColor=WHITE, alignment=TA_LEFT, fontName="Helvetica-Bold", leftIndent=4) sub = S("SUB", fontSize=10, textColor=NAVY, alignment=TA_LEFT, fontName="Helvetica-Bold", spaceAfter=2) bod = S("BOD", fontSize=8.5, textColor=colors.HexColor("#2C3E50"), fontName="Helvetica", leading=12, spaceAfter=1) sml = S("SML", fontSize=7.8, textColor=DGRAY, fontName="Helvetica", leading=11) cap = S("CAP", fontSize=7, textColor=WHITE, alignment=TA_CENTER, fontName="Helvetica-Bold") foot= S("FOOT",fontSize=7, textColor=DGRAY, alignment=TA_CENTER, fontName="Helvetica-Oblique") # ── Helpers ─────────────────────────────────────────────────────────────────── def section_banner(text, color=BLUE): tbl = Table([[Paragraph(text, sec)]], colWidths=[W]) tbl.setStyle(TableStyle([ ("BACKGROUND", (0,0), (-1,-1), color), ("TOPPADDING", (0,0),(-1,-1), 5), ("BOTTOMPADDING", (0,0),(-1,-1), 5), ("LEFTPADDING", (0,0),(-1,-1), 8), ("RIGHTPADDING", (0,0),(-1,-1), 8), ("ROUNDEDCORNERS", [4,4,4,4]), ])) return tbl def mini_banner(text, color=TEAL): tbl = Table([[Paragraph(text, cap)]], colWidths=[W]) tbl.setStyle(TableStyle([ ("BACKGROUND", (0,0),(-1,-1), color), ("TOPPADDING", (0,0),(-1,-1), 3), ("BOTTOMPADDING", (0,0),(-1,-1), 3), ])) return tbl def header_row(cells, col_colors=None): """Returns a list of styled header cells.""" col_colors = col_colors or [NAVY]*len(cells) row = [] for txt, c in zip(cells, col_colors): p = Paragraph(f"<b>{txt}</b>", S("_hdr", fontSize=8.5, textColor=WHITE, fontName="Helvetica-Bold", alignment=TA_CENTER)) row.append(p) return row def cell(text, bold=False, color=colors.black, align=TA_LEFT): fn = "Helvetica-Bold" if bold else "Helvetica" p = Paragraph(text, S("_c", fontSize=8, textColor=color, fontName=fn, leading=11, alignment=align)) return p def make_table(header, rows, col_widths, hdr_color=NAVY, alt=LGRAY): data = [header_row(header)] + rows t = Table(data, colWidths=col_widths) style = [ # Header ("BACKGROUND", (0,0), (-1,0), hdr_color), ("TEXTCOLOR", (0,0), (-1,0), WHITE), ("FONTNAME", (0,0), (-1,0), "Helvetica-Bold"), ("FONTSIZE", (0,0), (-1,0), 8.5), ("ALIGN", (0,0), (-1,0), "CENTER"), ("VALIGN", (0,0), (-1,-1), "TOP"), ("TOPPADDING", (0,0), (-1,-1), 4), ("BOTTOMPADDING", (0,0), (-1,-1), 4), ("LEFTPADDING", (0,0), (-1,-1), 5), ("RIGHTPADDING", (0,0), (-1,-1), 5), ("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#BDC3C7")), ("ROWBACKGROUNDS",(0,1), (-1,-1), [WHITE, alt]), ("FONTSIZE", (0,1), (-1,-1), 8), ] t.setStyle(TableStyle(style)) return t sp = lambda h=4: Spacer(1, h) # ── Content ─────────────────────────────────────────────────────────────────── story = [] # ══ TITLE BLOCK ═══════════════════════════════════════════════════════════════ title_data = [[ Paragraph("BRAIN TRACTS", h1), Paragraph("QUICK REFERENCE", h2), Paragraph("Ascending · Descending · Association · Commissural · Projection", cap), ]] title_tbl = Table(title_data, colWidths=[W]) title_tbl.setStyle(TableStyle([ ("BACKGROUND", (0,0),(-1,-1), NAVY), ("TOPPADDING", (0,0),(-1,-1), 12), ("BOTTOMPADDING", (0,0),(-1,-1), 12), ("LEFTPADDING", (0,0),(-1,-1), 8), ("ROUNDEDCORNERS",[6,6,6,6]), ])) story += [title_tbl, sp(10)] # ══ SECTION 1: ASCENDING (SENSORY) TRACTS ═════════════════════════════════════ story += [section_banner("1 ASCENDING (SENSORY) TRACTS", BLUE), sp(5)] asc_header = ["Tract", "Pathway / Neurons", "Modality", "Decussation", "Key Clinical Point"] asc_cols = [2.8*cm, 4.2*cm, 3.2*cm, 2.8*cm, 4.8*cm] asc_rows = [ [cell("Dorsal Columns\n(Fasciculus Gracilis\n& Cuneatus)", bold=True, color=BLUE), cell("1° neuron: DRG → ipsilateral dorsal column\n2° neuron: nucleus gracilis / cuneatus (medulla) → decussates\n3° neuron: VPL thalamus → primary somatosensory cortex (S1)"), cell("Fine touch, vibration, 2-point discrimination, conscious proprioception"), cell("Medial lemniscal decussation\n(caudal medulla)"), cell("Lesion: ipsilateral loss of fine touch & proprioception below level. Positive Romberg. Tabes dorsalis (syphilis), subacute combined degeneration (B12 deficiency).")], [cell("Spinothalamic Tract\n(Anterolateral System)", bold=True, color=RED), cell("1° neuron: DRG → dorsal horn (Rexed laminae I, V)\n2° neuron: crosses within 1–2 spinal segments via anterior commissure → contralateral STT → VPL thalamus\n3° neuron: → S1 cortex"), cell("Pain, temperature (lateral); crude touch, pressure (anterior)"), cell("Spinal cord (within 1–2 segments of entry)"), cell("Lesion: contralateral pain & temperature loss below level. Syringomyelia gives bilateral 'cape' distribution loss (central cord). Brown-Séquard: contralateral loss 2 levels below.")], [cell("Spinocerebellar\nTracts", bold=True, color=GREEN), cell("Posterior (dorsal) SCT: Clarke's nucleus (C8–L3) → ipsilateral ICP → cerebellum\nAnterior (ventral) SCT: crosses twice (net ipsilateral) → SCP → cerebellum"), cell("Unconscious proprioception (muscle spindle, Golgi tendon organ activity)"), cell("PSCT: uncrossed\nASCT: crosses twice (net ipsilateral)"), cell("Both reach ipsilateral cerebellum. Lesions produce ipsilateral ataxia without cortical involvement. Important in Friedreich's ataxia.")], [cell("Trigeminothalamic\nTract", bold=True, color=PURPLE), cell("1° neuron: trigeminal ganglion\nFine touch → main sensory nucleus (pons)\nPain/temp → spinal nucleus (medulla/upper cord)\n→ decussates → VPM thalamus → S1"), cell("All sensory modalities from face, scalp, cornea, sinuses, teeth, dura"), cell("Mostly crosses in pons/medulla → VPM (contralateral)"), cell("Corneal reflex arc. Wallenberg (lateral medullary) syndrome: ipsilateral face + contralateral body pain/temp loss (crossed pattern).")], [cell("Spinoreticular\nTract", bold=True, color=DGRAY), cell("Laminae VII/VIII → bilateral reticular formation → diffuse cortical projection"), cell("Affective/arousal component of pain; chronic/diffuse pain"), cell("Bilateral"), cell("Mediates the unpleasant quality of pain. Target of opioid analgesics via PAG-raphe pathway.")], ] story += [make_table(asc_header, asc_rows, asc_cols, hdr_color=BLUE), sp(10)] # ══ SECTION 2: DESCENDING (MOTOR) TRACTS ══════════════════════════════════════ story += [section_banner("2 DESCENDING (MOTOR) TRACTS", colors.HexColor("#922B21")), sp(5)] desc_header = ["Tract", "Origin → Destination", "Function", "Decussation", "LMN / UMN Lesion Signs"] desc_cols = [2.8*cm, 4.0*cm, 3.2*cm, 2.8*cm, 5.0*cm] desc_rows = [ [cell("Lateral Corticospinal\nTract (LCST)", bold=True, color=RED), cell("Primary motor cortex (M1, precentral gyrus, area 4) + premotor & supplementary areas → internal capsule posterior limb → cerebral peduncles → pyramids → pyramidal decussation (85–90%) → lateral funiculus → ventral horn LMN"), cell("Fine voluntary motor control, especially distal limb muscles (hand dexterity)"), cell("Pyramidal decussation\n(caudal medulla)"), cell("UMN lesion (above decussation): contralateral spastic paresis, hyperreflexia, Babinski sign, clasp-knife spasticity, no muscle wasting\nLMN lesion: flaccid paralysis, hyporeflexia, fasciculations, muscle atrophy")], [cell("Anterior Corticospinal\nTract (ACST)", bold=True, color=colors.HexColor("#C0392B")), cell("M1 / premotor cortex → anterior funiculus (uncrossed) → crosses at segmental level via anterior commissure → bilateral ventral horns (axial muscles)"), cell("Bilateral trunk/axial muscle control; postural adjustments"), cell("Crosses at spinal cord level (segmental)"), cell("Relatively preserved with hemispheric lesions due to bilateral representation. Axial sparing in many UMN syndromes.")], [cell("Corticobulbar\n(Corticonuclear) Tract", bold=True, color=AMBER), cell("M1/premotor cortex → genu of internal capsule → bilateral cranial nerve motor nuclei (III–VII, IX–XII)\nException: CN VII lower face & CN XII are predominantly contralateral"), cell("Voluntary motor control of face, jaw, palate, pharynx, larynx, tongue"), cell("Mostly bilateral; CN VII lower face & CN XII predominantly contralateral"), cell("Unilateral UMN lesion: contralateral lower face weakness (spares forehead) + contralateral tongue deviation. Central (UMN) vs peripheral (LMN) CN VII palsy distinction.")], [cell("Rubrospinal Tract", bold=True, color=TEAL), cell("Red nucleus (midbrain tegmentum) → decussates immediately (ventral tegmental decussation) → lateral funiculus → ventral horn"), cell("Modulates flexor tone; assists LCST for distal limb control (more prominent in non-human primates)"), cell("Ventral tegmental decussation\n(midbrain)"), cell("Minor clinical significance in humans. Red nucleus lesions: contralateral intention tremor + cerebellar-like signs (Claude's syndrome with CN III palsy).")], [cell("Reticulospinal\nTracts", bold=True, color=GREEN), cell("Pontine reticular formation → medial (anterior) funiculus → ipsilateral (excitatory)\nMedullary reticular formation → lateral funiculus → bilateral (inhibitory)"), cell("Modulate muscle tone, posture, autonomic control, gait pattern generation"), cell("Pontine RST: uncrossed\nMedullary RST: bilateral"), cell("Pontine RST facilitates extensors (anti-gravity). Medullary RST inhibits extensors. Decerebrate posturing (lesion below red nucleus): extensor dominant. Decorticate posturing: flexor dominant upper limbs.")], [cell("Vestibulospinal\nTracts", bold=True, color=PURPLE), cell("Lateral VST: lateral vestibular nucleus (Deiters) → ipsilateral entire cord → ventral horn\nMedial VST: medial vestibular nuclei → bilateral cervical cord"), cell("Facilitate ipsilateral extensor muscles; coordinate head/neck stabilization (medial VST); maintain upright posture"), cell("Lateral VST: uncrossed\nMedial VST: bilateral"), cell("Hyperactive with loss of cerebellar inhibition. Contributes to decerebrate posturing. Medial VST important for VOR and head-righting reflexes.")], [cell("Tectospinal Tract", bold=True, color=DGRAY), cell("Superior colliculus → dorsal tegmental decussation → contralateral anterior funiculus → upper cervical cord"), cell("Reflexive head/neck turning toward visual or auditory stimuli (orienting reflex)"), cell("Dorsal tegmental decussation\n(midbrain)"), cell("Rarely isolated clinically. Involved in superior colliculus-mediated visuomotor reflexes.")], ] story += [make_table(desc_header, desc_rows, desc_cols, hdr_color=colors.HexColor("#922B21")), sp(10)] # ══ SECTION 3: ASSOCIATION, COMMISSURAL & PROJECTION FIBERS ═══════════════════ story += [section_banner("3 ASSOCIATION, COMMISSURAL & PROJECTION FIBERS", colors.HexColor("#1A5276")), sp(5)] assoc_header = ["Fiber System", "Course", "Function", "Clinical Relevance"] assoc_cols = [3.5*cm, 4.5*cm, 4.0*cm, 5.8*cm] assoc_rows = [ [cell("Corpus Callosum", bold=True, color=NAVY), cell("Largest commissure. Rostrum, genu (prefrontal), body (parietal-motor-sensory), splenium (temporal-occipital)"), cell("Interhemispheric communication; integrates sensory, motor, and cognitive information between left and right cortex"), cell("Agenesis: often asymptomatic due to Probst bundles. Callosotomy (split-brain): disconnection syndrome — left hand doesn't know what right hand does, alien hand. Genu lesions: frontal disconnection.")], [cell("Anterior Commissure", bold=True, color=BLUE), cell("Crosses midline anterior to columns of fornix; connects anterior temporal lobes and olfactory structures"), cell("Olfactory communication; anterior temporal lobe integration"), cell("Landmark on MRI for anterior commissure-posterior commissure (AC-PC) line used in neurosurgical targeting and atlas coordinates.")], [cell("Posterior Commissure", bold=True, color=BLUE), cell("Crosses superior to cerebral aqueduct; connects pretectal nuclei"), cell("Consensual pupillary light reflex (afferent limb crosses via posterior commissure to bilateral Edinger-Westphal nuclei)"), cell("Parinaud's syndrome (dorsal midbrain): compresses posterior commissure → upgaze palsy, convergence-retraction nystagmus, light-near dissociation.")], [cell("Arcuate Fasciculus\n(Superior Longitudinal\nFasciculus)", bold=True, color=RED), cell("Arcs around insula; connects Wernicke's area (posterior superior temporal, BA 22) ↔ Broca's area (inferior frontal, BA 44/45) in left hemisphere"), cell("Language: connects receptive and expressive speech areas"), cell("Lesion: Conduction aphasia — fluent speech, intact comprehension, severely impaired repetition. Hallmark is paraphasic errors in repetition.")], [cell("Uncinate Fasciculus", bold=True, color=PURPLE), cell("Hooks around the lateral sulcus; connects orbitofrontal cortex ↔ anterior temporal lobe"), cell("Memory consolidation, emotion-behavior integration, naming"), cell("Disrupted in temporal lobe epilepsy, semantic dementia, and certain antisocial behavior disorders. Severed in some temporal lobectomies.")], [cell("Cingulum Bundle", bold=True, color=GREEN), cell("Runs within the cingulate gyrus; connects medial frontal, parietal, and temporal cortices — major limbic association pathway"), cell("Emotional processing, memory, attention, autonomic regulation — core of the Papez circuit"), cell("Disrupted in depression, anxiety, Alzheimer's disease. Target of cingulotomy for refractory OCD/depression.")], [cell("Internal Capsule", bold=True, color=AMBER), cell("Anterior limb: thalamocortical (prefrontal), frontopontine\nGenu: corticobulbar\nPosterior limb: corticospinal (hand area most posterior), thalamocortical sensory radiations"), cell("Major conduit for all cortical input/output — corticospinal, corticobulbar, thalamocortical, and corticopontine fibers"), cell("Lacunar infarcts here → pure motor or pure sensory stroke (posterior limb = contralateral pure motor hemiplegia). Posterior limb lesion = classic dense contralateral hemiparesis.")], [cell("Corona Radiata", bold=True, color=TEAL), cell("Fan-shaped white matter radiating from internal capsule to entire cortex"), cell("Spreads all capsular fibers to/from cortical destinations"), cell("Lesions cause variable deficits depending on region. Periventricular white matter lesions (MS, SVD) commonly here.")], [cell("Fornix", bold=True, color=DGRAY), cell("Hippocampus → fimbria → crura → body → columns → mammillary bodies → anterior thalamic nucleus (Papez circuit)"), cell("Memory encoding and retrieval; major output of hippocampus; part of limbic circuit"), cell("Bilateral fornix lesion → severe anterograde amnesia (diencephalic amnesia). Wernicke-Korsakoff syndrome disrupts mammillary bodies (fornix output target).")], ] story += [make_table(assoc_header, assoc_rows, assoc_cols, hdr_color=colors.HexColor("#1A5276")), sp(10)] # ══ SECTION 4: CRANIAL NERVE SUMMARY TABLE ════════════════════════════════════ story += [section_banner("4 CRANIAL NERVES — SUMMARY", colors.HexColor("#515A5A")), sp(5)] cn_header = ["CN", "Name", "Type", "Foramen / Exit", "Function", "Key Test / Lesion"] cn_cols = [1.0*cm, 2.8*cm, 1.6*cm, 2.8*cm, 4.0*cm, 5.6*cm] cn_rows = [ [cell("I"), cell("Olfactory"), cell("Sensory"), cell("Cribriform plate"), cell("Smell"), cell("Anosmia (fracture/subfrontal meningioma). Foster Kennedy syndrome: ipsilateral optic atrophy + contralateral papilledema.")], [cell("II"), cell("Optic"), cell("Sensory"), cell("Optic canal"), cell("Vision; afferent pupillary reflex"), cell("Optic neuritis (MS). Relative afferent pupillary defect (RAPD / Marcus Gunn). Bitemporal hemianopia = chiasmal lesion.")], [cell("III"), cell("Oculomotor"), cell("Motor + PS"), cell("Superior orbital fissure"), cell("SR, IR, MR, IO; levator palpebrae; pupil constriction (E-W nucleus)"), cell("Down-and-out gaze + ptosis + fixed dilated pupil = surgical CN III palsy (e.g., PCoA aneurysm). Medical CN III (DM): spares pupil.")], [cell("IV"), cell("Trochlear"), cell("Motor"), cell("Superior orbital fissure"), cell("Superior oblique (intorts + depresses)"), cell("Head tilt away from side of lesion. Longest intracranial course — most vulnerable to closed head trauma.")], [cell("V"), cell("Trigeminal"), cell("Mixed"), cell("V1: SOF; V2: foramen rotundum; V3: foramen ovale"), cell("Face sensation (3 divisions); mastication (V3 motor)"), cell("Corneal reflex (afferent V1). Trigeminal neuralgia (V2/V3). Jaw deviates toward LMN V3 lesion side.")], [cell("VI"), cell("Abducens"), cell("Motor"), cell("Superior orbital fissure"), cell("Lateral rectus (abducts eye)"), cell("Most common CN palsy. Medial deviation + diplopia on lateral gaze. False localizing sign with raised ICP.")], [cell("VII"), cell("Facial"), cell("Mixed"), cell("Internal auditory canal → stylomastoid foramen"), cell("Facial expression; taste (ant. 2/3 tongue); lacrimal/salivary glands; sensation EAC"), cell("UMN: contralateral lower face (forehead spared). LMN (Bell's palsy): entire ipsilateral face. Ramsay Hunt = VZV reactivation.")], [cell("VIII"),cell("Vestibulocochlear"),cell("Sensory"), cell("Internal auditory canal"), cell("Hearing (cochlear); balance (vestibular)"), cell("Weber/Rinne tests for sensorineural vs conductive. Acoustic neuroma (vestibular schwannoma) at CP angle — CNVII, V involvement.")], [cell("IX"), cell("Glossopharyngeal"),cell("Mixed"), cell("Jugular foramen"), cell("Taste post. 1/3 tongue; gag reflex afferent; carotid body/sinus; parotid gland"), cell("Gag reflex afferent. Carotid sinus syncope. Jugular foramen syndrome (IX, X, XI).")], [cell("X"), cell("Vagus"), cell("Mixed"), cell("Jugular foramen"), cell("Pharynx/larynx motor; visceral sensation; PNS to thorax/abdomen to splenic flexure"), cell("Hoarseness (recurrent laryngeal nerve). Uvula deviates away from lesion. Vagal syncope.")], [cell("XI"), cell("Accessory"), cell("Motor"), cell("Jugular foramen"), cell("SCM (head rotation), upper trapezius (shoulder shrug)"), cell("Shoulder droop + weakness of head rotation to opposite side. CN XI palsy after posterior triangle neck surgery.")], [cell("XII"), cell("Hypoglossal"), cell("Motor"), cell("Hypoglossal canal"), cell("Intrinsic + extrinsic tongue muscles"), cell("LMN: tongue deviates toward lesion (weak side), atrophy/fasciculations. UMN: tongue deviates away. Medial medullary syndrome (ASA infarct): XII + corticospinal.")], ] story += [make_table(cn_header, cn_rows, cn_cols, hdr_color=colors.HexColor("#515A5A")), sp(10)] # ══ SECTION 5: KEY CLINICAL SYNDROMES ═════════════════════════════════════════ story += [section_banner("5 KEY TRACT LESION SYNDROMES", colors.HexColor("#117A65")), sp(5)] syn_header = ["Syndrome", "Location of Lesion", "Tract(s) / Structures Involved", "Clinical Findings"] syn_cols = [3.2*cm, 3.5*cm, 4.0*cm, 7.1*cm] syn_rows = [ [cell("Brown-Séquard\nSyndrome", bold=True, color=RED), cell("Hemisection of spinal cord"), cell("Ipsilateral: LCST, dorsal columns\nContralateral: spinothalamic tract"), cell("Ipsilateral: UMN weakness + proprioception/vibration loss below lesion\nContralateral: pain/temperature loss 2 levels below\nIPSILATERAL at lesion level: LMN signs, dermatomal sensory loss (all modalities)")], [cell("Anterior Cord\nSyndrome", bold=True, color=RED), cell("Anterior 2/3 spinal cord (anterior spinal artery)"), cell("Bilateral LCST, bilateral spinothalamic tracts; dorsal columns SPARED"), cell("Bilateral UMN weakness + bilateral pain/temperature loss below lesion\nPreserved fine touch, vibration, proprioception (posterior columns intact)\nComplete loss of voluntary motor function")], [cell("Central Cord\nSyndrome", bold=True, color=RED), cell("Central gray matter + crossing spinothalamic fibers"), cell("Anterior commissure (spinothalamic crossing), central gray (LMN), surrounding LCST"), cell("Bilateral cape/suspended sensory loss (pain/temp) at lesion levels\nUpper limb > lower limb weakness (cervical somatotopy in LCST)\nBladder dysfunction common. Most common incomplete SCI (hyperextension in spondylosis)")], [cell("Lateral Medullary\n(Wallenberg) Syndrome", bold=True, color=PURPLE), cell("Lateral medulla\n(PICA / vertebral artery)"), cell("Spinal nucleus/tract CN V, spinothalamic tract, nucleus ambiguus, vestibular nuclei, descending sympathetic fibers, PSCT/ICP"), cell("Ipsilateral face: pain/temp loss (CN V spinal nucleus)\nContralateral body: pain/temp loss (spinothalamic)\nHoarseness/dysphagia (nucleus ambiguus, CN IX/X)\nNystagmus, vertigo, nausea (vestibular)\nHorner syndrome ipsilateral (descending sympathetics)\nIPSILATERAL ataxia (ICP/spinocerebellar)")], [cell("Medial Medullary\n(Dejerine) Syndrome", bold=True, color=PURPLE), cell("Medial medulla\n(ASA / vertebral artery)"), cell("Pyramids (CST), medial lemniscus, CN XII fascicles"), cell("Contralateral: UMN hemiparesis (pyramids), proprioception/vibration loss (medial lemniscus)\nIpsilateral: tongue weakness/deviation toward lesion (CN XII LMN)")], [cell("Weber's Syndrome", bold=True, color=AMBER), cell("Midbrain (cerebral peduncle + CN III fascicles)"), cell("Corticospinal tract in peduncle, CN III fascicles"), cell("Ipsilateral CN III palsy (down-and-out, ptosis, dilated pupil)\nContralateral UMN hemiparesis (corticospinal tract)")], [cell("Parinaud's Syndrome", bold=True, color=AMBER), cell("Dorsal midbrain\n(posterior commissure compression)"), cell("Posterior commissure, superior colliculus, pretectal area"), cell("Upgaze palsy ('setting sun' sign)\nConvergence-retraction nystagmus on upgaze attempt\nLight-near dissociation (pupils react to accommodation, not light)\nLid retraction (Collier's sign). Caused by pinealoma, hydrocephalus, MS")], [cell("Locked-In Syndrome", bold=True, color=NAVY), cell("Ventral pons (basilar artery thrombosis)"), cell("Bilateral corticospinal tracts, corticobulbar tracts; ARAS and consciousness SPARED"), cell("Quadriplegia + anarthria/aphonia (bilateral CST/CBT damage)\nFull consciousness preserved (ARAS intact)\nVertical eye movements and blinking preserved (oculomotor nuclei above lesion)\nPatient can communicate only with eye movements")], [cell("Conduction Aphasia", bold=True, color=GREEN), cell("Dominant parietal operculum / arcuate fasciculus"), cell("Arcuate fasciculus (Wernicke's ↔ Broca's connection)"), cell("Fluent speech (Broca's intact)\nNormal comprehension (Wernicke's intact)\nSeverely impaired repetition\nFrequent paraphasic errors (especially phonemic)\nPatient aware of errors (unlike Wernicke's aphasia)")], ] story += [make_table(syn_header, syn_rows, syn_cols, hdr_color=colors.HexColor("#117A65")), sp(10)] # ══ SECTION 6: QUICK MNEMONIC & RULES BOX ════════════════════════════════════ story += [section_banner("6 RULES, TIPS & MNEMONICS", colors.HexColor("#6C3483")), sp(6)] tips = [ ("Sensory decussation rule", "Pain/temp (spinothalamic) crosses IMMEDIATELY in spinal cord (within 1–2 segments).\nFine touch/proprioception (dorsal columns) crosses in the MEDULLA (medial lemniscal decussation).\nFace sensation (trigeminothalamic) crosses in PONS/MEDULLA.\nResult: A lateral medullary lesion gives CROSSED sensory loss — ipsilateral face, contralateral body."), ("Motor decussation rule", "Corticospinal tract crosses at PYRAMIDAL DECUSSATION (caudal medulla, 85–90%).\nA cortical or internal capsule lesion causes CONTRALATERAL weakness.\nA spinal cord lesion causes IPSILATERAL UMN weakness below the level."), ("Dorsal vs ventral in cord", "DORSAL white matter = DORSAL COLUMNS (fine touch, vibration, proprioception — going UP).\nVENTRAL/ANTERIOR white matter = motor tracts going DOWN + anterior STT.\nLATERAL white matter = lateral CST (main motor) + lateral STT (pain/temp)."), ("UMN vs LMN quick rule", "UMN lesion: Spastic paralysis, hyperreflexia, Babinski +, NO atrophy, NO fasciculations.\nLMN lesion: Flaccid paralysis, hyporeflexia, Babinski –, muscle atrophy, fasciculations.\nMemory aid: UMN = Upper = spastic UPPER-regulation lost; LMN = Lower = limp/atrophy."), ("CN VII forehead sparing", "Upper motor neuron lesion (stroke) → LOWER face contralateral weakness; forehead SPARED (bilateral cortical representation of forehead).\nLower motor neuron lesion (Bell's palsy) → ENTIRE ipsilateral face including forehead."), ("Parinaud mnemonic — 'No Lid Up'", "No upgaze, lid retraction (Collier's sign), light-near dissociation, Nystagmus (convergence-retraction). Compression of POSTERIOR COMMISSURE."), ("Wallenberg 'AICA vs PICA'", "PICA = Posterior Inferior Cerebellar Artery → Lateral medullary (Wallenberg) syndrome.\nAICA = Anterior Inferior Cerebellar Artery → Lateral pontine syndrome (similar but adds CN VI, VII, VIII, Horner's, ipsilateral limb ataxia)."), ] tip_rows = [] for title, content in tips: tip_rows.append([ cell(title, bold=True, color=PURPLE), cell(content) ]) tip_tbl = Table(tip_rows, colWidths=[4.5*cm, 13.3*cm]) tip_tbl.setStyle(TableStyle([ ("VALIGN", (0,0),(-1,-1), "TOP"), ("TOPPADDING", (0,0),(-1,-1), 5), ("BOTTOMPADDING", (0,0),(-1,-1), 5), ("LEFTPADDING", (0,0),(-1,-1), 6), ("RIGHTPADDING", (0,0),(-1,-1), 6), ("GRID", (0,0),(-1,-1), 0.4, colors.HexColor("#BDC3C7")), ("ROWBACKGROUNDS",(0,0),(-1,-1), [WHITE, LGRAY]), ("FONTSIZE", (0,0),(-1,-1), 8), ])) story += [tip_tbl, sp(12)] # ══ FOOTER LINE ════════════════════════════════════════════════════════════════ story += [ HRFlowable(width=W, thickness=0.5, color=DGRAY), sp(3), Paragraph( "Quick Reference: Brain Tracts & Functions | Sources: Gray's Anatomy for Students; Kandel Principles of Neural Science 6e; Medical Physiology (Boron & Boulpaep) | Orris Medical", foot ) ] # ── Build ───────────────────────────────────────────────────────────────────── doc.build(story) print(f"PDF created: {OUTPUT}") PYEOF echo "Script written successfully"
cd /tmp/workspace/brain-tracts-pdf && python generate.py 2>&1
ls -lh /tmp/workspace/brain-tracts-pdf/Brain_Tracts_Quick_Reference.pdf
Brain Tracts Quick Reference
PDF Document · PDF