Cerebral circulation and factors which govern the blood supply of brain in conscious and anaesthetised patients.
| Parameter | Value |
|---|---|
| Total CBF (adult) | 750 mL/min (~50 mL/100 g/min) |
| Gray matter CBF | ~80 mL/100 g/min |
| White matter CBF | ~20 mL/100 g/min |
| % of cardiac output | 12–15% |
| CMRO₂ | ~3.5 mL O₂/100 g/min |
| % of total body O₂ consumption | ~20% |
| EEG slowing threshold | <20–25 mL/100 g/min |
| Isoelectric EEG | <20 mL/100 g/min |
| Irreversible ischaemia | <10 mL/100 g/min |



CBF = f(CMRO₂, direct vascular effects, autoregulatory status)
| Agent | CBF | CMRO₂ | Autoregulation | ICP |
|---|---|---|---|---|
| Propofol | ↓↓ | ↓↓ | Preserved | ↓ |
| Barbiturates (thiopental) | ↓↓ | ↓↓ | Preserved | ↓↓ |
| Etomidate | ↓ | ↓ | Preserved | ↓ |
| Ketamine | ↑↑ | ↑ | Impaired | ↑↑ |
| Benzodiazepines | ↓ | ↓ | Preserved | ↓ |
| Dexmedetomidine | ↓ modest | ↓ modest | Preserved | ↓ |
| N₂O | ↑ | ↑ | Variable | ↑ |
| Feature | Conscious | Anaesthetised |
|---|---|---|
| CBF | 50 mL/100g/min | Variable (drug-dependent) |
| CMRO₂ | 3.5 mL O₂/100g/min | Reduced (except ketamine/N₂O) |
| Flow–metabolism coupling | Intact | May be uncoupled by volatile agents |
| Autoregulation | Intact (MAP 65–150) | Impaired by volatiles (dose-dependent); preserved with IVA |
| CO₂ reactivity | Robust | Partially preserved (all agents) |
| Regional flow variation | High (task-dependent) | Blunted |
| ICP | Normal | ↑ with volatiles; ↓ with IVA |
Add just a diagram of the anatomy as well and make a pdf
ls /home/daytona/workspace/ 2>/dev/null || mkdir -p /home/daytona/workspace/cerebral-circulation
mkdir -p /home/daytona/workspace/cerebral-circulation && cd /home/daytona/workspace/cerebral-circulation && python3 -c " import urllib.request imgs = { 'anatomy_diagram.png': 'https://cdn.orris.care/cdss_images/0f1d81f00b9d6b40254223b9fc03e1cd650881c74958d14384a78f7e2d1c015d.png', 'autoregulation.png': 'https://cdn.orris.care/cdss_images/ae26a2d0194300de5e94ce0a9ae86b57d8508b0a43ba3ebb0a92a617025e0892.png', 'factors_cbf.png': 'https://cdn.orris.care/cdss_images/6594eafafac6b631be72abe5a14c6e0b82af22c072fef00a1ea259881c51a1a5.png', 'integrated_regulation.png': 'https://cdn.orris.care/cdss_images/7629cd61007d1b2842ba3d047f4bb9c165a7828a7828cabdffcb5cec74d9ba18.png', } for fn, url in imgs.items(): urllib.request.urlretrieve(url, fn) print(f'Downloaded {fn}') "
~/cerebral-circulation/build_pdf.py
from reportlab.lib.pagesizes import A4
from reportlab.lib.units import cm
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.colors import HexColor, white, black
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, Image, Table, TableStyle,
HRFlowable, PageBreak, KeepTogether
)
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
from reportlab.lib import colors
import os
OUTPUT = "/home/daytona/workspace/cerebral-circulation/Cerebral_Circulation.pdf"
IMG_DIR = "/home/daytona/workspace/cerebral-circulation"
# ── Colour palette ──────────────────────────────────────────────────────────
NAVY = HexColor("#1a3a5c")
BLUE = HexColor("#2563a8")
LBLUE = HexColor("#dbeafe")
TEAL = HexColor("#0e7490")
LTEAL = HexColor("#ccfbf1")
GREY = HexColor("#f1f5f9")
DKGREY = HexColor("#475569")
RED = HexColor("#dc2626")
AMBER = HexColor("#d97706")
GREEN = HexColor("#16a34a")
doc = SimpleDocTemplate(
OUTPUT, pagesize=A4,
leftMargin=2*cm, rightMargin=2*cm,
topMargin=2.5*cm, bottomMargin=2.5*cm,
title="Cerebral Circulation",
author="Orris Medical"
)
W = A4[0] - 4*cm # usable width
styles = getSampleStyleSheet()
# Custom styles
def S(name, **kw):
base = kw.pop("parent", "Normal")
return ParagraphStyle(name, parent=styles[base], **kw)
title_s = S("DocTitle", fontSize=22, textColor=white, leading=28, alignment=TA_CENTER, fontName="Helvetica-Bold")
sub_s = S("DocSub", fontSize=12, textColor=LBLUE, leading=16, alignment=TA_CENTER, fontName="Helvetica")
h1_s = S("H1", fontSize=14, textColor=white, leading=18, fontName="Helvetica-Bold", spaceAfter=2)
h2_s = S("H2", fontSize=12, textColor=NAVY, leading=16, fontName="Helvetica-Bold", spaceBefore=10, spaceAfter=4)
h3_s = S("H3", fontSize=10, textColor=TEAL, leading=14, fontName="Helvetica-Bold", spaceBefore=6, spaceAfter=2)
body_s = S("Body", fontSize=9.5, leading=14, alignment=TA_JUSTIFY, textColor=HexColor("#1e293b"), spaceAfter=4)
bullet_s = S("Bullet", fontSize=9.5, leading=14, leftIndent=14, bulletIndent=0, textColor=HexColor("#1e293b"), spaceAfter=2)
caption_s = S("Caption", fontSize=8, leading=11, alignment=TA_CENTER, textColor=DKGREY, fontName="Helvetica-Oblique", spaceAfter=8)
source_s = S("Source", fontSize=7.5, leading=10, textColor=DKGREY, fontName="Helvetica-Oblique", spaceBefore=16)
table_hdr = S("TblHdr", fontSize=8.5, leading=12, fontName="Helvetica-Bold", textColor=white, alignment=TA_CENTER)
table_cel = S("TblCel", fontSize=8.5, leading=12, textColor=HexColor("#1e293b"), alignment=TA_CENTER)
table_lft = S("TblLft", fontSize=8.5, leading=12, textColor=HexColor("#1e293b"), alignment=TA_LEFT)
def section_header(text, level=1):
"""Returns a coloured section header block."""
if level == 1:
bg = NAVY
st = h1_s
pad = 6
else:
bg = TEAL
st = ParagraphStyle("H2B", parent=h2_s, textColor=white, spaceAfter=2, spaceBefore=8)
pad = 4
tbl = Table([[Paragraph(text, st)]], colWidths=[W])
tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), bg),
("TOPPADDING", (0,0), (-1,-1), pad),
("BOTTOMPADDING", (0,0), (-1,-1), pad),
("LEFTPADDING", (0,0), (-1,-1), 8),
("RIGHTPADDING", (0,0), (-1,-1), 8),
("ROUNDEDCORNERS", [4]),
]))
return tbl
def img(filename, width=None, caption=None):
path = os.path.join(IMG_DIR, filename)
if width is None:
width = W
items = [Image(path, width=width, height=width*0.65, kind='proportional')]
if caption:
items.append(Paragraph(caption, caption_s))
return items
def bullet(text):
return Paragraph(f"<bullet>•</bullet> {text}", bullet_s)
def subbullet(text):
st = S("SB", parent=bullet_s, leftIndent=28)
return Paragraph(f"<bullet>–</bullet> {text}", st)
def hr():
return HRFlowable(width="100%", thickness=0.5, color=HexColor("#cbd5e1"), spaceAfter=4, spaceBefore=4)
# ── Build story ──────────────────────────────────────────────────────────────
story = []
# ── COVER PAGE ───────────────────────────────────────────────────────────────
cover = Table(
[[Paragraph("CEREBRAL CIRCULATION", title_s)],
[Spacer(1, 0.3*cm)],
[Paragraph("Anatomy · Physiology · Regulatory Factors<br/>Conscious & Anaesthetised Patients", sub_s)],
[Spacer(1, 0.5*cm)],
[Paragraph("Based on Miller's Anesthesia 10e · Ganong's Physiology 26e<br/>Morgan & Mikhail 7e · Barash Clinical Anesthesia 9e", sub_s)]],
colWidths=[W]
)
cover.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), NAVY),
("TOPPADDING", (0,0), (-1,-1), 20),
("BOTTOMPADDING", (0,0), (-1,-1), 20),
("LEFTPADDING", (0,0), (-1,-1), 16),
("RIGHTPADDING", (0,0), (-1,-1), 16),
("ROUNDEDCORNERS", [6]),
]))
story += [cover, Spacer(1, 0.6*cm)]
# ── SECTION 1: ANATOMY ───────────────────────────────────────────────────────
story += [section_header("1. ANATOMY OF THE CEREBRAL CIRCULATION"), Spacer(1, 0.3*cm)]
story += [Paragraph("<b>Arterial Supply</b>", h2_s)]
story += [Paragraph(
"The brain receives its blood from <b>four arteries</b>: the two internal carotid arteries (ICA, anterior circulation) "
"and the two vertebral arteries (posterior circulation). The vertebral arteries unite to form the <b>basilar artery</b>. "
"The ICAs and basilar artery connect below the hypothalamus to form the <b>circle of Willis</b> — a vascular loop "
"permitting collateral flow between anterior/posterior and right/left systems.", body_s)]
story += [Paragraph("<b>Branches from the Circle of Willis:</b>", h3_s)]
for t in [
"<b>Anterior cerebral artery (ACA)</b> — medial frontal and parietal lobes",
"<b>Middle cerebral artery (MCA)</b> — lateral frontal, parietal, temporal lobes; largest branch",
"<b>Posterior cerebral artery (PCA)</b> — occipital lobe and inferior temporal lobe",
"<b>Anterior communicating artery</b> — connects the two ACAs",
"<b>Posterior communicating arteries</b> — link ICAs to PCAs, completing the loop",
]:
story.append(bullet(t))
story.append(Spacer(1, 0.2*cm))
story.append(Paragraph(
"Under normal conditions, equal pressures in both circulations prevent admixing. In arterial occlusion, "
"the circle acts as a collateral shunt. A <b>complete circle of Willis is present in only ~50% of individuals</b> — "
"significant anatomical variation exists (see Fig. 1).", body_s))
# Anatomy diagram — full width, prominent
story += [Spacer(1, 0.3*cm)]
story += img("anatomy_diagram.png", width=W,
caption="Fig. 1 — Vascular anatomy of the brain. (A) Complete circle of Willis showing ACA, MCA, PCA, ICA, "
"basilar artery and communicating arteries. (B) Prevalence of anatomical variations. "
"(C) Cross-sectional structure of cerebral vessels from MCA to capillary level. "
"(Miller's Anesthesia 10e, Fig. 10.1)")
story += [Spacer(1, 0.3*cm)]
story += [Paragraph("<b>Venous Drainage</b>", h2_s)]
for t in [
"<b>Superficial cortical veins</b> — within the pia mater on the brain surface",
"<b>Deep cortical veins</b> — drain deeper cerebral structures",
"Both drain into <b>dural sinuses</b> (superior/inferior sagittal, straight, transverse, sigmoid sinuses)",
"Dural sinuses drain into the <b>internal jugular veins (IJV)</b>",
"In ~65% of patients, <b>right IJV flow dominates</b> — relevant for SjvO₂ catheter placement",
]:
story.append(bullet(t))
story += [Spacer(1, 0.3*cm)]
story += [Paragraph("<b>Normal Quantitative Values</b>", h2_s)]
vals_data = [
[Paragraph("Parameter", table_hdr), Paragraph("Value", table_hdr)],
[Paragraph("Total CBF (adult)", table_lft), Paragraph("750 mL/min (~50 mL/100 g/min)", table_cel)],
[Paragraph("Gray matter CBF", table_lft), Paragraph("~80 mL/100 g/min", table_cel)],
[Paragraph("White matter CBF", table_lft), Paragraph("~20 mL/100 g/min", table_cel)],
[Paragraph("% of cardiac output", table_lft), Paragraph("12–15%", table_cel)],
[Paragraph("CMRO₂", table_lft), Paragraph("~3.5 mL O₂/100 g/min (~20% total body O₂)", table_cel)],
[Paragraph("EEG slowing threshold", table_lft), Paragraph("<20–25 mL/100 g/min", table_cel)],
[Paragraph("Isoelectric EEG", table_lft), Paragraph("<20 mL/100 g/min", table_cel)],
[Paragraph("Irreversible ischaemia", table_lft), Paragraph("<10 mL/100 g/min", table_cel)],
[Paragraph("Normal ICP", table_lft), Paragraph("5–15 mmHg", table_cel)],
]
vals_tbl = Table(vals_data, colWidths=[W*0.5, W*0.5])
vals_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), NAVY),
("BACKGROUND", (0,1), (-1,-1), GREY),
("ROWBACKGROUNDS", (0,1), (-1,-1), [white, GREY]),
("GRID", (0,0), (-1,-1), 0.5, HexColor("#cbd5e1")),
("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]),
]))
story += [vals_tbl, Spacer(1, 0.3*cm)]
# ── SECTION 2: FACTORS GOVERNING CBF ────────────────────────────────────────
story += [PageBreak(), section_header("2. FACTORS GOVERNING CEREBRAL BLOOD FLOW"), Spacer(1, 0.3*cm)]
story += [Paragraph(
"CBF is determined by <b>cerebral perfusion pressure (CPP)</b> divided by <b>cerebrovascular resistance (CVR)</b>:", body_s)]
story += [Paragraph(
"<para align='center'><b>CBF = CPP / CVR where CPP = MAP − ICP</b></para>",
S("Formula", parent=body_s, fontSize=11, spaceBefore=4, spaceAfter=8, backColor=LBLUE,
leftIndent=20, rightIndent=20))]
story += [Paragraph("<b>Ganong's summary of factors affecting CBF:</b>", h3_s)]
story += img("factors_cbf.png", width=W*0.72,
caption="Fig. 2 — Summary of factors affecting cerebral blood flow including ICP, MAP at brain level, "
"mean venous pressure, viscosity, and local arteriolar tone. (Ganong's Physiology 26e, Fig. 33-8)")
# 2A Autoregulation
story += [Spacer(1, 0.2*cm), section_header("A. Myogenic Autoregulation (Pressure–Flow)", level=2), Spacer(1, 0.2*cm)]
story += [Paragraph(
"CBF is maintained constant over a <b>MAP range of ~65–150 mmHg</b> in conscious adults (classical Lassen curve). "
"Outside this range CBF becomes <b>pressure-passive</b>. The <b>lower limit of autoregulation (LLA)</b> and "
"<b>upper limit (ULA)</b> show substantial inter-individual variability.", body_s)]
for t in [
"<b>Mechanism:</b> Rising arterial pressure → smooth muscle stretch → voltage-gated Ca²⁺ influx → vasoconstriction → ↑CVR → maintained CBF",
"<b>Modulated by:</b> NO from endothelium, perivascular nerves (sympathetic/parasympathetic), astrocytic paracrine mediators",
"<b>Contemporary view (Miller's):</b> The plateau has a gentle positive slope — not truly flat. The autoregulatory range is narrower than classically taught (~±10% MAP). Autoregulation is dynamic, not static.",
"<b>Hypertension:</b> Shifts the entire curve to the right — the LLA is also higher, so these patients tolerate less hypotension",
"<b>Dynamic autoregulation</b> responds over seconds–minutes; <b>static autoregulation</b> is assessed at steady state (~10 min)",
]:
story.append(bullet(t))
story += [Spacer(1, 0.3*cm)]
story += img("autoregulation.png", width=W*0.7,
caption="Fig. 3 — Autoregulation of CBF. Red: pressure-passive below LLA (~65 mmHg) and above ULA (~150 mmHg). "
"Blue: sympathetic stimulation extends the plateau to the right, providing protection against hypertension. "
"(Ganong's Physiology 26e, Fig. 33-9)")
# 2B Chemical/Metabolic
story += [Spacer(1, 0.2*cm), section_header("B. Chemical and Metabolic Regulation", level=2), Spacer(1, 0.2*cm)]
story += [Paragraph("<b>Carbon Dioxide — The Dominant Cerebrovascular Regulator</b>", h3_s)]
for t in [
"<b>Hypercapnia (↑PaCO₂):</b> potent vasodilation → ↑CBF (~2–4% per mmHg in range 20–80 mmHg)",
"<b>Hypocapnia (↓PaCO₂):</b> vasoconstriction → ↓CBF — basis of <i>controlled hyperventilation</i> to reduce ICP",
"<b>Mechanism:</b> CO₂ freely crosses the BBB; extracellular [H⁺] is the effector — perivascular acidosis relaxes smooth muscle",
"CO₂ reactivity is <b>the most clinically useful</b> tool for controlling CBF in the ICU/neurosurgery",
]:
story.append(bullet(t))
story += [Spacer(1, 0.1*cm), Paragraph("<b>Oxygen</b>", h3_s)]
for t in [
"<b>Hypoxia (PaO₂ < 50 mmHg):</b> vasodilation → ↑CBF",
"Normal PaO₂ variations have little effect on CBF",
"Hyperoxia causes mild vasoconstriction",
]:
story.append(bullet(t))
story += [Spacer(1, 0.1*cm), Paragraph("<b>Flow–Metabolism Coupling (Neurovascular Coupling)</b>", h3_s)]
for t in [
"Local CBF tightly matches local neuronal metabolic demand via the <b>neurovascular unit</b> (neurons, astrocytes, pericytes, endothelium)",
"Increased firing → glutamate → astrocyte activation → release of K⁺, adenosine, NO, arachidonic acid metabolites → arteriolar dilation",
"Gray matter CBF is <b>4× white matter CBF</b>, matching metabolic demand",
"This coupling is the physiologic basis of fMRI (BOLD signal) and PET neuroimaging",
]:
story.append(bullet(t))
# 2C ICP
story += [Spacer(1, 0.2*cm), section_header("C. Intracranial Pressure (Monro-Kellie Doctrine)", level=2), Spacer(1, 0.2*cm)]
for t in [
"Skull is a rigid compartment: Brain (~1400 g) + Blood (~75 mL) + CSF (~75 mL) = constant total volume",
"Volume increase in any component must be compensated by reduction in another",
"<b>CPP = MAP − ICP</b> — rising ICP directly reduces CPP and CBF",
"Rising venous pressure raises ICP → reduces CPP; worsened by head-down positioning",
"Normal ICP = 5–15 mmHg; management targets CPP > 60–70 mmHg in TBI",
]:
story.append(bullet(t))
# 2D Neurogenic
story += [Spacer(1, 0.2*cm), section_header("D. Neurogenic Regulation", level=2), Spacer(1, 0.2*cm)]
for t in [
"Large cerebral vessels: <b>extrinsic sympathetic</b> (noradrenaline → vasoconstriction), <b>parasympathetic</b> (ACh, VIP → vasodilation), <b>sensory trigeminal</b> (substance P, CGRP)",
"Intraparenchymal arterioles: primarily under <b>intrinsic/metabolic</b> control",
"Sympathetic activation <b>extends the autoregulatory plateau to the right</b> — protective against hypertensive breakthrough",
"Role modest during routine physiology; becomes important at extreme BP excursions",
]:
story.append(bullet(t))
# 2E Viscosity
story += [Spacer(1, 0.2*cm), section_header("E. Blood Viscosity", level=2), Spacer(1, 0.2*cm)]
for t in [
"Haematocrit is the main determinant; higher Hct → ↑viscosity → ↑CVR → ↓CBF",
"Moderate haemodilution (Hct ~30–35%) may improve CBF by reducing viscosity, but impairs O₂ delivery",
]:
story.append(bullet(t))
# 2F Cardiac Output
story += [Spacer(1, 0.2*cm), section_header("F. Cardiac Output", level=2), Spacer(1, 0.2*cm)]
for t in [
"CO influences CBF via effects on MAP and via sympathetic nervous activity",
"Heart failure, arrhythmias, or reduced preload can compromise autoregulatory capacity, especially at the LLA",
]:
story.append(bullet(t))
# Integrated regulation diagram
story += [Spacer(1, 0.3*cm)]
story += img("integrated_regulation.png", width=W,
caption="Fig. 4 — Integrated regulation of cerebral blood flow. Cardiac output (CO), arterial blood pressure (ABP), "
"metabolic activity, CO₂, O₂, and other mechanisms converge on cerebral resistance vessels. "
"High/normal/low CO shifts the CBF-CPP curve. (Morgan & Mikhail's Clinical Anesthesiology 7e, Fig. 26-2)")
# ── SECTION 3: CONSCIOUS PATIENT ────────────────────────────────────────────
story += [PageBreak(), section_header("3. CBF IN THE CONSCIOUS PATIENT"), Spacer(1, 0.3*cm)]
story += [Paragraph(
"In the awake, resting individual, all regulatory mechanisms are intact:", body_s)]
for t in [
"<b>Total CBF ≈ 750 mL/min</b> (54 mL/100 g/min); highest in <b>premotor and frontal cortex</b> at rest",
"<b>Flow–metabolism coupling fully preserved:</b> voluntary movement → rapid regional CBF increase in corresponding motor/sensory cortex",
"Language → ↑CBF in Broca's/Wernicke's; visual tasks → ↑occipital CBF",
"<b>Autoregulation intact</b> (MAP 65–150 mmHg plateau); CO₂ reactivity robust",
"EEG fully active; electrophysiologic component drives ~60% of energy consumption",
"Gray matter CBF (69 mL/100 g/min) >> White matter (28 mL/100 g/min) in resting conscious humans (Ganong's)",
"Measurement modalities: PET, fMRI (BOLD), ¹³³Xe washout, Kety–Schmidt N₂O method",
]:
story.append(bullet(t))
# ── SECTION 4: ANAESTHETISED PATIENT ────────────────────────────────────────
story += [PageBreak(), section_header("4. CBF UNDER GENERAL ANAESTHESIA"), Spacer(1, 0.3*cm)]
story += [Paragraph(
"General anaesthesia produces <b>drug-specific, dose-related, and reversible</b> alterations in CBF and CMRO₂. "
"The key principle:", body_s)]
story += [Paragraph(
"<para align='center'><b>Net CBF = f(CMRO₂ suppression + direct vascular effects + autoregulatory status)</b></para>",
S("Formula2", parent=body_s, fontSize=10, spaceBefore=4, spaceAfter=8, backColor=LTEAL,
leftIndent=20, rightIndent=20))]
story += [Paragraph("<b>Cerebral Metabolic Rate (CMRO₂) Under Anaesthesia</b>", h2_s)]
for t in [
"~60% of brain energy is for <b>electrophysiologic function</b> (ion gradients, neurotransmitter cycling)",
"~40% is for <b>cellular homeostasis</b> ('housekeeping component') — irreducible by anaesthetic drugs",
"Most agents (barbiturates, propofol, isoflurane, sevoflurane, desflurane, etomidate) suppress the <b>electrophysiologic component</b> dose-dependently, tracked by EEG suppression",
"Once EEG is isoelectric, <b>no further reduction in CMRO₂</b> regardless of additional dose",
"<b>Exceptions: Ketamine and N₂O increase both CMRO₂ and CBF</b>",
]:
story.append(bullet(t))
story += [Spacer(1, 0.2*cm), Paragraph("<b>Volatile Anaesthetic Agents</b>", h2_s)]
story += [Paragraph(
"All volatile agents are <b>direct cerebral vasodilators</b> (↑CBF) and simultaneously <b>reduce CMRO₂</b> "
"(↓CBF tendency). The net effect depends on the balance:", body_s)]
vol_data = [
[Paragraph("Agent", table_hdr), Paragraph("CBF", table_hdr), Paragraph("CMRO₂", table_hdr),
Paragraph("Autoregulation", table_hdr), Paragraph("ICP", table_hdr)],
[Paragraph("Halothane", table_lft), Paragraph("↑↑↑", table_cel), Paragraph("↓↓", table_cel),
Paragraph("Markedly impaired", table_cel), Paragraph("↑↑", table_cel)],
[Paragraph("Isoflurane", table_lft), Paragraph("↑ at >1 MAC", table_cel), Paragraph("↓↓", table_cel),
Paragraph("Dose-dependent impairment", table_cel), Paragraph("↑ mild", table_cel)],
[Paragraph("Sevoflurane", table_lft), Paragraph("Minimal <1.5 MAC", table_cel), Paragraph("↓↓", table_cel),
Paragraph("Best preserved (1 MAC)", table_cel), Paragraph("↑ mild", table_cel)],
[Paragraph("Desflurane", table_lft), Paragraph("Minimal <1.5 MAC", table_cel), Paragraph("↓↓", table_cel),
Paragraph("Dose-dependent impairment", table_cel), Paragraph("↑ mild", table_cel)],
]
vol_tbl = Table(vol_data, colWidths=[W*0.22, W*0.18, W*0.16, W*0.28, W*0.16])
vol_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), TEAL),
("ROWBACKGROUNDS", (0,1), (-1,-1), [white, GREY]),
("GRID", (0,0), (-1,-1), 0.5, HexColor("#cbd5e1")),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 6),
("RIGHTPADDING", (0,0), (-1,-1), 6),
("ROUNDEDCORNERS", [4]),
]))
story += [vol_tbl, Spacer(1, 0.2*cm)]
story += [Paragraph(
"<b>Autoregulation and volatile agents:</b> All volatile agents impair pressure autoregulation dose-dependently. "
"At high doses, CBF becomes pressure-passive. Sevoflurane best preserves dynamic autoregulation up to ~1 MAC. "
"CO₂ reactivity is <b>partially preserved</b> with all volatile agents — clinically, hyperventilation still "
"reduces CBF and ICP during volatile anaesthesia.", body_s)]
story += [Spacer(1, 0.2*cm), Paragraph("<b>Intravenous Anaesthetic Agents</b>", h2_s)]
iv_data = [
[Paragraph("Agent", table_hdr), Paragraph("CBF", table_hdr), Paragraph("CMRO₂", table_hdr),
Paragraph("Autoregulation", table_hdr), Paragraph("ICP", table_hdr)],
[Paragraph("Propofol", table_lft), Paragraph("↓↓", table_cel), Paragraph("↓↓", table_cel), Paragraph("Preserved", table_cel), Paragraph("↓", table_cel)],
[Paragraph("Barbiturates", table_lft), Paragraph("↓↓", table_cel), Paragraph("↓↓", table_cel), Paragraph("Preserved", table_cel), Paragraph("↓↓", table_cel)],
[Paragraph("Etomidate", table_lft), Paragraph("↓", table_cel), Paragraph("↓", table_cel), Paragraph("Preserved", table_cel), Paragraph("↓", table_cel)],
[Paragraph("Ketamine", table_lft), Paragraph("↑↑", table_cel), Paragraph("↑", table_cel), Paragraph("Impaired", table_cel), Paragraph("↑↑", table_cel)],
[Paragraph("Benzodiazepines", table_lft),Paragraph("↓", table_cel), Paragraph("↓", table_cel), Paragraph("Preserved", table_cel), Paragraph("↓", table_cel)],
[Paragraph("Dexmedetomidine", table_lft),Paragraph("↓ modest", table_cel), Paragraph("↓ modest", table_cel), Paragraph("Preserved", table_cel), Paragraph("↓", table_cel)],
[Paragraph("Nitrous oxide", table_lft), Paragraph("↑", table_cel), Paragraph("↑", table_cel), Paragraph("Variable", table_cel), Paragraph("↑", table_cel)],
]
iv_tbl = Table(iv_data, colWidths=[W*0.24, W*0.16, W*0.16, W*0.28, W*0.16])
iv_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), NAVY),
("ROWBACKGROUNDS", (0,1), (-1,-1), [white, GREY]),
("GRID", (0,0), (-1,-1), 0.5, HexColor("#cbd5e1")),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 6),
("RIGHTPADDING", (0,0), (-1,-1), 6),
("ROUNDEDCORNERS", [4]),
]))
story += [iv_tbl, Spacer(1, 0.2*cm)]
story += [Paragraph(
"<b>Propofol and barbiturates</b> are preferred in neurosurgery and raised ICP because both CBF and CMRO₂ "
"fall in tandem while autoregulation is preserved. <b>Ketamine</b> is contraindicated in raised ICP "
"(increases CBF and ICP). When complete EEG suppression is achieved, CMRO₂ is similar regardless of agent used.", body_s)]
story += [Spacer(1, 0.2*cm), Paragraph("<b>Temperature</b>", h2_s)]
for t in [
"CMRO₂ decreases <b>6–7% per °C</b> of hypothermia",
"Unlike anaesthetics, hypothermia reduces <b>both</b> the electrophysiologic and housekeeping components",
"EEG isoelectric at ~18–20°C; CMRO₂ at 18°C is <10% of normothermic values — basis of hypothermic circulatory arrest",
]:
story.append(bullet(t))
story += [Spacer(1, 0.2*cm), Paragraph("<b>Glymphatic System and Anaesthesia</b>", h2_s)]
story += [Paragraph(
"The glymphatic pathway (perivascular aquaporin-mediated CSF/waste clearance) is enhanced during sleep and "
"general anaesthesia — the periarterial space expands. <b>Dexmedetomidine</b> better preserves glymphatic function "
"than volatile agents, which reduce lymphatic transport.", body_s)]
# ── SECTION 5: COMPARISON TABLE ─────────────────────────────────────────────
story += [PageBreak(), section_header("5. SUMMARY: CONSCIOUS vs. ANAESTHETISED"), Spacer(1, 0.3*cm)]
cmp_data = [
[Paragraph("Feature", table_hdr), Paragraph("Conscious", table_hdr), Paragraph("Anaesthetised (IVA)", table_hdr), Paragraph("Anaesthetised (Volatile)", table_hdr)],
[Paragraph("CBF", table_lft), Paragraph("50 mL/100g/min", table_cel), Paragraph("↓ (coupled)", table_cel), Paragraph("Variable (drug-dependent)", table_cel)],
[Paragraph("CMRO₂", table_lft), Paragraph("3.5 mL O₂/100g/min", table_cel), Paragraph("↓↓ (both components suppressed progressively)", table_cel), Paragraph("↓ electrophysiologic; housekeeping intact", table_cel)],
[Paragraph("Flow–metabolism coupling", table_lft), Paragraph("Intact", table_cel), Paragraph("Preserved", table_cel), Paragraph("May be partially uncoupled", table_cel)],
[Paragraph("Autoregulation", table_lft), Paragraph("Intact (65–150 mmHg)", table_cel), Paragraph("Preserved", table_cel), Paragraph("Dose-dependent impairment", table_cel)],
[Paragraph("CO₂ reactivity", table_lft), Paragraph("Robust", table_cel), Paragraph("Preserved", table_cel), Paragraph("Partially preserved", table_cel)],
[Paragraph("Regional flow variation", table_lft), Paragraph("High (task-dependent)", table_cel), Paragraph("Blunted", table_cel), Paragraph("Blunted", table_cel)],
[Paragraph("ICP effect", table_lft), Paragraph("Normal", table_cel), Paragraph("↓ (propofol, barbiturates)", table_cel), Paragraph("↑ (dose-dependent)", table_cel)],
[Paragraph("EEG", table_lft), Paragraph("Fully active", table_cel), Paragraph("Suppressed (dose-dependent)", table_cel), Paragraph("Suppressed (dose-dependent)", table_cel)],
]
cmp_tbl = Table(cmp_data, colWidths=[W*0.23, W*0.22, W*0.28, W*0.27])
cmp_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), NAVY),
("ROWBACKGROUNDS", (0,1), (-1,-1), [white, GREY]),
("GRID", (0,0), (-1,-1), 0.5, HexColor("#cbd5e1")),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 6),
("RIGHTPADDING", (0,0), (-1,-1), 6),
("ROUNDEDCORNERS", [4]),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
("WORDWRAP", (0,0), (-1,-1), True),
]))
story += [cmp_tbl, Spacer(1, 0.4*cm)]
story += [hr()]
story += [Paragraph(
"<b>Sources:</b> Miller's Anesthesia 10e (Ch. 10) · Morgan & Mikhail's Clinical Anesthesiology 7e (Ch. 26) · "
"Barash, Cullen & Stoelting's Clinical Anesthesia 9e (Ch. 18) · Ganong's Review of Medical Physiology 26e (Ch. 33) · "
"Guyton & Hall Textbook of Medical Physiology",
source_s)]
doc.build(story)
print("PDF built successfully:", OUTPUT)
cd /home/daytona/workspace/cerebral-circulation && python3 build_pdf.py 2>&1
~/cerebral-circulation/build_pdf.py
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/cerebral-circulation/build_pdf.py'
cd /home/daytona/workspace/cerebral-circulation && python3 build_pdf.py 2>&1
Cerebral Circulation
PDF Document · PDF