Explain each and everything about Spinal Cord and Ascending, Descending, and Intersegmental Tracts. I want even the minor details. Also explain all the clinicals along the content. Also create the pdf containing each and everything. Use different colors in pdf so that it look more beautiful and easy to read
mkdir -p /home/daytona/workspace/spinal-cord-pdf && ls /home/daytona/workspace/s…
~/spinal-cord-pdf/create_pdf.py
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import cm, mm
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
HRFlowable, PageBreak, KeepTogether
)
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
from reportlab.platypus import BaseDocTemplate, PageTemplate, Frame
from reportlab.lib.colors import HexColor
# ─── Color Palette ───────────────────────────────────────────────────────────
DARK_NAVY = HexColor("#0A1628")
ROYAL_BLUE = HexColor("#1A3A6B")
MED_BLUE = HexColor("#2C5F9E")
LIGHT_BLUE = HexColor("#D6E8FF")
TEAL = HexColor("#0E7C7B")
TEAL_LIGHT = HexColor("#D0F0EF")
ORANGE = HexColor("#E07B2A")
ORANGE_LIGHT = HexColor("#FFF0E0")
GREEN = HexColor("#1B7F3A")
GREEN_LIGHT = HexColor("#D4EDDA")
PURPLE = HexColor("#6A3DA8")
PURPLE_LIGHT = HexColor("#EDE0FF")
RED = HexColor("#C0392B")
RED_LIGHT = HexColor("#FADBD8")
GOLD = HexColor("#D4AC0D")
GOLD_LIGHT = HexColor("#FEF9E7")
GRAY_LIGHT = HexColor("#F5F7FA")
GRAY_MED = HexColor("#BDC3C7")
WHITE = colors.white
BLACK = colors.black
# ─── Document Setup ──────────────────────────────────────────────────────────
OUTPUT = "/home/daytona/workspace/spinal-cord-pdf/Spinal_Cord_Complete_Guide.pdf"
doc = SimpleDocTemplate(
OUTPUT,
pagesize=A4,
rightMargin=1.8*cm, leftMargin=1.8*cm,
topMargin=2*cm, bottomMargin=2*cm,
title="Spinal Cord & Tracts — Complete Guide",
author="Orris Medical"
)
W, H = A4
# ─── Styles ──────────────────────────────────────────────────────────────────
def make_style(name, parent="Normal", **kwargs):
s = ParagraphStyle(name, parent=getSampleStyleSheet()[parent])
for k, v in kwargs.items():
setattr(s, k, v)
return s
cover_title = make_style("CoverTitle", fontSize=30, textColor=WHITE, alignment=TA_CENTER, leading=38, spaceAfter=8, fontName="Helvetica-Bold")
cover_sub = make_style("CoverSub", fontSize=16, textColor=GOLD, alignment=TA_CENTER, leading=22, spaceAfter=4, fontName="Helvetica-Bold")
cover_body = make_style("CoverBody", fontSize=11, textColor=LIGHT_BLUE, alignment=TA_CENTER, leading=16, spaceAfter=6, fontName="Helvetica")
h1 = make_style("H1", fontSize=16, textColor=WHITE, fontName="Helvetica-Bold", alignment=TA_LEFT, leading=22, spaceBefore=4, spaceAfter=4)
h2 = make_style("H2", fontSize=13, textColor=ROYAL_BLUE, fontName="Helvetica-Bold", alignment=TA_LEFT, leading=18, spaceBefore=10, spaceAfter=4)
h3 = make_style("H3", fontSize=11, textColor=TEAL, fontName="Helvetica-Bold", alignment=TA_LEFT, leading=16, spaceBefore=8, spaceAfter=3)
h4 = make_style("H4", fontSize=10, textColor=ORANGE, fontName="Helvetica-Bold", alignment=TA_LEFT, leading=14, spaceBefore=6, spaceAfter=2)
body = make_style("Body", fontSize=9.5, textColor=HexColor("#1C1C1C"), fontName="Helvetica", alignment=TA_JUSTIFY, leading=14, spaceAfter=5)
bullet= make_style("Bullet",fontSize=9.5, textColor=HexColor("#1C1C1C"), fontName="Helvetica", alignment=TA_LEFT, leading=14, spaceAfter=3, leftIndent=14, bulletIndent=4)
note = make_style("Note", fontSize=9, textColor=HexColor("#1C1C1C"), fontName="Helvetica-Oblique", alignment=TA_JUSTIFY, leading=13, spaceAfter=4)
clin = make_style("Clin", fontSize=9.5, textColor=HexColor("#1C1C1C"), fontName="Helvetica", alignment=TA_JUSTIFY, leading=14, spaceAfter=4)
toc_h = make_style("TocH", fontSize=11, textColor=ROYAL_BLUE, fontName="Helvetica-Bold", alignment=TA_LEFT, leading=16, spaceBefore=2, spaceAfter=1)
toc_i = make_style("TocI", fontSize=9.5, textColor=HexColor("#333"), fontName="Helvetica", alignment=TA_LEFT, leading=14, spaceBefore=1, spaceAfter=1, leftIndent=12)
# ─── Helper Functions ────────────────────────────────────────────────────────
def section_banner(title, bg=ROYAL_BLUE, text_color=WHITE):
data = [[Paragraph(title, h1)]]
t = Table(data, colWidths=[doc.width])
t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), bg),
("TOPPADDING", (0,0), (-1,-1), 8),
("BOTTOMPADDING", (0,0), (-1,-1), 8),
("LEFTPADDING", (0,0), (-1,-1), 12),
("RIGHTPADDING", (0,0), (-1,-1), 12),
("ROUNDEDCORNERS", [6]),
]))
return t
def subsection_banner(title, bg=TEAL, text_color=WHITE):
data = [[Paragraph(f"<font color='white'><b>{title}</b></font>",
make_style("_sb", fontSize=11, fontName="Helvetica-Bold",
textColor=WHITE, alignment=TA_LEFT, leading=15))]]
t = Table(data, colWidths=[doc.width])
t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), bg),
("TOPPADDING", (0,0), (-1,-1), 6),
("BOTTOMPADDING", (0,0), (-1,-1), 6),
("LEFTPADDING", (0,0), (-1,-1), 10),
("RIGHTPADDING", (0,0), (-1,-1), 10),
]))
return t
def info_box(title, content_paras, bg=LIGHT_BLUE, title_color=ROYAL_BLUE):
rows = [[Paragraph(f"<b><font color='{title_color.hexval() if hasattr(title_color,'hexval') else '#1A3A6B'}'>{title}</font></b>",
make_style("_ib_title", fontSize=10, fontName="Helvetica-Bold",
textColor=title_color, alignment=TA_LEFT, leading=14))]]
for p in content_paras:
rows.append([p])
t = Table(rows, colWidths=[doc.width])
t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), bg),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 10),
("RIGHTPADDING", (0,0), (-1,-1), 10),
("BOX", (0,0), (-1,-1), 1, title_color),
("LINEBELOW", (0,0), (-1,0), 1, title_color),
]))
return t
def clinical_box(title, paras):
return info_box(f"CLINICAL CORNER: {title}", paras, bg=RED_LIGHT, title_color=RED)
def key_box(title, paras):
return info_box(f"KEY POINT: {title}", paras, bg=GOLD_LIGHT, title_color=GOLD)
def tract_table(data, header_bg=MED_BLUE):
"""data: list of rows, first row = header"""
col_w = doc.width / len(data[0])
col_ws = [col_w] * len(data[0])
t = Table(data, colWidths=col_ws, repeatRows=1)
style = [
("BACKGROUND", (0,0), (-1,0), header_bg),
("TEXTCOLOR", (0,0), (-1,0), WHITE),
("FONTNAME", (0,0), (-1,0), "Helvetica-Bold"),
("FONTSIZE", (0,0), (-1,-1), 8.5),
("ALIGN", (0,0), (-1,-1), "LEFT"),
("VALIGN", (0,0), (-1,-1), "TOP"),
("GRID", (0,0), (-1,-1), 0.4, GRAY_MED),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING",(0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 5),
("RIGHTPADDING", (0,0), (-1,-1), 5),
("ROWBACKGROUNDS",(0,1), (-1,-1), [WHITE, GRAY_LIGHT]),
]
t.setStyle(TableStyle(style))
return t
def bp(text, style=bullet):
return Paragraph(f"• {text}", style)
def B(text): # bold inline
return f"<b>{text}</b>"
def sp(n=1):
return Spacer(1, n*4*mm)
def hr(color=GRAY_MED, thickness=0.5):
return HRFlowable(width="100%", thickness=thickness, color=color, spaceAfter=4)
# ═══════════════════════════════════════════════════════════════════════════════
# BUILD CONTENT
# ═══════════════════════════════════════════════════════════════════════════════
story = []
# ─────────────────────────── COVER PAGE ──────────────────────────────────────
cover_data = [[
Paragraph("SPINAL CORD", cover_title),
Paragraph("Ascending, Descending & Intersegmental Tracts", cover_sub),
Spacer(1, 0.4*cm),
Paragraph("A Comprehensive Medical Reference", cover_body),
Paragraph("Anatomy · Physiology · Pathways · Clinical Correlates", cover_body),
Spacer(1, 0.8*cm),
Paragraph("Based on Gray's Anatomy, Guyton & Hall, Adams & Victor's Neurology,", cover_body),
Paragraph("Localization in Clinical Neurology, Neuroscience: Exploring the Brain", cover_body),
]]
ct = Table(cover_data, colWidths=[doc.width])
ct.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), DARK_NAVY),
("TOPPADDING", (0,0), (-1,-1), 30),
("BOTTOMPADDING", (0,0), (-1,-1), 30),
("LEFTPADDING", (0,0), (-1,-1), 20),
("RIGHTPADDING", (0,0), (-1,-1), 20),
]))
story.append(ct)
story.append(PageBreak())
# ─────────────────────────── TABLE OF CONTENTS ────────────────────────────────
story.append(section_banner("TABLE OF CONTENTS", bg=DARK_NAVY))
story.append(sp(1))
toc_items = [
("1.", "Overview of the Spinal Cord"),
(" 1.1", "Gross Anatomy & Extent"),
(" 1.2", "External Features (Fissures & Sulci)"),
(" 1.3", "Internal Structure — Gray & White Matter"),
(" 1.4", "Rexed's Laminae"),
(" 1.5", "Spinal Cord Enlargements"),
(" 1.6", "Blood Supply"),
("2.", "Ascending Tracts (Sensory Pathways)"),
(" 2.1", "Anterolateral System (Spinothalamic Tract)"),
(" 2.2", "Spinoreticular Tract"),
(" 2.3", "Spinomesencephalic Tract"),
(" 2.4", "Posterior Column – Medial Lemniscal Pathway"),
(" 2.5", "Dorsal Spinocerebellar Tract (DSCT)"),
(" 2.6", "Ventral Spinocerebellar Tract (VSCT)"),
(" 2.7", "Cuneocerebellar & Rostrocerebellar Tracts"),
(" 2.8", "Spino-olivary Tract"),
(" 2.9", "Spinotectal Tract"),
("3.", "Descending Tracts (Motor Pathways)"),
(" 3.1", "Lateral Corticospinal Tract"),
(" 3.2", "Ventral (Anterior) Corticospinal Tract"),
(" 3.3", "Rubrospinal Tract"),
(" 3.4", "Lateral Reticulospinal Tract"),
(" 3.5", "Medial Reticulospinal Tract"),
(" 3.6", "Vestibulospinal Tracts (Lateral & Medial)"),
(" 3.7", "Tectospinal Tract"),
(" 3.8", "Raphespinal Tract"),
("4.", "Intersegmental Tracts (Propriospinal System)"),
(" 4.1", "Fasciculus Proprius"),
(" 4.2", "Posterior Commissural Fibers"),
(" 4.3", "Functions of Intersegmental Tracts"),
("5.", "Clinical Syndromes"),
(" 5.1", "Complete Cord Transection & Spinal Shock"),
(" 5.2", "Brown-Séquard Syndrome (Hemisection)"),
(" 5.3", "Anterior Cord Syndrome"),
(" 5.4", "Central Cord Syndrome"),
(" 5.5", "Posterior Cord Syndrome"),
(" 5.6", "Conus Medullaris Syndrome"),
(" 5.7", "Cauda Equina Syndrome"),
(" 5.8", "Upper vs. Lower Motor Neuron Lesions"),
("6.", "Summary Table of All Tracts"),
]
for num, item in toc_items:
st = toc_h if not num.startswith(" ") else toc_i
story.append(Paragraph(f"{num} {item}", st))
story.append(PageBreak())
# ═══════════════════════════════════════════════════════════════════════════════
# SECTION 1: SPINAL CORD OVERVIEW
# ═══════════════════════════════════════════════════════════════════════════════
story.append(section_banner("SECTION 1: OVERVIEW OF THE SPINAL CORD", bg=ROYAL_BLUE))
story.append(sp(1))
story.append(subsection_banner("1.1 Gross Anatomy & Extent", bg=MED_BLUE))
story.append(sp())
story.append(Paragraph(
"The spinal cord is the elongated, roughly cylindrical part of the central nervous system (CNS) "
"that lies within the vertebral canal. It is the primary conduit for neural traffic between the "
"brain and the body, and also processes reflex arcs locally.", body))
story.append(Paragraph(
B("Extent:") + " From the foramen magnum (continuous with the medulla oblongata) down to "
"approximately the level of the intervertebral disc between <b>L1–L2</b> in adults. "
"It can end as high as T12 or as low as the L2–L3 disc. In neonates it extends to ~L3.", body))
story.append(Paragraph(
B("Conus Medullaris:") + " The tapered, cone-shaped distal end of the spinal cord.", body))
story.append(Paragraph(
B("Filum Terminale:") + " A delicate pial thread continuing from the conus medullaris "
"to anchor the cord at the coccyx. The pial part (filum terminale internum) is ~15 cm; "
"the dural part (filum terminale externum) attaches to the dorsum of the coccyx.", body))
story.append(Paragraph(
B("Cauda Equina:") + " The bundle of lumbar and sacral nerve roots that descend below "
"the conus medullaris, resembling a horse's tail.", body))
story.append(sp())
story.append(subsection_banner("1.2 External Features (Fissures & Sulci)", bg=MED_BLUE))
story.append(sp())
ext_data = [
[B("Feature"), B("Location"), B("Significance")],
["Anterior Median Fissure", "Midline anterior surface", "Deepest fissure; anterior spinal artery runs nearby in pia mater"],
["Posterior Median Sulcus", "Midline posterior surface", "Separates two posterior white columns"],
["Posterior Intermediate Sulcus", "Between post. median & posterolateral sulci (cervical & upper thoracic)", "Separates fasciculus gracilis from fasciculus cuneatus"],
["Posterolateral Sulcus (Dorsolateral sulcus)", "Lateral to posterior median sulcus", "Entry zone for posterior (dorsal) rootlets of spinal nerves"],
["Anterolateral Sulcus", "Lateral to anterior median fissure", "Exit zone for anterior (ventral) rootlets of spinal nerves"],
]
story.append(tract_table(ext_data, header_bg=MED_BLUE))
story.append(sp())
story.append(subsection_banner("1.3 Internal Structure — Gray & White Matter", bg=MED_BLUE))
story.append(sp())
story.append(Paragraph(
"A transverse section of the spinal cord shows a central H-shaped (butterfly) region of "
"<b>gray matter</b> surrounded by <b>white matter</b>.", body))
story.append(Paragraph(B("Gray Matter:"), h4))
story.append(bp("Rich in neuron cell bodies, dendrites, interneurons, and axon terminals."))
story.append(bp("Divided into dorsal (posterior) horn, ventral (anterior) horn, and lateral horn (T1–L2 & S2–S4 only)."))
story.append(bp("Dorsal horn: receives sensory input; contains laminae I–VI."))
story.append(bp("Ventral horn: houses alpha & gamma motor neurons; contains laminae VIII–IX."))
story.append(bp("Lateral horn (intermediolateral column): autonomic preganglionic neurons."))
story.append(bp("Central canal is surrounded by the gray commissure."))
story.append(Paragraph(B("White Matter:"), h4))
story.append(bp("Rich in myelinated & unmyelinated axons forming ascending/descending tracts."))
story.append(bp("Organized into three funiculi (columns) on each side: anterior, lateral, and posterior."))
story.append(bp("Anterior funiculus: between anterior median fissure and anterolateral sulcus."))
story.append(bp("Lateral funiculus: between anterolateral and posterolateral sulci."))
story.append(bp("Posterior funiculus: between posterolateral sulcus and posterior median sulcus."))
story.append(sp())
story.append(subsection_banner("1.4 Rexed's Laminae", bg=MED_BLUE))
story.append(sp())
story.append(Paragraph(
"Bror Rexed (1952) divided the gray matter into 10 cytoarchitectural layers (laminae I–X) "
"based on cell size, density, and arrangement.", body))
laminae_data = [
[B("Lamina"), B("Location"), B("Function / Content")],
["I (Marginal Zone)", "Dorsal horn tip", "Pain & temp (first synapse of spinothalamic tract); Waldeyer's cells"],
["II (Substantia Gelatinosa)", "Dorsal horn, just below lamina I", "Pain modulation; receives Aδ & C fibers; opioid-rich zone"],
["III–IV (Nucleus Proprius)", "Mid-dorsal horn", "Discriminative touch, pressure; second-order sensory neurons"],
["V", "Neck of dorsal horn", "Wide-dynamic-range neurons; receive both somatic and visceral pain"],
["VI", "Base of dorsal horn (limb segments)", "Proprioceptive input from muscle spindles"],
["VII (Intermediate Zone)", "Intermediate gray", "Clarke's column (T1–L2) — DSCT origin; Renshaw cells; autonomic preganglionic (lateral horn)"],
["VIII", "Medial ventral horn", "Commissural interneurons; axial muscle control"],
["IX", "Lateral ventral horn", "Alpha & gamma motor neurons; neuromuscular junction targets"],
["X", "Surrounding central canal", "Gray commissure; visceral pain relay"],
]
story.append(tract_table(laminae_data, header_bg=TEAL))
story.append(sp())
story.append(subsection_banner("1.5 Spinal Cord Enlargements", bg=MED_BLUE))
story.append(sp())
story.append(Paragraph(
"The cord is not uniform in diameter; it has two fusiform swellings corresponding to "
"the innervation of the limbs:", body))
enlarg_data = [
[B("Enlargement"), B("Spinal Levels"), B("Nerves Arising"), B("Innervates")],
["Cervical (Intumescentia Cervicalis)", "C4–T1 (peak at C5–C8)", "Brachial plexus (C5–T1)", "Upper limbs"],
["Lumbosacral (Intumescentia Lumbosacralis)", "L1–S3 (peak at L4–S1)", "Lumbosacral plexus (L1–S3)", "Lower limbs"],
]
story.append(tract_table(enlarg_data, header_bg=ORANGE))
story.append(sp())
story.append(subsection_banner("1.6 Blood Supply of the Spinal Cord", bg=MED_BLUE))
story.append(sp())
story.append(Paragraph(B("Arterial Supply:"), h4))
story.append(bp("<b>Anterior Spinal Artery (ASA):</b> Formed by union of two branches from the vertebral arteries at the foramen magnum. Runs in the anterior median fissure. Supplies anterior 2/3 of the cord (ventral horn, anterior funiculus, lateral funiculus)."))
story.append(bp("<b>Posterior Spinal Arteries (PSA) — paired:</b> Arise from the vertebral arteries (or PICA). Run in the posterolateral sulci. Supply posterior 1/3 (posterior funiculus)."))
story.append(bp("<b>Radicular / Segmental Medullary Arteries:</b> Reinforce the ASA at various levels. The most important is the <b>Artery of Adamkiewicz</b> (arteria radicularis magna) arising from left T9–T12 segmental artery — critical for lower cord perfusion."))
story.append(Paragraph(B("Venous Drainage:"), h4))
story.append(bp("Anterior median spinal vein and posterior spinal veins drain into the internal vertebral venous plexus (Batson's plexus) — a valveless system that can spread infection/tumour."))
story.append(sp())
story.append(clinical_box("Anterior Spinal Artery Syndrome", [
Paragraph("Occlusion of the ASA produces infarction of the <b>anterior 2/3</b> of the cord. "
"Because the posterior funiculus is spared, the result is:", clin),
bp("Bilateral loss of motor function (paralysis) below the lesion"),
bp("Bilateral loss of pain and temperature sensation (spinothalamic)"),
bp("<b>PRESERVED</b> vibration sense and proprioception (posterior column intact)"),
bp("Bladder and bowel dysfunction"),
Paragraph("Causes: aortic surgery/dissection, thromboembolism, hypotension, iatrogenic. "
"Key feature: sparing of dorsal columns distinguishes it from complete cord infarction.", clin),
]))
story.append(sp())
story.append(PageBreak())
# ═══════════════════════════════════════════════════════════════════════════════
# SECTION 2: ASCENDING TRACTS
# ═══════════════════════════════════════════════════════════════════════════════
story.append(section_banner("SECTION 2: ASCENDING TRACTS (SENSORY PATHWAYS)", bg=TEAL))
story.append(sp(1))
story.append(Paragraph(
"Almost all sensory afferent input to the spinal cord enters via the <b>dorsal (posterior) nerve roots</b>. "
"The central process of the dorsal root ganglion (DRG) cell bifurcates in the posterior horn into "
"ascending and descending collaterals before synapsing. Ascending tracts carry sensory information "
"from the body to higher brain centers.", body))
story.append(sp())
story.append(subsection_banner("2.1 Anterolateral System (ALS) — Spinothalamic Tract (STT)", bg=TEAL))
story.append(sp())
story.append(Paragraph(B("Modalities conveyed:") + " Pain, temperature (hot/cold), crude/light touch, tickle, itch.", body))
story.append(Paragraph(B("Neurons:"), h4))
story.append(bp("<b>1st-order neuron:</b> Cell body in dorsal root ganglion (DRG). Peripheral process in spinal nerve; central process enters cord via dorsal root."))
story.append(bp("<b>2nd-order neuron:</b> Cell body in ipsilateral dorsal horn (laminae I, IV, V, VII). Axon crosses in the anterior white commissure (over 2–3 segments obliquely, not immediately) → ascends in contralateral anterolateral funiculus."))
story.append(bp("<b>3rd-order neuron:</b> Cell body in VPL (ventral posterolateral) nucleus of the thalamus → axons project via posterior limb of internal capsule → primary somatosensory cortex (SI), postcentral gyrus."))
story.append(Paragraph(B("Two sub-divisions:"), h4))
ast_data = [
[B("Sub-tract"), B("Fibers"), B("Modality"), B("Characteristic")],
["Lateral STT (Neospinothalamic)", "Aδ (sharp/well-localized)", "Sharp, localized pain; temperature", "Laminar: cervical fibers dorsomedial, sacral fibers ventrolateral; pain & temp fibers segregated (temp more dorsolateral)"],
["Ventral/Anterior STT", "A-beta, some C", "Crude touch, pressure", "Also carried partly by posterior column — bilateral damage needed to abolish completely"],
["Spinoreticulothalamic (Paleospinothalamic)", "C fibers (slow pain)", "Poorly localized, burning, aching pain; emotional/affective component", "Projects to brainstem reticular formation → intralaminar thalamic nuclei. Short axons with multiple synapses."],
]
story.append(tract_table(ast_data, header_bg=TEAL))
story.append(sp())
story.append(key_box("Somatotopy of Spinothalamic Tract", [
Paragraph("Fibers are somatotopically arranged in the lateral funiculus:", clin),
bp("Sacral segments: most lateral (ventrolateral)"),
bp("Lumbar segments: lateral"),
bp("Thoracic segments: intermediate"),
bp("Cervical segments: most medial (dorsomedial)"),
Paragraph("Clinical pearl: An <b>intramedullary tumour</b> expanding from within pushes outward, "
"affecting cervical fibers first (sacral-sparing). An <b>extramedullary compressive lesion</b> "
"affects sacral fibers first (sacral sparing would be absent — sacral sensation affected early).", clin),
]))
story.append(sp())
story.append(clinical_box("Cordotomy for Pain Relief", [
Paragraph("Surgical or percutaneous cordotomy severs the lateral STT in the anterolateral funiculus "
"at the appropriate level to relieve intractable cancer pain. Pain relief is contralateral "
"and 2–3 segments below the lesion level. Over time, pain often returns due to neuroplasticity "
"and the paleospinothalamic pathway.", clin),
]))
story.append(sp())
# 2.2
story.append(subsection_banner("2.2 Spinoreticular Tract", bg=TEAL))
story.append(sp())
story.append(Paragraph(
"Travels with the spinothalamic tract in the anterolateral funiculus. "
"Second-order axons project bilaterally to the brainstem <b>reticular formation</b> "
"(medullary and pontine). From there, relay to intralaminar thalamic nuclei and limbic system.", body))
story.append(bp("<b>Function:</b> Mediates the <b>arousal</b>, <b>emotional</b>, and <b>affective</b> components of pain (suffering, anxiety). Also involved in sleep-wake cycles and consciousness."))
story.append(sp())
# 2.3
story.append(subsection_banner("2.3 Spinomesencephalic (Spinotectal) Tract", bg=TEAL))
story.append(sp())
story.append(Paragraph(
"Axons ascend in the anterolateral funiculus to terminate in the <b>periaqueductal gray (PAG)</b> "
"and <b>superior colliculus</b> of the midbrain.", body))
story.append(bp("<b>PAG:</b> Key center for endogenous pain modulation — activates descending inhibitory pathways (raphespinal, noradrenergic). The basis of opioid analgesia."))
story.append(bp("<b>Superior Colliculus:</b> Coordinates visual reflexes with painful stimuli (e.g., orienting response)."))
story.append(sp())
# 2.4
story.append(subsection_banner("2.4 Posterior Column – Medial Lemniscal Pathway (PCML)", bg=GREEN))
story.append(sp())
story.append(Paragraph(
"The <b>most precise</b> sensory pathway — carries conscious, fine, discriminative sensations.", body))
story.append(Paragraph(
B("Modalities:") + " Discriminative (fine) touch, vibration, conscious proprioception "
"(joint position sense, kinesthesia), two-point discrimination, pressure touch, weight perception, "
"stereognosis, graphesthesia.", body))
story.append(Paragraph(B("Three-neuron chain:"), h4))
story.append(bp("<b>1st-order neuron:</b> DRG cell body. Large, heavily myelinated Aβ fibers (fast). Central process enters medial division of dorsal root and ascends <b>ipsilaterally</b> in the posterior funiculus WITHOUT synapsing in the cord."))
story.append(bp("<b>2nd-order neuron:</b> Cell bodies in dorsal column nuclei of the caudal medulla (nucleus gracilis / nucleus cuneatus). Axons decussate as <b>internal arcuate fibers</b> → cross to contralateral side → ascend as the <b>medial lemniscus</b> → terminate in VPL of thalamus."))
story.append(bp("<b>3rd-order neuron:</b> VPL thalamus → posterior limb of internal capsule → primary somatosensory cortex (areas 3,1,2), postcentral gyrus."))
story.append(Paragraph(B("Two sub-divisions of posterior funiculus:"), h4))
pf_data = [
[B("Fasciculus"), B("Also Called"), B("Carries Information From"), B("Terminates In")],
["Fasciculus Gracilis", "Column of Goll; Medial column", "Lower limb, lower trunk (sacral, lumbar, lower 6 thoracic — T7 down)", "Nucleus gracilis (medulla)"],
["Fasciculus Cuneatus", "Column of Burdach; Lateral column", "Upper limb, upper trunk, neck (upper 6 thoracic T1–T6 and all cervical)", "Nucleus cuneatus (medulla)"],
]
story.append(tract_table(pf_data, header_bg=GREEN))
story.append(sp())
story.append(key_box("Somatotopy of Posterior Funiculus", [
Paragraph("Fibers are added laterally as you ascend (like layers of an onion):", clin),
bp("Sacral fibers: most medial (next to midline)"),
bp("Lumbar → thoracic → cervical: progressively more lateral"),
Paragraph("Fasciculus gracilis occupies the medial portion at all levels; "
"fasciculus cuneatus appears from T6 upward.", clin),
]))
story.append(sp())
story.append(clinical_box("Subacute Combined Degeneration (SCD) of the Spinal Cord", [
Paragraph("Vitamin B12 (cobalamin) deficiency causes demyelination of the <b>posterior columns</b> "
"and <b>lateral corticospinal tracts</b>. Classic presentation:", clin),
bp("Loss of vibration sense and proprioception (posterior column involvement)"),
bp("Upper motor neuron signs — spasticity, hyperreflexia, positive Babinski (lateral corticospinal tract involvement)"),
bp("Peripheral neuropathy (from direct axonal damage)"),
bp("<b>Important:</b> Posterior column signs typically precede motor signs. ROMBERG'S sign is positive."),
Paragraph("Also seen in: nitrous oxide abuse (inactivates B12), copper deficiency, HIV myelopathy.", clin),
]))
story.append(sp())
story.append(clinical_box("Tabes Dorsalis (Neurosyphilis)", [
Paragraph("<i>Treponema pallidum</i> selectively damages the <b>dorsal roots and posterior columns</b>. Features:", clin),
bp("Lancinating ('lightning') pains — episodic severe pain in legs"),
bp("Sensory ataxia — positive Romberg, wide-based gait"),
bp("Loss of proprioception and vibration"),
bp("Absent deep tendon reflexes (DRG/afferent arc damage)"),
bp("Argyll Robertson pupils (accommodation preserved, light reflex lost)"),
bp("Charcot joints (neuropathic arthropathy) due to loss of proprioception"),
]))
story.append(sp())
story.append(PageBreak())
# 2.5
story.append(subsection_banner("2.5 Dorsal Spinocerebellar Tract (DSCT)", bg=GREEN))
story.append(sp())
story.append(Paragraph(
"Carries <b>unconscious proprioception</b> from the lower limb and lower half of the body "
"to the cerebellum (ipsilateral).", body))
story.append(bp("<b>1st-order neuron:</b> DRG cell → enters cord → synapse in Clarke's column (nucleus dorsalis, lamina VII), spinal levels C8–L3."))
story.append(bp("<b>2nd-order neuron:</b> Ascends <b>ipsilaterally</b> in the posterior part of the <b>lateral funiculus</b> → enters cerebellum via <b>inferior cerebellar peduncle (ICP)</b> → terminates in the ipsilateral vermis."))
story.append(Paragraph(B("Information carried:") + " Muscle spindle (Ia, II) afferents, Golgi tendon organ (Ib) afferents — providing the cerebellum with moment-to-moment data about muscle length, tension, and limb position.", body))
story.append(sp())
# 2.6
story.append(subsection_banner("2.6 Ventral Spinocerebellar Tract (VSCT)", bg=GREEN))
story.append(sp())
story.append(Paragraph(
"Also carries unconscious proprioception from lower limb but is more complex than DSCT.", body))
story.append(bp("<b>1st-order neuron:</b> DRG cell → synapse on border cells of lamina V–VII."))
story.append(bp("<b>2nd-order neuron:</b> Most fibers cross in the anterior white commissure → ascend in contralateral anterior lateral funiculus → reach the pons/midbrain → enter cerebellum via <b>superior cerebellar peduncle (SCP)</b> → re-cross (double decussation) → terminate in ipsilateral vermis."))
story.append(bp("Effectively, VSCT fibers cross twice, ending up ipsilateral to their origin."))
story.append(bp("Carries information from spinal interneuronal circuits (efference copy of motor commands) rather than direct receptor input."))
story.append(sp())
# 2.7
story.append(subsection_banner("2.7 Cuneocerebellar & Rostrocerebellar Tracts", bg=GREEN))
story.append(sp())
story.append(Paragraph(
"Analogous to DSCT and VSCT but for the <b>upper limb</b> and <b>rostral half of the body</b>:", body))
story.append(bp("<b>Cuneocerebellar Tract:</b> 1st-order DRG neuron → accessory cuneate nucleus in medulla → ICP → ipsilateral cerebellum. Equivalent to DSCT for upper limb."))
story.append(bp("<b>Rostrocerebellar Tract:</b> Equivalent to VSCT for upper limb, carrying interneuronal circuit data."))
story.append(sp())
# 2.8
story.append(subsection_banner("2.8 Spino-olivary Tract", bg=GREEN))
story.append(sp())
story.append(bp("Ascends in the anterior funiculus → inferior olivary nucleus in medulla → cerebellum via ICP."))
story.append(bp("Carries unconscious proprioceptive information from muscles and skin for cerebellar error correction."))
story.append(sp())
# 2.9
story.append(subsection_banner("2.9 Spinotectal Tract", bg=GREEN))
story.append(sp())
story.append(bp("Ascends in the anterolateral funiculus alongside the spinothalamic tract."))
story.append(bp("Terminates in the superior colliculus of the midbrain tectum."))
story.append(bp("Function: Integrates nociceptive signals with visual orienting behavior."))
story.append(sp())
story.append(PageBreak())
# ═══════════════════════════════════════════════════════════════════════════════
# SECTION 3: DESCENDING TRACTS
# ═══════════════════════════════════════════════════════════════════════════════
story.append(section_banner("SECTION 3: DESCENDING TRACTS (MOTOR PATHWAYS)", bg=ORANGE))
story.append(sp(1))
story.append(Paragraph(
"Descending tracts from the brain control voluntary and involuntary movements, "
"regulate muscle tone, and modulate spinal reflexes. They are divided into two major systems: "
"<b>Lateral pathways</b> (voluntary, distal muscle control) and <b>Ventromedial pathways</b> "
"(postural/axial muscle control, locomotion).", body))
story.append(Paragraph(
"All descending pathways ultimately influence the <b>lower motor neuron (LMN)</b> — the "
"alpha motor neuron in the ventral horn whose axon forms the final common pathway to skeletal muscle.", body))
story.append(sp())
# UMN vs LMN box
story.append(key_box("Upper Motor Neuron (UMN) vs Lower Motor Neuron (LMN)", [
Paragraph("Understanding the distinction is fundamental to neurological examination:", clin),
]))
umnlmn_data = [
[B("Feature"), B("UMN Lesion"), B("LMN Lesion")],
["Tone", "Spasticity (velocity-dependent increase)", "Flaccidity (hypotonia)"],
["Reflexes", "Hyperreflexia", "Hyporeflexia / areflexia"],
["Babinski sign", "Present (extensor plantar response)", "Absent"],
["Weakness pattern", "Pyramidal distribution (flexors upper / extensors lower limb)", "Segmental / myotomal"],
["Wasting/Atrophy", "Disuse atrophy (mild, late)", "Rapid, severe neurogenic atrophy"],
["Fasciculations", "Absent", "Present (denervation)"],
["Location of lesion", "Brain or spinal cord (above anterior horn)", "Anterior horn, nerve root, peripheral nerve, NMJ, muscle"],
]
story.append(tract_table(umnlmn_data, header_bg=ORANGE))
story.append(sp())
# 3.1
story.append(subsection_banner("3.1 Lateral Corticospinal Tract (LCST)", bg=ORANGE))
story.append(sp())
story.append(Paragraph(
"The most important and largest descending motor tract (~1 million fibers per pyramid). "
"Controls fine, skilled, voluntary movements — especially of the distal muscles (fingers).", body))
story.append(Paragraph(B("Origin:"), h4))
story.append(bp("~30% from primary motor cortex (M1) — Brodmann area 4, precentral gyrus"))
story.append(bp("~30% from premotor (lateral) and supplementary motor areas — Brodmann area 6"))
story.append(bp("~40% from somatosensory cortex — Brodmann areas 3,1,2 (postcentral gyrus) and areas 5,7 — these modulate sensory input to the cord"))
story.append(Paragraph(B("Course:"), h4))
story.append(bp("Corona radiata → posterior limb of internal capsule (knee/genu for face; anterior 2/3 for limbs) → crus cerebri (basis pedunculi) of midbrain → basis pontis (scattered bundles separated by pontocerebellar fibers) → pyramids of medulla oblongata"))
story.append(bp("<b>Pyramidal decussation:</b> ~85–90% of fibers cross at the junction of medulla and spinal cord (caudal medulla) → descend in the <b>dorsal part of the lateral funiculus</b> as the LCST"))
story.append(bp("Terminate mainly in laminae IV–VII and IX of all spinal cord levels (cervical, thoracic, lumbar, sacral)"))
story.append(Paragraph(B("Somatotopy in LCST:"), h4))
story.append(Paragraph("Cervical fibers are most medial; sacral fibers are most lateral in the lateral funiculus. "
"This somatotopy is maintained throughout the cord.", body))
story.append(sp())
story.append(clinical_box("Stroke (Internal Capsule / Cortical) — UMN Paralysis", [
Paragraph("A lesion in the posterior limb of the internal capsule (most common site for capsular stroke — "
"lenticulostriate artery occlusion) produces <b>contralateral hemiplegia/hemiparesis</b>. "
"Because the face, arm, and leg fibers are closely packed, all three are typically affected. "
"Features:", clin),
bp("Initial flaccidity (immediately post-stroke) → evolves to spasticity"),
bp("Hyperreflexia, clonus, positive Babinski sign"),
bp("UMN facial weakness (lower face only — upper face has bilateral cortical representation)"),
bp("Pyramidal weakness pattern: extensors of upper limb, flexors of lower limb — the classic hemiplegic posture"),
]))
story.append(sp())
# 3.2
story.append(subsection_banner("3.2 Ventral (Anterior) Corticospinal Tract (VCST)", bg=ORANGE))
story.append(sp())
story.append(bp("Comprises ~10–15% of corticospinal fibers that do NOT decussate at the pyramidal decussation."))
story.append(bp("Descend in the ipsilateral anterior funiculus (ventral white matter)."))
story.append(bp("Most fibers eventually cross at the level of termination via the anterior white commissure → synapse in lamina VIII and IX of the cervical and upper thoracic cord."))
story.append(bp("<b>Function:</b> Controls axial and proximal limb muscles (bilateral representation). Contributes to postural control."))
story.append(sp())
# 3.3
story.append(subsection_banner("3.3 Rubrospinal Tract", bg=ORANGE))
story.append(sp())
story.append(bp("<b>Origin:</b> Red nucleus (magnocellular part) in the tegmentum of the midbrain."))
story.append(bp("<b>Course:</b> Fibers decussate immediately in the ventral tegmental decussation (Forel's decussation) → descend in the lateral funiculus (just anterior to the LCST)."))
story.append(bp("<b>Termination:</b> Laminae V–VII of cervical and upper thoracic segments. Barely reaches lumbar segments in humans."))
story.append(bp("<b>Function:</b> Controls distal limb (especially arm/hand) voluntary movements. Acts in parallel with LCST. In humans, this tract is relatively rudimentary compared to other mammals."))
story.append(bp("<b>Input to red nucleus:</b> Ipsilateral cerebral cortex (areas 4, 6) and contralateral cerebellar deep nuclei (dentate nucleus via SCP). Therefore, cerebellar output reaches spinal cord via this pathway."))
story.append(sp())
# 3.4
story.append(subsection_banner("3.4 Lateral Reticulospinal Tract (Medullary RST)", bg=PURPLE))
story.append(sp())
story.append(bp("<b>Origin:</b> Medullary reticular formation (mainly ipsilateral nucleus reticularis gigantocellularis)."))
story.append(bp("<b>Location:</b> Lateral funiculus."))
story.append(bp("<b>Effect:</b> Predominantly <b>inhibitory</b> — inhibits alpha and gamma motor neurons of antigravity muscles; facilitates antagonists of antigravity muscles."))
story.append(bp("Receives input from the corticobulbar tract; part of the cortical indirect motor pathway."))
story.append(sp())
# 3.5
story.append(subsection_banner("3.5 Medial Reticulospinal Tract (Pontine RST)", bg=PURPLE))
story.append(sp())
story.append(bp("<b>Origin:</b> Pontine reticular formation (nucleus reticularis pontis oralis and caudalis)."))
story.append(bp("<b>Location:</b> Anterior funiculus (ventromedial white matter)."))
story.append(bp("<b>Effect:</b> Predominantly <b>facilitatory</b> — activates alpha and gamma motor neurons of <b>antigravity muscles</b> (extensors of lower limb, flexors of upper limb)."))
story.append(bp("Important for postural control, locomotion, and upright stance."))
story.append(bp("In decerebrate rigidity, this tract (unopposed by the inhibitory lateral RST) produces extensor hypertonicity."))
story.append(sp())
story.append(clinical_box("Decerebrate Rigidity", [
Paragraph("A lesion between the red nucleus and vestibular nuclei (e.g., severe midbrain compression) "
"disconnects the inhibitory cortical/rubral input from the facilitatory reticulospinal and "
"vestibulospinal tracts. The result is <b>decerebrate rigidity</b>:", clin),
bp("Extension and internal rotation of all 4 limbs"),
bp("Extension of neck (opisthotonos)"),
bp("Jaw clenching"),
Paragraph("<b>Decorticate rigidity</b> (lesion above red nucleus): flexion of upper limbs, extension of lower limbs — "
"because the rubrospinal tract, which flexes upper limbs, is intact.", clin),
]))
story.append(sp())
# 3.6
story.append(subsection_banner("3.6 Vestibulospinal Tracts", bg=PURPLE))
story.append(sp())
vst_data = [
[B("Tract"), B("Origin"), B("Course"), B("Function")],
["Lateral Vestibulospinal Tract (LVST)", "Lateral vestibular nucleus (Deiters' nucleus) — ipsilateral", "Ipsilateral anterior funiculus; full length of cord", "Strongly facilitates extensor (antigravity) motor neurons; receives direct input from cerebellum (vermis/flocculonodular lobe); mediates postural adjustments to gravity"],
["Medial Vestibulospinal Tract (MVST)", "Medial vestibular nucleus — bilateral", "Medial longitudinal fasciculus (MLF); only to cervical cord", "Coordinates head/neck position with eye movements; mediates vestibulocolic reflex"],
]
story.append(tract_table(vst_data, header_bg=PURPLE))
story.append(sp())
# 3.7
story.append(subsection_banner("3.7 Tectospinal Tract", bg=PURPLE))
story.append(sp())
story.append(bp("<b>Origin:</b> Superior colliculus of the midbrain tectum (contralateral — crosses in the dorsal tegmental decussation / fountain decussation of Meynert)."))
story.append(bp("<b>Course:</b> MLF → anterior funiculus, mainly cervical cord (C1–C4)."))
story.append(bp("<b>Function:</b> Coordinates reflexive head and neck movements in response to visual and auditory stimuli (orienting reflex). Turns head toward a sudden sound or flash of light."))
story.append(sp())
# 3.8
story.append(subsection_banner("3.8 Raphespinal Tract (Descending Serotonergic Pathway)", bg=PURPLE))
story.append(sp())
story.append(bp("<b>Origin:</b> Nucleus raphe magnus (and other raphe nuclei) of the medullary brainstem."))
story.append(bp("<b>Course:</b> Dorsolateral funiculus."))
story.append(bp("<b>Function:</b> <b>Pain modulation</b> — serotonergic fibers inhibit pain transmission in the dorsal horn (laminae I and II). This is the main output of the PAG-activated descending pain inhibitory pathway. Mediates the effects of endogenous opioids and stress-induced analgesia."))
story.append(bp("Noradrenergic fibers from the locus coeruleus (via the dorsolateral funiculus) also contribute to descending pain inhibition."))
story.append(sp())
story.append(PageBreak())
# ═══════════════════════════════════════════════════════════════════════════════
# SECTION 4: INTERSEGMENTAL TRACTS
# ═══════════════════════════════════════════════════════════════════════════════
story.append(section_banner("SECTION 4: INTERSEGMENTAL TRACTS (PROPRIOSPINAL SYSTEM)", bg=PURPLE))
story.append(sp(1))
story.append(Paragraph(
"Intersegmental tracts (also called <b>propriospinal tracts</b>) connect different segments of "
"the spinal cord with each other. They are distinct from the long ascending/descending tracts "
"in that they do not directly communicate with the brain. They form a critical network for "
"coordinating motor activity across multiple spinal levels.", body))
story.append(sp())
story.append(subsection_banner("4.1 Fasciculus Proprius (Propriospinal Tract)", bg=PURPLE))
story.append(sp())
story.append(Paragraph(
"The fasciculus proprius is a thin sleeve of white matter that <b>immediately surrounds the gray "
"matter</b> on all sides (anterior, lateral, posterior) throughout the entire length of the cord.", body))
story.append(Paragraph(B("Composition:"), h4))
story.append(bp("Short propriospinal fibers: travel only 1–2 segments up or down (short propriospinal neurons)."))
story.append(bp("Long propriospinal fibers: travel 10+ segments (long propriospinal neurons connecting cervical and lumbar enlargements)."))
story.append(bp("Both ascending and descending fibers are present in this zone — it runs in BOTH directions."))
story.append(Paragraph(B("Cell bodies:"), h4))
story.append(bp("Located in laminae V–VIII (intermediate zone) of the gray matter."))
story.append(bp("Particularly dense in laminae VII and VIII."))
story.append(Paragraph(B("Functions:"), h4))
story.append(bp("<b>Interlimb coordination:</b> Synchronize movements between upper and lower extremities (e.g., arm-leg coordination in walking — the cervicothoracic propriospinal tract connects C and L enlargements)."))
story.append(bp("<b>Reflex integration:</b> Mediate intersegmental reflexes (e.g., crossed extensor reflex requires propriospinal neurons to link flexor and extensor motor neurons across multiple segments)."))
story.append(bp("<b>Posture:</b> Modulate axial and proximal muscle tone across segments."))
story.append(bp("<b>Relay for corticospinal input:</b> Many corticospinal axons synapse on propriospinal neurons (in laminae V–VIII) rather than directly on motor neurons — the propriospinal neurons then distribute the command to multiple motor neuron pools."))
story.append(sp())
story.append(subsection_banner("4.2 Lissauer's Tract (Posterolateral Tract / Dorsolateral Fasciculus)", bg=PURPLE))
story.append(sp())
story.append(Paragraph(
"Located at the tip of the posterior horn, between the posterolateral sulcus and the gelatinous tip "
"of the dorsal horn. Though technically a dorsal root entry zone rather than a pure propriospinal tract, "
"it has both ascending and descending components.", body))
story.append(bp("Contains lightly myelinated Aδ and unmyelinated C fibers from the lateral division of the dorsal root."))
story.append(bp("Fibers bifurcate and <b>travel 1–2 segments up and down</b> before entering the dorsal horn gray."))
story.append(bp("This is why a unilateral dermatome injury can produce pain referral to adjacent dermatomes."))
story.append(bp("The 2–3 segment oblique crossing of pain fibers before joining the STT is due to their initial travel in Lissauer's tract."))
story.append(bp("<b>Clinical relevance:</b> Syringomyelia destroys the crossing fibers in this region and the anterior commissure → bilateral loss of pain/temperature in a 'cape' (shawl) distribution, with preserved posterior column function — dissociated sensory loss."))
story.append(sp())
story.append(subsection_banner("4.3 Anterior Commissural Fibers", bg=PURPLE))
story.append(sp())
story.append(bp("Cross in the anterior white commissure, connecting left and right gray matter."))
story.append(bp("Include the decussating axons of the spinothalamic tract (2nd-order neurons crossing here)."))
story.append(bp("Propriospinal commissural neurons coordinate bilateral motor activity."))
story.append(sp())
story.append(subsection_banner("4.4 Functions of Intersegmental Tracts — Summary", bg=PURPLE))
story.append(sp())
inter_data = [
[B("Function"), B("Mechanism")],
["Interlimb coordination (walking, crawling)", "Long propriospinal neurons connect C and L enlargements; synchronize arm-leg swing"],
["Crossed extensor reflex", "Short propriospinal neurons relay crossed inhibitory/excitatory signals over 2–4 segments"],
["Relay for supraspinal commands", "Corticospinal → propriospinal → alpha motor neuron (indirect route, especially in primates)"],
["Pattern generation", "Propriospinal neurons are integral to spinal central pattern generators (CPGs) for rhythmic locomotion"],
["Sensory integration", "Lissauer's tract allows afferent signals to spread over multiple segments before synapsing"],
["Autonomic coordination", "Propriospinal neurons in thoracic segments coordinate sympathetic output across levels"],
]
story.append(tract_table(inter_data, header_bg=PURPLE))
story.append(sp())
story.append(clinical_box("Propriospinal Myoclonus", [
Paragraph("A movement disorder characterized by brief, rhythmic contractions propagating from the "
"abdominal/thoracic segments rostrally and caudally — the spread pattern matches the velocity "
"and distribution of propriospinal tract connections. Associated with structural cord lesions, "
"but a 'functional' (psychogenic) form also exists.", clin),
]))
story.append(sp())
story.append(PageBreak())
# ═══════════════════════════════════════════════════════════════════════════════
# SECTION 5: CLINICAL SYNDROMES
# ═══════════════════════════════════════════════════════════════════════════════
story.append(section_banner("SECTION 5: CLINICAL SYNDROMES OF SPINAL CORD DISEASE", bg=RED))
story.append(sp(1))
# 5.1
story.append(subsection_banner("5.1 Complete Cord Transection & Spinal Shock", bg=RED))
story.append(sp())
story.append(Paragraph(B("Spinal Shock:"), h4))
story.append(Paragraph(
"When the spinal cord is suddenly and severely injured (complete transection), three immediate effects occur:", body))
story.append(bp("(1) Complete loss of voluntary movement below the lesion — tetraplegia (C4–C5 or above) or paraplegia (thoracic cord)."))
story.append(bp("(2) Complete loss of all sensation below the lesion level."))
story.append(bp("(3) Flaccid paralysis with areflexia — 'spinal shock' — lasting 1–6 weeks."))
story.append(Paragraph(B("Spinal shock features in detail:"), h4))
story.append(bp("Atonic bladder and bowel (urinary retention, paralytic ileus)"))
story.append(bp("Loss of vasomotor tone → neurogenic shock (hypotension, bradycardia)"))
story.append(bp("Loss of sweating and piloerection below lesion"))
story.append(bp("Loss of penile erection and ejaculation"))
story.append(bp("Bulbocavernosus reflex is the FIRST to return — marker of end of spinal shock"))
story.append(Paragraph(B("Recovery phase (after spinal shock):"), h4))
story.append(bp("Return of deep tendon reflexes → evolving to hyperreflexia"))
story.append(bp("Spasticity (clasp-knife rigidity) replaces flaccidity"))
story.append(bp("Babinski sign becomes positive"))
story.append(bp("Mass reflex (flexor spasms, autonomic discharge with a single stimulus)"))
story.append(bp("Autonomic dysreflexia (above T6): hypertensive crisis triggered by a noxious stimulus below the lesion (full bladder, pressure sore)"))
story.append(sp())
# 5.2
story.append(subsection_banner("5.2 Brown-Séquard Syndrome (Cord Hemisection)", bg=RED))
story.append(sp())
story.append(Paragraph(
"Hemisection of one side of the spinal cord produces a characteristic pattern of deficits "
"that directly reflects the anatomy of the cord tracts:", body))
bss_data = [
[B("Finding"), B("Side"), B("Tract Involved"), B("Why")],
["Ipsilateral UMN paralysis below lesion", "Same side as lesion", "Lateral corticospinal tract", "Crosses at medullary pyramidal decussation — so lesion below this = ipsilateral paralysis"],
["Ipsilateral loss of fine touch, vibration, proprioception", "Same side as lesion", "Posterior column (fasciculus gracilis/cuneatus)", "Ascends ipsilaterally; crosses only at medulla"],
["Contralateral loss of pain & temperature (1–2 segments below)", "Opposite side", "Lateral spinothalamic tract", "Crosses in anterior commissure over 1–3 segments before ascending contralaterally"],
["Ipsilateral flaccid weakness AT the level of lesion", "Same side", "Anterior horn cells (LMN)", "Direct LMN destruction at the lesion level"],
["Ipsilateral loss of all sensation AT the level", "Same side", "Entering nerve root / dorsal horn", "Root/entry zone involvement"],
]
story.append(tract_table(bss_data, header_bg=RED))
story.append(sp())
story.append(Paragraph(
B("Causes:") + " Penetrating trauma (knife/bullet — most common), multiple sclerosis plaque, "
"epidural abscess/hematoma, disc herniation (lateral), cervical spondylosis, intramedullary tumor, "
"radiation myelitis, arteriovenous malformation.", body))
story.append(sp())
# 5.3
story.append(subsection_banner("5.3 Anterior Cord Syndrome", bg=RED))
story.append(sp())
story.append(Paragraph(
"Caused by infarction/injury of the anterior 2/3 of the cord, sparing the posterior columns:", body))
story.append(bp("Bilateral motor paralysis (LCST and ventral horn destruction)"))
story.append(bp("Bilateral loss of pain and temperature (spinothalamic tract)"))
story.append(bp("<b>PRESERVED:</b> vibration, proprioception, fine touch (posterior columns intact)"))
story.append(bp("Bladder/bowel dysfunction"))
story.append(Paragraph(B("Causes:") + " Anterior spinal artery occlusion (most common), anterior cord compression (burst fracture), aortic dissection/surgery.", body))
story.append(sp())
# 5.4
story.append(subsection_banner("5.4 Central Cord Syndrome", bg=RED))
story.append(sp())
story.append(Paragraph(
"Most common incomplete SCI. Results from injury to the central cord (particularly the cervical region). "
"Due to the somatotopic arrangement of the LCST (cervical fibers are most central/medial):", body))
story.append(bp("Disproportionate weakness: <b>Upper limbs > lower limbs</b>"))
story.append(bp("Sacral sensory sparing (sacral fibers are most peripheral in STT — last to be affected)"))
story.append(bp("Bladder dysfunction (urinary retention)"))
story.append(bp("Dissociated sensory loss at the lesion level (cape/shawl distribution) if syringomyelia"))
story.append(Paragraph(B("Causes:") + " Hyperextension injury in elderly patients with pre-existing cervical stenosis (falls), syringomyelia, intramedullary tumors.", body))
story.append(sp())
story.append(clinical_box("Syringomyelia", [
Paragraph("A fluid-filled cavity (syrinx) develops within the spinal cord, most commonly in the cervical "
"region. The expanding cavity first destroys the <b>anterior white commissure</b> (crossing "
"spinothalamic fibers) and then the <b>ventral horn</b>. Classic features:", clin),
bp("Bilateral dissociated sensory loss (pain/temperature lost; touch/proprioception preserved) in a cape distribution (shawl/vest across shoulders and arms)"),
bp("Lower motor neuron signs at the level of the syrinx (wasting and weakness of intrinsic hand muscles, areflexia)"),
bp("Upper motor neuron signs below the syrinx (spasticity, hyperreflexia)"),
bp("Autonomic dysfunction: Horner syndrome (if cervical) — ptosis, miosis, anhidrosis"),
Paragraph("Often associated with Chiari malformation type I, post-traumatic changes, tumors. "
"Diagnosed by MRI. Treatment: decompression / shunting.", clin),
]))
story.append(sp())
# 5.5
story.append(subsection_banner("5.5 Posterior Cord Syndrome", bg=RED))
story.append(sp())
story.append(bp("Rare. Selective damage to the posterior funiculus."))
story.append(bp("Bilateral loss of vibration, proprioception, fine touch, two-point discrimination below the lesion"))
story.append(bp("Motor function and pain/temperature PRESERVED"))
story.append(bp("Sensory ataxia, positive Romberg sign, 'wading in mud' gait"))
story.append(Paragraph(B("Causes:") + " Vitamin B12 deficiency (SCD), neurosyphilis (tabes dorsalis), Friedreich's ataxia, HTLV-1 myelopathy, posterior spinal artery occlusion.", body))
story.append(sp())
# 5.6
story.append(subsection_banner("5.6 Conus Medullaris Syndrome", bg=RED))
story.append(sp())
story.append(Paragraph(
"Injury to the conus medullaris (S3–S5 segments, ~L1 vertebral level) produces a mixed LMN/UMN picture:", body))
story.append(bp("Bladder and bowel: areflexic (atonic) — loss of S2–S4 parasympathetic control of detrusor"))
story.append(bp("Sexual dysfunction — loss of erection and ejaculation"))
story.append(bp("Saddle anesthesia (S3–S5 dermatomes: perianal, perineal, inner thigh)"))
story.append(bp("Absent bulbocavernosus and anal reflexes (sacral arc destroyed)"))
story.append(bp("Relatively preserved lower limb strength (as L1–L2 are usually spared if injury is at conus)"))
story.append(Paragraph(B("Causes:") + " Disc herniation at L1–L2, fractures, tumors.", body))
story.append(sp())
# 5.7
story.append(subsection_banner("5.7 Cauda Equina Syndrome", bg=RED))
story.append(sp())
story.append(Paragraph(
"Injury to the nerve roots below L1 (where the spinal cord ends) — these are "
"<b>peripheral nerves</b>, not the cord itself. Pure LMN syndrome:", body))
story.append(bp("Saddle anesthesia"))
story.append(bp("Flaccid paralysis of lower limbs (variable distribution depending on level)"))
story.append(bp("Areflexia — absent knee and ankle jerks"))
story.append(bp("Bladder/bowel: areflexic (overflow incontinence, urinary retention)"))
story.append(bp("Severe radicular (root) pain — often asymmetric (vs. conus which is symmetric)"))
story.append(bp("Sexual dysfunction"))
story.append(Paragraph(B("Causes:") + " Central disc herniation (L4–L5, L5–S1), epidural abscess/hematoma, metastatic tumor, "
"fracture. Surgical emergency — decompress within 48 hours for best bladder recovery.", body))
story.append(sp())
# 5.8
story.append(subsection_banner("5.8 Differentiating Cord Syndromes — Summary Table", bg=RED))
story.append(sp())
diff_data = [
[B("Syndrome"), B("Motor"), B("Pain/Temp"), B("Vibration/Propri."), B("Special Features")],
["Complete Transection", "Bilateral paralysis", "Bilateral loss", "Bilateral loss", "Spinal shock initially; autonomic dysreflexia"],
["Brown-Séquard", "Ipsilateral UMN", "Contralateral loss (1-2 seg below)", "Ipsilateral loss", "Asymmetric; ipsilateral LMN AT level"],
["Anterior Cord", "Bilateral paralysis", "Bilateral loss", "PRESERVED", "Anterior spinal artery territory"],
["Central Cord", "Arms > Legs weakness", "Variable (central cape loss)", "Often preserved", "Bladder dysfunction; sacral sparing"],
["Posterior Cord", "PRESERVED", "PRESERVED", "Bilateral loss", "Sensory ataxia, Romberg +ve"],
["Conus Medullaris", "Minimal leg weakness", "Saddle anesthesia", "Saddle loss", "Areflexic bladder/bowel, mixed UMN/LMN"],
["Cauda Equina", "LMN leg weakness", "Saddle anesthesia (asymmetric)", "Variable", "Areflexic, radicular pain, EMERGENCY"],
["Syringomyelia", "LMN at level, UMN below", "Cape (bilateral) loss", "PRESERVED at level", "Horner if cervical, wasting of hands"],
]
story.append(tract_table(diff_data, header_bg=RED))
story.append(sp())
story.append(PageBreak())
# ═══════════════════════════════════════════════════════════════════════════════
# SECTION 6: MASTER SUMMARY TABLE
# ═══════════════════════════════════════════════════════════════════════════════
story.append(section_banner("SECTION 6: MASTER SUMMARY TABLE OF ALL SPINAL CORD TRACTS", bg=DARK_NAVY))
story.append(sp(1))
master_data = [
[B("Tract"), B("Type"), B("Origin"), B("Funiculus"), B("Decussation"), B("Terminates"), B("Modality / Function")],
# ASCENDING
["Lat. Spinothalamic", "Ascending", "DRG → dorsal horn (I,V)", "Lat./Ant.", "Ant. commissure (2-3 seg)", "VPL thalamus → S1 cortex", "Sharp pain, temperature"],
["Ant. Spinothalamic", "Ascending", "DRG → dorsal horn (VI,VII)", "Anterior", "Ant. commissure", "VPL thalamus", "Crude touch"],
["Spinoreticular", "Ascending", "Dorsal horn", "Anterolateral", "Bilateral", "Reticular formation → Intralaminar thalamus", "Affective pain, arousal"],
["Spinomesencephalic", "Ascending", "Dorsal horn", "Anterolateral", "Bilateral", "PAG, superior colliculus", "Pain modulation, orienting"],
["Fasc. Gracilis", "Ascending", "DRG (T7–S5)", "Posterior (medial)", "None in cord (medulla)", "Nucleus gracilis", "Fine touch, vibration, proprioception (lower body)"],
["Fasc. Cuneatus", "Ascending", "DRG (C1–T6)", "Posterior (lateral)", "None in cord (medulla)", "Nucleus cuneatus", "Fine touch, vibration, proprioception (upper body)"],
["DSCT", "Ascending", "Clarke's col. (C8–L3) → Lamina VII", "Posterior Lat.", "None (ipsilateral)", "Cerebellum (ICP)", "Unconscious proprioception (lower limb)"],
["VSCT", "Ascending", "Laminae V–VII", "Anterior Lat.", "Ant. commissure (recrosses at cerebellum)", "Cerebellum (SCP)", "Unconscious proprioception (interneuronal)"],
["Cuneocerebellar", "Ascending", "Accessory cuneate n.", "—", "None", "Cerebellum (ICP)", "Unconscious proprioception (upper limb)"],
# DESCENDING
["Lat. Corticospinal", "Descending", "Motor/sensory cortex (areas 4,6,3,1,2)", "Lateral", "Pyramidal decussation (85-90%)", "Laminae IV–IX (all levels)", "Fine voluntary movement (distal limbs)"],
["Ant. Corticospinal", "Descending", "Motor cortex", "Anterior", "Ant. commissure (at termination)", "Laminae VIII–IX (cervical/upper thoracic)", "Axial/proximal muscles"],
["Rubrospinal", "Descending", "Red nucleus (midbrain)", "Lateral", "Ventral tegmental decussation", "Laminae V–VII (cervical)", "Distal arm movement (minor in humans)"],
["Lat. Reticulospinal", "Descending", "Medullary RF", "Lateral", "Ipsilateral", "All levels", "Inhibit antigravity muscles"],
["Med. Reticulospinal", "Descending", "Pontine RF", "Anterior", "Bilateral", "All levels", "Facilitate antigravity muscles, posture"],
["Lat. Vestibulospinal", "Descending", "Deiters' nucleus", "Anterior", "Ipsilateral", "All levels", "Facilitate extensors (gravity response)"],
["Med. Vestibulospinal", "Descending", "Medial vest. nucleus", "MLF → Ant.", "Bilateral", "Cervical only", "Head/neck coordination with eye movements"],
["Tectospinal", "Descending", "Superior colliculus", "Anterior", "Dorsal tegmental decussation", "Cervical (C1–C4)", "Reflexive head orientation to stimuli"],
["Raphespinal", "Descending", "Nucleus raphe magnus", "Dorsolateral", "Ipsilateral", "Dorsal horn (I, II)", "Descending pain inhibition (serotonergic)"],
# INTERSEGMENTAL
["Fasc. Proprius", "Intersegmental", "Laminae V–VIII", "Surrounds gray matter (all funiculi)", "Ipsi & bilateral", "Adjacent spinal segments", "Interlimb coordination, reflex integration"],
["Lissauer's Tract", "Intersegmental/ entry zone", "DRG (Aδ, C fibers)", "Posterolateral tip", "—", "Dorsal horn (1–2 segments)", "Pain fiber distribution, entry zone"],
]
story.append(tract_table(master_data, header_bg=DARK_NAVY))
story.append(sp(2))
# Final note
story.append(hr(ROYAL_BLUE, 1))
story.append(sp())
story.append(Paragraph(
"This document has been compiled from Gray's Anatomy for Students, Localization in Clinical Neurology 8e, "
"Guyton & Hall Textbook of Medical Physiology, Adams & Victor's Principles of Neurology 12e, "
"Neuroscience: Exploring the Brain 5e, and Medical Physiology (Boron & Boulpaep). "
"For clinical decisions, always consult current guidelines and authoritative sources.",
make_style("Footer", fontSize=8, textColor=GRAY_MED, alignment=TA_CENTER, leading=11)))
# ─── Build ───────────────────────────────────────────────────────────────────
doc.build(story)
print(f"PDF created: {OUTPUT}")
cd /home/daytona/workspace/spinal-cord-pdf && python create_pdf.py 2>&1
ls -lh /home/daytona/workspace/spinal-cord-pdf/
Spinal Cord Complete Guide
PDF Document · PDF
| Feature | Location |
|---|---|
| Anterior Median Fissure | Deep midline anterior groove; anterior spinal artery nearby |
| Posterior Median Sulcus | Midline posterior; separates two posterior columns |
| Posterior Intermediate Sulcus | Cervical/upper thoracic; separates gracilis from cuneatus |
| Posterolateral Sulcus | Dorsal root entry zone |
| Anterolateral Sulcus | Ventral root exit zone |
| Syndrome | Motor | Pain/Temp | Vibration/Propri. | Key Feature |
|---|---|---|---|---|
| Complete Transection | Bilateral paralysis | Bilateral loss | Bilateral loss | Spinal shock; autonomic dysreflexia |
| Brown-Séquard | Ipsilateral UMN | Contralateral loss | Ipsilateral loss | Dissociated, asymmetric |
| Anterior Cord | Bilateral paralysis | Bilateral loss | PRESERVED | ASA territory |
| Central Cord | Arms > Legs | Cape pattern | Often preserved | Elderly + hyperextension |
| Posterior Cord | Preserved | Preserved | Bilateral loss | B12 deficiency, tabes |
| Conus Medullaris | Minimal | Saddle anesthesia | Saddle loss | Areflexic bladder/bowel |
| Cauda Equina | LMN paralysis | Saddle anesthesia | Variable | SURGICAL EMERGENCY |
| Syringomyelia | LMN at level, UMN below | Cape bilateral | Preserved | Horner if cervical |
https://orris.care/shared/chat/3b811bf5-5543-4272-984a-811bd42429f0
https://orris.care/shared/chat/3b811bf5-5543-4272-984a-811bd…