Make ppt of 30 slides describing anatomy of brachial plexus, sub arachnoid and epidural spaces
brachial plexus anatomy roots trunks divisions cords diagram
epidural space subarachnoid space spinal meninges anatomy cross section
ls -la /home/daytona/workspace/ 2>/dev/null || echo "workspace empty"
mkdir -p /home/daytona/workspace/neuro-anatomy-ppt
~/neuro-anatomy-ppt/build.js
const pptxgen = require("pptxgenjs");
const { execSync } = require("child_process");
// ─── Color palette ──────────────────────────────────────────────────────────
const C = {
navy: "0D1B2A", // dominant bg
teal: "1B6CA8", // section header accent
cyan: "14B8A6", // highlights / bullets
gold: "F59E0B", // key terms
white: "F0F4F8", // body text
light: "CBD5E1", // secondary text
dark: "0A1628", // darker bg alt
slate: "1E293B", // card bg
green: "10B981", // accent 2
};
const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Anatomy of Brachial Plexus, Subarachnoid & Epidural Spaces";
pres.author = "Medical Education";
// ─── Helper functions ────────────────────────────────────────────────────────
function addBg(slide, color) {
slide.addShape(pres.ShapeType.rect, {
x: 0, y: 0, w: 10, h: 5.625,
fill: { color: color || C.navy },
line: { color: color || C.navy },
});
}
function topStripe(slide, color) {
slide.addShape(pres.ShapeType.rect, {
x: 0, y: 0, w: 10, h: 0.08,
fill: { color: color || C.cyan },
line: { color: color || C.cyan },
});
}
function sectionLabel(slide, text, color) {
slide.addText(text.toUpperCase(), {
x: 0.4, y: 0.12, w: 9, h: 0.3,
fontSize: 8, bold: true, color: color || C.cyan,
charSpacing: 3, align: "left",
});
}
function slideTitle(slide, text, y, color) {
slide.addText(text, {
x: 0.4, y: y !== undefined ? y : 0.45, w: 9.2, h: 0.6,
fontSize: 22, bold: true, color: color || C.white,
align: "left",
});
}
function divider(slide, y) {
slide.addShape(pres.ShapeType.line, {
x: 0.4, y: y || 1.1, w: 9.2, h: 0,
line: { color: C.teal, width: 1.2 },
});
}
function bullets(slide, items, x, y, w, h, opts) {
const textArr = items.map((item, i) => ({
text: item,
options: { bullet: { type: "bullet" }, breakLine: i < items.length - 1, ...opts },
}));
slide.addText(textArr, {
x, y, w, h,
fontSize: opts?.fontSize || 13,
color: opts?.color || C.white,
valign: "top",
});
}
function card(slide, x, y, w, h, title, titleColor, body, bodyFontSize) {
slide.addShape(pres.ShapeType.roundRect, {
x, y, w, h,
fill: { color: C.slate },
line: { color: C.teal, width: 0.5 },
rectRadius: 0.08,
});
slide.addText(title, {
x: x + 0.1, y: y + 0.05, w: w - 0.2, h: 0.35,
fontSize: 11, bold: true, color: titleColor || C.cyan,
});
slide.addText(body, {
x: x + 0.1, y: y + 0.42, w: w - 0.2, h: h - 0.5,
fontSize: bodyFontSize || 10.5, color: C.white, valign: "top",
});
}
// ─── Fetch images ─────────────────────────────────────────────────────────────
const imgUrls = [
"https://cdn.orris.care/cdss_images/HARRISON_1763034978151_dcfec64f-4894-46b6-94bd-ba17fd6a8314.png", // idx 0: brachial plexus schematic
"https://cdn.orris.care/cdss_images/pmc_clinical_VQA_9f3cd2a0d555feaacb1f044acbbe90c4b722b0701b0110de7144f429a6b62ab8.jpg", // idx 1: cadaveric dissection
"https://cdn.orris.care/cdss_images/42e3982ca738d0e6877cc67f524d1fbfcf9d635fdfed6e0372f6519623416ef7.png", // idx 2: brachial plexus roots/trunks (gray's)
"https://cdn.orris.care/cdss_images/62ef9714975a8ea1509371bbecc736c66c2fdd7a02df72fb8141a511a0a08af2.png", // idx 3: schematic cords/divisions (gray's)
"https://cdn.orris.care/cdss_images/2d1e124866bcf5ef44fe04881ee3568b0ed579f0f211fa7c979d830bd74fde4d.png", // idx 4: brachial plexus branches axillary artery
"https://cdn.orris.care/cdss_images/bb18d779e57345e0dd2901a2fd6bbb8b1bc3bcd30abe5f3078866a28d6f15b00.png", // idx 5: dorsal scapular / long thoracic
"https://cdn.orris.care/cdss_images/e86b3797e2a43e429bc205e0a4cbf82668c184881aa0cab5cb2ca86c02d919f7.png", // idx 6: subarachnoid / meninges diagram
"https://cdn.orris.care/cdss_images/21d0b52019b115ac8896f2660fc2a3b660dfb86f0be44e9e547bbc63d08ba535.png", // idx 7: ligamentum flavum lumbar
"https://cdn.orris.care/cdss_images/16b155e915375ee13a1ca44ba4cb83217d78f06b48fc25dbd4d561bf2cde5743.png", // idx 8: epidural compartments
"https://cdn.orris.care/cdss_images/309b849fc80e813a21de7330fe1b70450e2dc5eb3e084f54f5c6ee18cd844761.png", // idx 9: spinal meninges layers
"https://cdn.orris.care/cdss_images/pmc_clinical_VQA_e721b23638e92195e7534d9cc8c6db83410e32ec47c3c60a9c5cce3875a38b96.jpg", // idx 10: epidural space MRI compartments
"https://cdn.orris.care/cdss_images/pmc_clinical_VQA_b976a62c5ccd49c7f0defd8b3e72c0bb630789f5ab6efb976849718fbb984eaf.jpg", // idx 11: subarachnoid MRI sagittal/axial
];
console.log("Fetching images...");
let images;
try {
const raw = execSync(
`node /home/daytona/skills/shared/scripts/fetch_images.js ${imgUrls.map(u => `"${u}"`).join(" ")}`,
{ maxBuffer: 50 * 1024 * 1024 }
).toString();
images = JSON.parse(raw);
} catch(e) {
console.error("Image fetch failed:", e.message);
images = imgUrls.map(() => ({ base64: null, error: "fetch failed" }));
}
function img(idx) {
return images[idx] && !images[idx].error ? images[idx].base64 : null;
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDES
// ══════════════════════════════════════════════════════════════════════════════
// ── SLIDE 1 · Title ──────────────────────────────────────────────────────────
{
const s = pres.addSlide();
addBg(s, C.dark);
// gradient accent bar left
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:0.12, h:5.625, fill:{color:C.cyan}, line:{color:C.cyan} });
s.addShape(pres.ShapeType.rect, { x:0.12, y:0, w:0.06, h:5.625, fill:{color:C.teal}, line:{color:C.teal} });
// title block
s.addText("Anatomy of the", { x:0.5, y:1.0, w:9, h:0.7, fontSize:20, color:C.cyan, bold:false });
s.addText("Brachial Plexus,\nSubarachnoid & Epidural Spaces", {
x:0.5, y:1.65, w:9, h:1.5, fontSize:32, bold:true, color:C.white,
});
s.addShape(pres.ShapeType.line, { x:0.5, y:3.3, w:5, h:0, line:{color:C.gold, width:2} });
s.addText("Comprehensive Neuroanatomy for Clinical Practice", {
x:0.5, y:3.45, w:9, h:0.45, fontSize:14, color:C.light, italic:true,
});
s.addText("Sources: Gray's Anatomy for Students · Barash Clinical Anesthesia 9e · Miller's Anesthesia 10e", {
x:0.5, y:5.05, w:9, h:0.4, fontSize:8, color:C.light,
});
}
// ── SLIDE 2 · Overview / Contents ────────────────────────────────────────────
{
const s = pres.addSlide();
addBg(s); topStripe(s);
sectionLabel(s, "Overview");
slideTitle(s, "What We Will Cover");
divider(s);
const topics = [
["PART 1 · BRACHIAL PLEXUS (Slides 3–16)", C.cyan],
["Formation, roots, trunks, divisions, cords", C.white],
["Terminal branches & cutaneous distribution", C.white],
["Clinical correlations & injuries", C.white],
["PART 2 · SUBARACHNOID SPACE (Slides 17–23)", C.cyan],
["Meningeal layers, CSF, cisterns", C.white],
["Clinical significance (LP, SAH)", C.white],
["PART 3 · EPIDURAL SPACE (Slides 24–30)", C.cyan],
["Anatomy, contents, boundaries", C.white],
["Clinical applications (epidural anesthesia)", C.white],
];
const textArr = topics.map(([text, color], i) => ({
text,
options: { bold: color !== C.white, color, breakLine: i < topics.length - 1, fontSize: 12 },
}));
s.addText(textArr, { x:0.5, y:1.2, w:9, h:4.1, valign:"top" });
}
// ─── PART 1 SECTION CARD ──────────────────────────────────────────────────────
// ── SLIDE 3 · Brachial Plexus – Introduction ─────────────────────────────────
{
const s = pres.addSlide();
addBg(s); topStripe(s, C.teal);
sectionLabel(s, "Brachial Plexus · Introduction", C.teal);
slideTitle(s, "What Is the Brachial Plexus?");
divider(s, 1.05);
s.addText([
{ text: "The brachial plexus is a somatic nerve plexus formed by the ", options:{color:C.white} },
{ text: "anterior rami of C5–C8 and most of T1", options:{bold:true, color:C.gold} },
{ text: ".", options:{color:C.white} },
], { x:0.4, y:1.15, w:5.4, h:0.75, fontSize:13 });
bullets(s, [
"Originates in the posterior triangle of the neck",
"Passes laterally over rib I into the axilla",
"Supplies the entire upper limb (motor + sensory)",
"Sympathetic fibers join via gray rami communicantes",
"All major upper limb nerves arise from its cords",
], 0.4, 1.9, 5.4, 3.0, { fontSize:12 });
if (img(2)) s.addImage({ data: img(2), x:5.9, y:1.1, w:3.8, h:4.1 });
s.addText("Fig: Brachial plexus major components (Gray's Anatomy for Students)", {
x:5.9, y:5.1, w:3.8, h:0.35, fontSize:7, color:C.light, italic:true,
});
}
// ── SLIDE 4 · Roots ───────────────────────────────────────────────────────────
{
const s = pres.addSlide();
addBg(s); topStripe(s, C.teal);
sectionLabel(s, "Brachial Plexus · Roots", C.teal);
slideTitle(s, "The Roots (C5–T1)");
divider(s);
const rts = [
["C5", "Upper root – contributes to superior trunk"],
["C6", "Upper root – joins C5 → superior trunk"],
["C7", "Middle root – continues as middle trunk"],
["C8", "Lower root – joins T1 → inferior trunk"],
["T1", "Lower root – partial contribution (majority joins C8)"],
];
rts.forEach(([label, desc], i) => {
const yy = 1.2 + i * 0.72;
s.addShape(pres.ShapeType.roundRect, { x:0.4, y:yy, w:0.55, h:0.52,
fill:{color:C.teal}, line:{color:C.teal}, rectRadius:0.06 });
s.addText(label, { x:0.4, y:yy, w:0.55, h:0.52, fontSize:13, bold:true, color:C.white, align:"center", valign:"middle" });
s.addText(desc, { x:1.05, y:yy+0.06, w:5.2, h:0.4, fontSize:11.5, color:C.white });
});
s.addShape(pres.ShapeType.roundRect, { x:6.5, y:1.0, w:3.2, h:4.3,
fill:{color:C.slate}, line:{color:C.cyan, width:0.5}, rectRadius:0.1 });
s.addText("Key Points", { x:6.6, y:1.1, w:3.0, h:0.35, fontSize:11, bold:true, color:C.cyan });
bullets(s, [
"Roots = anterior rami of spinal nerves",
"Pass between anterior & middle scalene",
"Lie posterior to subclavian artery",
"Receive gray rami (sympathetics)",
"C5 contributes to phrenic nerve",
], 6.55, 1.5, 3.0, 3.5, { fontSize:10.5 });
}
// ── SLIDE 5 · Trunks ─────────────────────────────────────────────────────────
{
const s = pres.addSlide();
addBg(s); topStripe(s, C.teal);
sectionLabel(s, "Brachial Plexus · Trunks", C.teal);
slideTitle(s, "The Three Trunks");
divider(s);
const trunks = [
{ name:"Superior Trunk", roots:"C5 + C6", pos:"Superior in position", color:C.cyan },
{ name:"Middle Trunk", roots:"C7 alone", pos:"Intermediate", color:C.green },
{ name:"Inferior Trunk", roots:"C8 + T1", pos:"Posterior to subclavian artery on rib I", color:C.gold },
];
trunks.forEach((t, i) => {
const xx = 0.35 + i * 3.25;
s.addShape(pres.ShapeType.roundRect, { x:xx, y:1.2, w:3.0, h:3.8,
fill:{color:C.slate}, line:{color:t.color, width:1.2}, rectRadius:0.1 });
s.addShape(pres.ShapeType.rect, { x:xx, y:1.2, w:3.0, h:0.55,
fill:{color:t.color}, line:{color:t.color}, rectRadius:0 });
s.addText(t.name, { x:xx+0.05, y:1.22, w:2.9, h:0.5, fontSize:12.5, bold:true, color:C.dark, valign:"middle", align:"center" });
s.addText(`Roots: ${t.roots}`, { x:xx+0.1, y:1.85, w:2.8, h:0.4, fontSize:11, bold:true, color:t.color });
s.addText(t.pos, { x:xx+0.1, y:2.25, w:2.8, h:0.5, fontSize:10, color:C.white });
s.addText("Passes laterally over rib I and enters the axilla", { x:xx+0.1, y:2.8, w:2.8, h:0.6, fontSize:10, color:C.light });
if (i === 2) {
s.addText("Lies POSTERIOR to subclavian artery — vulnerable to compression", {
x:xx+0.1, y:3.45, w:2.8, h:0.7, fontSize:10, color:C.gold, italic:true,
});
}
});
s.addText("Trunks pass between scalene muscles and over rib I before entering the axilla", {
x:0.35, y:5.15, w:9.3, h:0.3, fontSize:9, color:C.light, italic:true, align:"center",
});
}
// ── SLIDE 6 · Divisions ───────────────────────────────────────────────────────
{
const s = pres.addSlide();
addBg(s); topStripe(s, C.teal);
sectionLabel(s, "Brachial Plexus · Divisions", C.teal);
slideTitle(s, "Anterior & Posterior Divisions");
divider(s);
s.addText("Each trunk divides into anterior and posterior divisions as it passes beneath the clavicle:", {
x:0.4, y:1.15, w:9.2, h:0.5, fontSize:12, color:C.white,
});
// Table-style layout
const hdrs = ["Trunk", "Anterior Division → Supplies", "Posterior Division → Supplies"];
const rows = [
["Superior", "Anterior (flexor) compartments\nof arm & forearm", "Posterior (extensor) compartments"],
["Middle", "Anterior compartment (C7)", "Posterior compartments (C7)"],
["Inferior", "Anterior compartment (C8, T1)", "Posterior compartments (C8, T1)"],
];
const cols = [1.2, 4.5, 3.0];
const xs = [0.3, 1.6, 6.2];
const headerY = 1.75;
hdrs.forEach((h, i) => {
s.addShape(pres.ShapeType.rect, { x:xs[i], y:headerY, w:cols[i], h:0.42,
fill:{color:C.teal}, line:{color:C.teal} });
s.addText(h, { x:xs[i]+0.05, y:headerY, w:cols[i]-0.1, h:0.42,
fontSize:10.5, bold:true, color:C.white, valign:"middle" });
});
rows.forEach((row, ri) => {
const ry = headerY + 0.45 + ri * 0.9;
const bg = ri % 2 === 0 ? C.slate : C.navy;
row.forEach((cell, ci) => {
s.addShape(pres.ShapeType.rect, { x:xs[ci], y:ry, w:cols[ci], h:0.88,
fill:{color:bg}, line:{color:C.teal, width:0.3} });
s.addText(cell, { x:xs[ci]+0.05, y:ry+0.05, w:cols[ci]-0.1, h:0.78,
fontSize:10, color:C.white, valign:"middle" });
});
});
s.addText("Note: No peripheral nerves arise directly from the divisions — they are transitional segments only.",{
x:0.4, y:5.0, w:9.2, h:0.42, fontSize:9.5, color:C.gold, italic:true,
});
}
// ── SLIDE 7 · Cords ───────────────────────────────────────────────────────────
{
const s = pres.addSlide();
addBg(s); topStripe(s, C.teal);
sectionLabel(s, "Brachial Plexus · Cords", C.teal);
slideTitle(s, "The Three Cords");
divider(s);
s.addText("Named for their position relative to the 2nd part of the axillary artery:", {
x:0.4, y:1.15, w:9.2, h:0.45, fontSize:12, color:C.white,
});
const cords = [
{ name:"Lateral Cord", color:C.cyan, comp:"C5–C7",
origin:"Anterior divisions of superior + middle trunks",
position:"Lateral to axillary artery",
branches:"Lateral pectoral nerve, musculocutaneous nerve, lateral root of median nerve" },
{ name:"Medial Cord", color:C.green, comp:"C8–T1",
origin:"Continuation of anterior division of inferior trunk",
position:"Medial to axillary artery",
branches:"Medial pectoral n., medial cutaneous nerves of arm & forearm, medial root of median n., ulnar n." },
{ name:"Posterior Cord", color:C.gold, comp:"C5–T1",
origin:"All three posterior divisions",
position:"Posterior to axillary artery",
branches:"Upper & lower subscapular, thoracodorsal, axillary, radial nerves" },
];
cords.forEach((c, i) => {
const xx = 0.2 + i * 3.3;
s.addShape(pres.ShapeType.roundRect, { x:xx, y:1.7, w:3.1, h:3.65,
fill:{color:C.slate}, line:{color:c.color, width:1.5}, rectRadius:0.1 });
s.addShape(pres.ShapeType.rect, { x:xx, y:1.7, w:3.1, h:0.5,
fill:{color:c.color}, line:{color:c.color} });
s.addText(c.name, { x:xx+0.05, y:1.72, w:3.0, h:0.46, fontSize:12, bold:true, color:C.dark, align:"center", valign:"middle" });
[
["Components", c.comp],
["Origin", c.origin],
["Position", c.position],
["Branches", c.branches],
].forEach(([lbl, val], li) => {
const ly = 2.28 + li * 0.76;
s.addText(lbl + ":", { x:xx+0.1, y:ly, w:2.9, h:0.22, fontSize:9, bold:true, color:c.color });
s.addText(val, { x:xx+0.1, y:ly+0.22, w:2.9, h:0.5, fontSize:9, color:C.white });
});
});
}
// ── SLIDE 8 · Schematic overview (visual) ─────────────────────────────────────
{
const s = pres.addSlide();
addBg(s); topStripe(s, C.teal);
sectionLabel(s, "Brachial Plexus · Schematic", C.teal);
slideTitle(s, "Full Plexus — Schematic Overview");
divider(s);
if (img(0)) {
s.addImage({ data: img(0), x: 0.3, y: 1.15, w: 9.4, h: 4.2 });
}
s.addText("Source: Harrison's Principles of Internal Medicine, 22e | Roots → Trunks → Divisions → Cords → Peripheral Nerves", {
x:0.3, y:5.15, w:9.4, h:0.35, fontSize:7.5, color:C.light, italic:true, align:"center",
});
}
// ── SLIDE 9 · Cadaveric view / MRI ─────────────────────────────────────────────
{
const s = pres.addSlide();
addBg(s); topStripe(s, C.teal);
sectionLabel(s, "Brachial Plexus · Dissection View", C.teal);
slideTitle(s, "Cadaveric Dissection & MRI Correlation");
divider(s);
if (img(1)) {
s.addImage({ data: img(1), x: 0.3, y: 1.15, w: 9.4, h: 4.1 });
}
s.addText("Cadaveric dissection showing C5–T1 roots in the scalene triangle, trunks, cords, and terminal branches (with MRI correlation)", {
x:0.3, y:5.15, w:9.4, h:0.35, fontSize:7.5, color:C.light, italic:true, align:"center",
});
}
// ── SLIDE 10 · Branches from Roots ──────────────────────────────────────────
{
const s = pres.addSlide();
addBg(s); topStripe(s, C.teal);
sectionLabel(s, "Brachial Plexus · Root Branches", C.teal);
slideTitle(s, "Branches from the Roots");
divider(s);
card(s, 0.3, 1.2, 4.5, 2.1, "Dorsal Scapular Nerve (C5)", C.cyan,
"• Passes posteriorly, piercing middle scalene\n• Travels along medial border of scapula\n• Innervates rhomboid major & minor", 11);
card(s, 5.0, 1.2, 4.7, 2.1, "Long Thoracic Nerve (C5–C7)", C.green,
"• Descends through neck → axillary inlet\n• Runs down medial wall of axilla\n• Supplies serratus anterior muscle", 11);
s.addText("Injury to the long thoracic nerve causes 'winging of the scapula' — inability to protract the scapula", {
x:0.3, y:3.4, w:9.4, h:0.55, fontSize:12, color:C.gold, italic:true, bold:true, align:"center",
});
if (img(5)) s.addImage({ data: img(5), x: 0.8, y: 3.9, w: 8.4, h: 1.5 });
}
// ── SLIDE 11 · Branches from Trunks ─────────────────────────────────────────
{
const s = pres.addSlide();
addBg(s); topStripe(s, C.teal);
sectionLabel(s, "Brachial Plexus · Trunk Branches", C.teal);
slideTitle(s, "Branches from the Superior Trunk");
divider(s);
s.addText("Only the superior (upper) trunk gives off direct branches:", {
x:0.4, y:1.15, w:9.2, h:0.45, fontSize:12, color:C.white,
});
card(s, 0.4, 1.7, 4.5, 3.5, "Suprascapular Nerve (C5–C6)", C.cyan,
"• Arises from superior trunk\n• Passes through suprascapular notch\n• Innervates supraspinatus & infraspinatus muscles\n• Provides sensory supply to shoulder joint\n• Vulnerable in shoulder trauma (dislocation)", 11);
card(s, 5.2, 1.7, 4.5, 3.5, "Nerve to Subclavius (C5–C6)", C.green,
"• Arises from superior trunk\n• Short nerve descending to subclavius muscle\n• Innervates the subclavius\n• Sometimes called the accessory phrenic nerve as it may contribute fibers to the phrenic nerve\n• Clinically less significant than suprascapular", 11);
}
// ── SLIDE 12 · Terminal Branches (Lateral & Medial Cords) ──────────────────
{
const s = pres.addSlide();
addBg(s); topStripe(s, C.teal);
sectionLabel(s, "Brachial Plexus · Terminal Branches", C.teal);
slideTitle(s, "Terminal Branches – Lateral & Medial Cords");
divider(s);
// 2-column
bullets(s, [
"LATERAL CORD (C5–C7):",
"Lateral pectoral nerve → pectoralis major",
"Musculocutaneous nerve → coracobrachialis, biceps, brachialis; terminates as lateral cutaneous nerve of forearm",
"Lateral root of median nerve → joins medial root",
], 0.3, 1.15, 4.8, 4.0, { fontSize:11.5, color:C.white });
// Paint first item differently
s.addText("LATERAL CORD (C5–C7):", { x:0.3, y:1.15, w:4.8, h:0.45, fontSize:12, bold:true, color:C.cyan });
s.addText("MEDIAL CORD (C8–T1):", { x:5.3, y:1.15, w:4.4, h:0.45, fontSize:12, bold:true, color:C.green });
bullets(s, [
"Medial pectoral nerve → pectoralis minor & major",
"Medial cutaneous nerve of arm (medial brachial cutaneous)",
"Medial cutaneous nerve of forearm (medial antebrachial cutaneous)",
"Medial root of median nerve",
"Ulnar nerve (C7–T1) → major nerve of medial forearm & hand",
], 5.3, 1.65, 4.4, 3.5, { fontSize:11, color:C.white });
bullets(s, [
"Lateral pectoral nerve → pectoralis major",
"Musculocutaneous nerve → coracobrachialis, biceps, brachialis; terminates as lateral cutaneous n. of forearm",
"Lateral root of median nerve → joins medial root to form median nerve (C5–T1)",
], 0.3, 1.65, 4.8, 3.5, { fontSize:11, color:C.white });
}
// ── SLIDE 13 · Posterior Cord Branches ───────────────────────────────────────
{
const s = pres.addSlide();
addBg(s); topStripe(s, C.teal);
sectionLabel(s, "Brachial Plexus · Posterior Cord", C.teal);
slideTitle(s, "Terminal Branches – Posterior Cord (C5–T1)");
divider(s);
const branches = [
{ n:"Upper Subscapular (C5–C6)", fn:"Subscapularis (upper portion)", color:C.cyan },
{ n:"Thoracodorsal / Middle Subscapular (C6–C8)", fn:"Latissimus dorsi", color:C.green },
{ n:"Lower Subscapular (C5–C6)", fn:"Subscapularis (lower) + teres major", color:C.gold },
{ n:"Axillary Nerve (C5–C6)", fn:"Deltoid, teres minor; sensory to 'badge area'", color:C.cyan },
{ n:"Radial Nerve (C5–T1)", fn:"All posterior compartment muscles of arm & forearm; largest terminal branch", color:C.green },
];
branches.forEach((b, i) => {
const yy = 1.2 + i * 0.8;
s.addShape(pres.ShapeType.roundRect, { x:0.3, y:yy, w:9.4, h:0.72,
fill:{color:C.slate}, line:{color:b.color, width:0.7}, rectRadius:0.06 });
s.addText(b.n, { x:0.45, y:yy+0.06, w:4.5, h:0.55, fontSize:11.5, bold:true, color:b.color, valign:"middle" });
s.addText("→ " + b.fn, { x:5.0, y:yy+0.06, w:4.6, h:0.55, fontSize:11, color:C.white, valign:"middle" });
});
}
// ── SLIDE 14 · Median & Ulnar Nerves ─────────────────────────────────────────
{
const s = pres.addSlide();
addBg(s); topStripe(s, C.teal);
sectionLabel(s, "Brachial Plexus · Key Terminal Nerves", C.teal);
slideTitle(s, "The 'Big Five' Terminal Nerves");
divider(s);
const nerves = [
{ name:"Musculocutaneous", origin:"Lateral cord C5–C7", supplies:"Coracobrachialis, biceps, brachialis → lateral forearm skin" },
{ name:"Median", origin:"Both cords C5–T1", supplies:"Flexors of forearm (mainly), thenar muscles, lateral 3½ fingers" },
{ name:"Ulnar", origin:"Medial cord C8–T1", supplies:"Most intrinsic hand muscles, medial 1½ fingers" },
{ name:"Radial", origin:"Posterior cord C5–T1", supplies:"All posterior arm/forearm extensors, posterior arm skin" },
{ name:"Axillary", origin:"Posterior cord C5–C6", supplies:"Deltoid, teres minor, shoulder badge area" },
];
nerves.forEach((n, i) => {
const yy = 1.2 + i * 0.82;
s.addShape(pres.ShapeType.rect, { x:0.3, y:yy, w:2.2, h:0.72, fill:{color:C.teal}, line:{color:C.teal} });
s.addText(n.name, { x:0.35, y:yy, w:2.1, h:0.72, fontSize:11.5, bold:true, color:C.white, valign:"middle", align:"center" });
s.addText(n.origin, { x:2.6, y:yy+0.1, w:2.5, h:0.52, fontSize:10.5, color:C.cyan });
s.addText(n.supplies, { x:5.2, y:yy+0.1, w:4.6, h:0.52, fontSize:10.5, color:C.white });
});
}
// ── SLIDE 15 · Clinical Correlations ─────────────────────────────────────────
{
const s = pres.addSlide();
addBg(s); topStripe(s, C.gold);
sectionLabel(s, "Brachial Plexus · Clinical Correlations", C.gold);
slideTitle(s, "Brachial Plexus Injuries & Palsies");
divider(s, 1.05);
const injuries = [
{ name:"Erb's Palsy (Upper Trunk – C5–C6)", desc:"'Waiter's tip' deformity — arm adducted, medially rotated, forearm pronated. From forceful shoulder depression." },
{ name:"Klumpke's Palsy (Lower Trunk – C8–T1)", desc:"Intrinsic hand muscle weakness + Horner's syndrome (if T1 root avulsed). From excessive arm abduction/traction." },
{ name:"Winging of Scapula", desc:"Long thoracic nerve injury → serratus anterior paralysis. Medial scapular border protrudes." },
{ name:"Thoracic Outlet Syndrome", desc:"Compression of brachial plexus (+ subclavian vessels) between scalenes or cervical rib. Medial cord most affected." },
{ name:"Axillary Nerve Injury", desc:"Surgical neck humeral fracture or shoulder dislocation → deltoid weakness + badge area anesthesia." },
];
injuries.forEach((inj, i) => {
const yy = 1.15 + i * 0.85;
s.addShape(pres.ShapeType.roundRect, { x:0.3, y:yy, w:9.4, h:0.78,
fill:{color:C.slate}, line:{color:C.gold, width:0.6}, rectRadius:0.06 });
s.addText(inj.name, { x:0.45, y:yy+0.04, w:9.1, h:0.28, fontSize:11, bold:true, color:C.gold });
s.addText(inj.desc, { x:0.45, y:yy+0.34, w:9.1, h:0.38, fontSize:10, color:C.white });
});
}
// ── SLIDE 16 · Brachial Plexus Summary ───────────────────────────────────────
{
const s = pres.addSlide();
addBg(s); topStripe(s, C.teal);
sectionLabel(s, "Brachial Plexus · Summary", C.teal);
slideTitle(s, "Key Memory Aids");
divider(s);
s.addText("Mnemonic: \"Really Tired During Cold Beers\"", {
x:0.4, y:1.15, w:9.2, h:0.45, fontSize:14, bold:true, color:C.gold,
});
const mnem = [["R","oots"],["T","runks"],["D","ivisions"],["C","ords"],["B","ranches"]];
mnem.forEach(([letter, rest], i) => {
const xx = 0.5 + i * 1.85;
s.addShape(pres.ShapeType.roundRect, { x:xx, y:1.7, w:1.6, h:1.2,
fill:{color:C.teal}, line:{color:C.cyan}, rectRadius:0.1 });
s.addText(letter, { x:xx, y:1.72, w:1.6, h:0.6, fontSize:28, bold:true, color:C.gold, align:"center" });
s.addText(rest, { x:xx, y:2.28, w:1.6, h:0.55, fontSize:12, color:C.white, align:"center" });
});
s.addShape(pres.ShapeType.line, { x:0.4, y:3.05, w:9.2, h:0, line:{color:C.teal, width:0.8} });
bullets(s, [
"C5–C6 → superior trunk → musculocutaneous, axillary, suprascapular, radial (partial), median (partial)",
"C7 → middle trunk → radial (partial), median (partial)",
"C8–T1 → inferior trunk → ulnar, medial cutaneous nerves, median (partial)",
"Cords are named by their relation to the axillary artery (lateral, medial, posterior)",
], 0.4, 3.15, 9.2, 2.2, { fontSize:11.5 });
}
// ═══════════════════════════════════════════════════════════════════
// PART 2 — SUBARACHNOID SPACE
// ═══════════════════════════════════════════════════════════════════
// ── SLIDE 17 · Part 2 Section Header ─────────────────────────────────────────
{
const s = pres.addSlide();
addBg(s, C.dark);
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:0.12, h:5.625, fill:{color:C.green}, line:{color:C.green} });
s.addShape(pres.ShapeType.rect, { x:0.12, y:0, w:0.06, h:5.625, fill:{color:C.teal}, line:{color:C.teal} });
s.addText("PART 2", { x:0.5, y:1.3, w:9, h:0.6, fontSize:18, color:C.green, bold:true });
s.addText("Subarachnoid Space", { x:0.5, y:1.95, w:9, h:1.1, fontSize:38, bold:true, color:C.white });
s.addShape(pres.ShapeType.line, { x:0.5, y:3.15, w:4, h:0, line:{color:C.green, width:2} });
s.addText("Meninges · CSF · Cisterns · Clinical Significance", {
x:0.5, y:3.3, w:9, h:0.5, fontSize:14, color:C.light, italic:true,
});
}
// ── SLIDE 18 · Spinal Meninges Overview ──────────────────────────────────────
{
const s = pres.addSlide();
addBg(s); topStripe(s, C.green);
sectionLabel(s, "Subarachnoid Space · Meninges", C.green);
slideTitle(s, "The Three Meningeal Layers");
divider(s);
if (img(9)) s.addImage({ data: img(9), x:5.5, y:1.1, w:4.2, h:4.1 });
const layers = [
{ name:"Dura Mater", subtitle:"(Hard mother)", color:C.gold,
text:"Outermost, thickest layer (270–280 μm). ~80 collagen lamellae. Extends from foramen magnum → S2. Encloses nerve roots to intervertebral foramina." },
{ name:"Arachnoid Mater", subtitle:"(Spider mother)", color:C.cyan,
text:"Two portions: compact inner layer + trabecular web extending to pia. Low permeability — main barrier to drug diffusion. Forms arachnoid granulations at dural sinuses." },
{ name:"Pia Mater", subtitle:"(Soft mother)", color:C.green,
text:"Innermost, vascular membrane adherent to cord surface. Forms denticulate ligaments (anchor cord centrally). Has fenestrations along lumbar roots." },
];
layers.forEach((l, i) => {
const yy = 1.2 + i * 1.35;
s.addText(l.name + " " + l.subtitle, { x:0.4, y:yy, w:4.9, h:0.38, fontSize:12, bold:true, color:l.color });
s.addText(l.text, { x:0.4, y:yy+0.38, w:4.9, h:0.88, fontSize:10.5, color:C.white });
});
}
// ── SLIDE 19 · Subarachnoid Space – Anatomy ──────────────────────────────────
{
const s = pres.addSlide();
addBg(s); topStripe(s, C.green);
sectionLabel(s, "Subarachnoid Space · Anatomy", C.green);
slideTitle(s, "The Subarachnoid Space");
divider(s);
if (img(6)) s.addImage({ data: img(6), x:5.4, y:1.1, w:4.3, h:4.1 });
bullets(s, [
"Located between arachnoid mater and pia mater",
"Filled with cerebrospinal fluid (CSF)",
"Continuous with cranial subarachnoid space at foramen magnum",
"Extends to the lower border of vertebra S2",
"Spinal cord ends at ~L1–L2 disc level",
"Inferior to cord = cauda equina surrounded by CSF (the 'lumbar cistern')",
"Contains arachnoid trabeculae connecting the two membranes",
"Large blood vessels suspended by arachnoid strands",
"Denticulate ligaments (pia) anchor the cord in the midline",
], 0.4, 1.15, 4.8, 4.2, { fontSize:11.5 });
}
// ── SLIDE 20 · CSF Production & Circulation ──────────────────────────────────
{
const s = pres.addSlide();
addBg(s); topStripe(s, C.green);
sectionLabel(s, "Subarachnoid Space · CSF", C.green);
slideTitle(s, "Cerebrospinal Fluid — Production & Circulation");
divider(s);
card(s, 0.3, 1.2, 4.6, 2.0, "Composition", C.green,
"99% water; protein, glucose, electrolytes, neurotransmitters\nVolume: 100–160 mL in adults", 11);
card(s, 5.2, 1.2, 4.5, 2.0, "Production", C.cyan,
"Primarily by choroid plexus (lateral, 3rd, 4th ventricles)\nAlso produced at parenchymal capillaries of brain & cord\n~450–500 mL/day produced; pressure ~10–15 cmH₂O", 11);
card(s, 0.3, 3.3, 4.6, 2.0, "Circulation", C.gold,
"Lateral ventricles → foramen of Monro → 3rd ventricle → aqueduct of Sylvius → 4th ventricle → foramina of Luschka & Magendie → subarachnoid space", 11);
card(s, 5.2, 3.3, 4.5, 2.0, "Absorption", C.green,
"Via arachnoid granulations → dural venous sinuses (superior sagittal sinus)\nAlso lymphatic system & parenchymal capillaries\nCardiac oscillations drive local CSF mixing", 11);
}
// ── SLIDE 21 · Subarachnoid Cisterns ─────────────────────────────────────────
{
const s = pres.addSlide();
addBg(s); topStripe(s, C.green);
sectionLabel(s, "Subarachnoid Space · Cisterns", C.green);
slideTitle(s, "Major Subarachnoid Cisterns");
divider(s);
const cisterns = [
{ name:"Lumbar Cistern", loc:"L1–S2", content:"Cauda equina, filum terminale, CSF — site of LP" },
{ name:"Cisterna Magna (Cerebellomedullary)", loc:"Between cerebellum & medulla", content:"Largest cistern; connects 4th ventricle via foramen of Magendie" },
{ name:"Pontine Cistern", loc:"Anterior pons", content:"Contains basilar artery; continuous with interpeduncular cistern" },
{ name:"Interpeduncular Cistern", loc:"Between cerebral peduncles", content:"Contains CN III, posterior communicating arteries" },
{ name:"Chiasmatic Cistern", loc:"Around optic chiasm", content:"Contains ICA, ophthalmic arteries, CN II" },
{ name:"Ambient (Perimesencephalic) Cistern", loc:"Around midbrain", content:"CN IV, posterior cerebral & superior cerebellar arteries" },
];
cisterns.forEach((c, i) => {
const col = i < 3 ? 0 : 1;
const row = i % 3;
const xx = col === 0 ? 0.3 : 5.1;
const yy = 1.15 + row * 1.4;
s.addShape(pres.ShapeType.roundRect, { x:xx, y:yy, w:4.6, h:1.3,
fill:{color:C.slate}, line:{color:C.green, width:0.5}, rectRadius:0.08 });
s.addText(c.name, { x:xx+0.1, y:yy+0.05, w:4.4, h:0.3, fontSize:11, bold:true, color:C.green });
s.addText("Location: " + c.loc, { x:xx+0.1, y:yy+0.37, w:4.4, h:0.25, fontSize:9.5, color:C.cyan });
s.addText(c.content, { x:xx+0.1, y:yy+0.62, w:4.4, h:0.6, fontSize:9.5, color:C.white });
});
}
// ── SLIDE 22 · Lumbar Puncture ────────────────────────────────────────────────
{
const s = pres.addSlide();
addBg(s); topStripe(s, C.gold);
sectionLabel(s, "Subarachnoid Space · Clinical", C.gold);
slideTitle(s, "Lumbar Puncture — Anatomy Basis");
divider(s, 1.05);
if (img(11)) s.addImage({ data: img(11), x:5.6, y:1.1, w:4.1, h:3.8 });
bullets(s, [
"Cord ends at L1–L2 → LP safe at L3–L4 or L4–L5",
"Largest subarachnoid space below T12 = lumbar cistern",
"Cauda equina floats in CSF — pushed aside by needle",
"Needle trajectory (L3–L4): skin → subcutaneous fat → supraspinous lig → interspinous lig → ligamentum flavum → epidural space → dura mater → arachnoid → subarachnoid space",
"Normal CSF: clear, protein 15–45 mg/dL, glucose >60% serum, 0–5 WBC/μL",
"Opening pressure: 60–200 mmH₂O (patient lateral decubitus)",
], 0.4, 1.15, 5.0, 4.2, { fontSize:11 });
}
// ── SLIDE 23 · Subarachnoid Hemorrhage ───────────────────────────────────────
{
const s = pres.addSlide();
addBg(s); topStripe(s, C.gold);
sectionLabel(s, "Subarachnoid Space · Pathology", C.gold);
slideTitle(s, "Subarachnoid Hemorrhage (SAH)");
divider(s, 1.05);
card(s, 0.3, 1.2, 4.5, 1.9, "Pathology", C.gold,
"Blood enters subarachnoid space (between arachnoid & pia). Most common cause: ruptured berry (saccular) aneurysm at Circle of Willis (~85%).", 11);
card(s, 5.0, 1.2, 4.7, 1.9, "Classic Presentation", C.cyan,
"'Thunderclap' headache — worst of life. May have neck stiffness, photophobia, reduced consciousness, CN III palsy (posterior communicating artery aneurysm).", 11);
card(s, 0.3, 3.2, 4.5, 2.0, "CSF Findings", C.green,
"Blood in subarachnoid space → xanthochromia on LP (yellow discoloration 2–12 hours after bleed). > 100,000 RBC/μL in early SAH.", 11);
card(s, 5.0, 3.2, 4.7, 2.0, "Complications", C.gold,
"Hydrocephalus (arachnoid granulation blockage by blood)\nVasospasm (72 hrs–14 days post-bleed)\nRe-bleeding, cerebral edema, SIADH, neurogenic pulmonary edema.", 11);
}
// ═══════════════════════════════════════════════════════════════════
// PART 3 — EPIDURAL SPACE
// ═══════════════════════════════════════════════════════════════════
// ── SLIDE 24 · Part 3 Section Header ─────────────────────────────────────────
{
const s = pres.addSlide();
addBg(s, C.dark);
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:0.12, h:5.625, fill:{color:C.gold}, line:{color:C.gold} });
s.addShape(pres.ShapeType.rect, { x:0.12, y:0, w:0.06, h:5.625, fill:{color:C.teal}, line:{color:C.teal} });
s.addText("PART 3", { x:0.5, y:1.3, w:9, h:0.6, fontSize:18, color:C.gold, bold:true });
s.addText("Epidural Space", { x:0.5, y:1.95, w:9, h:1.1, fontSize:40, bold:true, color:C.white });
s.addShape(pres.ShapeType.line, { x:0.5, y:3.15, w:4, h:0, line:{color:C.gold, width:2} });
s.addText("Anatomy · Boundaries · Contents · Clinical Applications", {
x:0.5, y:3.3, w:9, h:0.5, fontSize:14, color:C.light, italic:true,
});
}
// ── SLIDE 25 · Epidural Space – Definition & Extent ──────────────────────────
{
const s = pres.addSlide();
addBg(s); topStripe(s, C.gold);
sectionLabel(s, "Epidural Space · Overview", C.gold);
slideTitle(s, "Definition & Extent");
divider(s);
s.addText([
{ text:"The epidural space lies within the vertebral canal, ", options:{color:C.white} },
{ text:"outside the dural sac", options:{bold:true, color:C.gold} },
{ text:". It extends from the foramen magnum to the end of the dural sac at S2.", options:{color:C.white} },
], { x:0.4, y:1.15, w:9.2, h:0.7, fontSize:13 });
card(s, 0.3, 1.95, 3.0, 3.3, "Anterior Border", C.gold,
"Posterior longitudinal ligament covering vertebral bodies & intervertebral discs", 11);
card(s, 3.45, 1.95, 3.0, 3.3, "Posterior Border", C.cyan,
"Laminae, ligamentum flavum (key landmark for epidural access)", 11);
card(s, 6.6, 1.95, 3.1, 3.3, "Lateral Border", C.green,
"Pedicles; communicates with paravertebral space via intervertebral foramina", 11);
s.addText("The epidural space is not a continuous open space — it consists of discontinuous, fat-filled pockets (Hogan 1991)", {
x:0.3, y:5.1, w:9.4, h:0.38, fontSize:8.5, color:C.gold, italic:true, align:"center",
});
}
// ── SLIDE 26 · Epidural Space Contents ───────────────────────────────────────
{
const s = pres.addSlide();
addBg(s); topStripe(s, C.gold);
sectionLabel(s, "Epidural Space · Contents", C.gold);
slideTitle(s, "Contents of the Epidural Space");
divider(s);
if (img(8)) s.addImage({ data: img(8), x:5.4, y:1.1, w:4.3, h:4.1 });
const contents = [
{ name:"Epidural Fat", desc:"Fills gaps between dura and walls; absent at cervical level; most abundant posteriorly in lumbar region (discrete metameric collections). Plays a role in drug pharmacokinetics.", color:C.gold },
{ name:"Epidural Veins (Batson's Plexus)", desc:"Located mostly in the anterior epidural space. Valveless — pressure transmitted from intra-abdominal sources. Engorged in pregnancy → increased risk of venous cannulation.", color:C.cyan },
{ name:"Spinal Nerve Roots", desc:"Pass through the epidural space before exiting via intervertebral foramina. Covered by dural sleeve.", color:C.green },
{ name:"Arteries", desc:"Segmental arteries reach cord and meninges via intervertebral foramina. Artery of Adamkiewicz (T9–L2) supplies lower cord — vulnerable during aortic surgery.", color:C.gold },
];
contents.forEach((c, i) => {
const yy = 1.15 + i * 1.05;
s.addText(c.name + ":", { x:0.4, y:yy, w:5.0, h:0.28, fontSize:11, bold:true, color:c.color });
s.addText(c.desc, { x:0.4, y:yy+0.28, w:4.9, h:0.68, fontSize:10, color:C.white });
});
}
// ── SLIDE 27 · Ligamentum Flavum ─────────────────────────────────────────────
{
const s = pres.addSlide();
addBg(s); topStripe(s, C.gold);
sectionLabel(s, "Epidural Space · Ligamentum Flavum", C.gold);
slideTitle(s, "Ligamentum Flavum — Key Landmark");
divider(s);
if (img(7)) s.addImage({ data: img(7), x:5.5, y:1.1, w:4.2, h:3.5 });
s.addText("3D reconstruction of human lumbar ligamentum flavum showing characteristic gap at midline (arrow)\n— Barash Clinical Anesthesia 9e", {
x:5.5, y:4.65, w:4.2, h:0.7, fontSize:7.5, color:C.light, italic:true,
});
bullets(s, [
"Bilateral yellow elastic ligament connecting adjacent laminae",
"Thickness: 2–3 mm (lumbar), ~1 mm (cervical)",
"Contains 80% elastic fibers (gives 'loss of resistance' feel)",
"Midline gap present between two halves — often used for epidural needle entry",
"Hypertrophy causes spinal stenosis (>4 mm in lumbar)",
"Posterior border of epidural space in the lumbar region",
"Resistance to needle passage identifies it; 'pop' or LOR signals entry into epidural space",
], 0.4, 1.15, 5.0, 4.2, { fontSize:11.5 });
}
// ── SLIDE 28 · Epidural Space – Regional Differences ─────────────────────────
{
const s = pres.addSlide();
addBg(s); topStripe(s, C.gold);
sectionLabel(s, "Epidural Space · Regional Variations", C.gold);
slideTitle(s, "Regional Differences Along the Spine");
divider(s);
const regions = [
{ region:"Cervical", fat:"None (no epidural fat)", depth:"~2 mm from ligamentum flavum", notes:"Dura closely apposed to canal; caution with needle depth", color:C.cyan },
{ region:"Thoracic", fat:"Small amount; posterior > anterior", depth:"~3–5 mm", notes:"Narrow space; angled needle approach required (steep angle)", color:C.green },
{ region:"Lumbar", fat:"Most abundant; discrete fat pads L1–L5", depth:"~4–6 mm (5–8 in obese)", notes:"Widest, safest access; most common site for epidural procedures", color:C.gold },
{ region:"Sacral (Caudal)", fat:"Fat + sacral venous plexus", depth:"Via sacral hiatus / sacrococcygeal ligament", notes:"Caudal epidural block; high volume needed for lumbar spread", color:C.cyan },
];
regions.forEach((r, i) => {
const yy = 1.15 + i * 1.05;
s.addShape(pres.ShapeType.roundRect, { x:0.3, y:yy, w:9.4, h:0.95,
fill:{color:C.slate}, line:{color:r.color, width:0.7}, rectRadius:0.07 });
s.addText(r.region, { x:0.45, y:yy+0.05, w:1.3, h:0.82, fontSize:12, bold:true, color:r.color, valign:"middle", align:"center" });
s.addShape(pres.ShapeType.line, { x:1.85, y:yy+0.15, w:0, h:0.62, line:{color:r.color, width:0.5} });
s.addText("Fat: " + r.fat, { x:1.95, y:yy+0.04, w:3.5, h:0.28, fontSize:9.5, color:C.light });
s.addText("Depth: " + r.depth, { x:1.95, y:yy+0.33, w:3.5, h:0.25, fontSize:9.5, color:C.white });
s.addText(r.notes, { x:5.5, y:yy+0.12, w:4.0, h:0.68, fontSize:10, color:C.white });
});
}
// ── SLIDE 29 · Epidural Anesthesia – Mechanism ───────────────────────────────
{
const s = pres.addSlide();
addBg(s); topStripe(s, C.gold);
sectionLabel(s, "Epidural Space · Anesthesia", C.gold);
slideTitle(s, "Epidural Anesthesia — Mechanism & Drug Spread");
divider(s);
if (img(10)) s.addImage({ data: img(10), x:5.5, y:1.1, w:4.2, h:3.6 });
s.addText("MRI showing intramedullary (green), intradural (yellow), and epidural (purple) spaces with ligamentum flavum (black arrow) and posterior longitudinal ligament (curved arrow)", {
x:5.5, y:4.7, w:4.2, h:0.7, fontSize:7, color:C.light, italic:true,
});
bullets(s, [
"Local anesthetic injected into epidural space",
"Primary targets: spinal nerve roots (dorsal root ganglia) in epidural space — most accessible",
"Drug spreads in CSF after crossing dura into subarachnoid space",
"Differential block: sympathetic (B fibers) > pain (C, Aδ) > touch (Aβ) > motor (Aα)",
"Cold level 1–2 segments higher than pinprick; pinprick 1–2 higher than touch",
"Drug uptake influenced by: lipid solubility, protein binding, vascularity, epidural fat volume",
"Pregnancy: engorged veins → less epidural volume → lower doses needed",
], 0.4, 1.15, 5.0, 4.2, { fontSize:11 });
}
// ── SLIDE 30 · Comparison & Summary ──────────────────────────────────────────
{
const s = pres.addSlide();
addBg(s); topStripe(s, C.cyan);
sectionLabel(s, "Summary & Comparison", C.cyan);
slideTitle(s, "Subarachnoid vs. Epidural Space — Key Comparison");
divider(s);
const hdrs = ["Feature", "Subarachnoid Space", "Epidural Space"];
const rows = [
["Location", "Between arachnoid & pia mater", "Outside dural sac, inside vertebral canal"],
["Contents", "CSF, arachnoid trabeculae, blood vessels, nerve roots", "Fat, veins (Batson's), nerve roots, arteries"],
["Extent", "Foramen magnum → S2; cord ends L1–L2", "Foramen magnum → S2 (sacral hiatus)"],
["Drug target", "Directly bathes spinal cord & roots (rapid onset)", "Nerve roots at intervertebral foramina (slower onset)"],
["Volume needed", "Spinal: small (2–4 mL)", "Epidural: large (15–25 mL per segment)"],
["Clinical use", "Spinal anesthesia, LP, intrathecal drug delivery", "Epidural anesthesia, pain management, obstetrics"],
["Complication", "PDPH if dura punctured, meningitis", "Venous cannulation, patchy block, catheter misplacement"],
];
const colWidths = [2.0, 3.7, 3.7];
const colX = [0.2, 2.25, 6.0];
const headerY = 1.15;
hdrs.forEach((h, i) => {
const hc = i === 0 ? C.teal : i === 1 ? C.green : C.gold;
s.addShape(pres.ShapeType.rect, { x:colX[i], y:headerY, w:colWidths[i], h:0.42,
fill:{color:hc}, line:{color:hc} });
s.addText(h, { x:colX[i]+0.05, y:headerY, w:colWidths[i]-0.1, h:0.42,
fontSize:10.5, bold:true, color:C.white, valign:"middle", align:"center" });
});
rows.forEach((row, ri) => {
const ry = headerY + 0.45 + ri * 0.56;
const bg = ri % 2 === 0 ? C.slate : C.navy;
row.forEach((cell, ci) => {
s.addShape(pres.ShapeType.rect, { x:colX[ci], y:ry, w:colWidths[ci], h:0.54,
fill:{color:bg}, line:{color:C.teal, width:0.3} });
s.addText(cell, { x:colX[ci]+0.05, y:ry+0.03, w:colWidths[ci]-0.1, h:0.48,
fontSize: ci === 0 ? 10 : 9.5, color: ci === 0 ? C.cyan : C.white,
bold: ci === 0, valign:"middle" });
});
});
}
// ── Write file ────────────────────────────────────────────────────────────────
pres.writeFile({ fileName: "/home/daytona/workspace/neuro-anatomy-ppt/Neuroanatomy_BrachialPlexus_SA_Epidural.pptx" })
.then(() => console.log("✅ Presentation saved successfully."))
.catch(e => { console.error("❌ Save error:", e); process.exit(1); });
cd /home/daytona/workspace/neuro-anatomy-ppt && node build.js 2>&1
Make a ppt of 30 slides describing anatomy of brachial plexus ,sub arachnoid and epidural spaces from standard textbooks
brachial plexus anatomy roots trunks divisions cords terminal branches diagram
epidural space subarachnoid space spinal meninges anatomy cross section CSF
spinal cord meninges dura arachnoid pia mater layers anatomy diagram
epidural anesthesia needle technique loss of resistance ligamentum flavum lumbar spine
~/neuro-anatomy-ppt/build2.js
const pptxgen = require("pptxgenjs");
const { execSync } = require("child_process");
// ─── Palette (deep navy + teal + amber) ─────────────────────────────────────
const C = {
bg: "0B1826", // main background
bgAlt: "0F2235", // alternate background
card: "142840", // card surface
teal: "1A9BAF", // primary accent (brachial plexus)
green: "0FA87A", // part 2 accent (subarachnoid)
amber: "E8A020", // part 3 accent (epidural)
blue: "3B82F6", // highlight
white: "EDF2F7", // primary text
light: "94A3B8", // secondary text
gold: "F59E0B", // key term callout
dark: "06101C", // deeper bg
red: "EF4444", // warning / clinical
};
const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Anatomy: Brachial Plexus, Subarachnoid & Epidural Spaces";
pres.author = "Medical Education — Gray's / Barash / Miller's";
// ─── Image URLs ──────────────────────────────────────────────────────────────
const URLS = {
bp_harrison: "https://cdn.orris.care/cdss_images/HARRISON_1763034978151_dcfec64f-4894-46b6-94bd-ba17fd6a8314.png",
bp_mri: "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_84a54033dbc8ecad8a5f6bc966a49c2e9eb53fa9ac67b2835fa0f5cdb82d3651.jpg",
bp_cadaver: "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_9f3cd2a0d555feaacb1f044acbbe90c4b722b0701b0110de7144f429a6b62ab8.jpg",
bp_intraop: "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_c0328c094b76c0073d233e4f4b37beccc4d92b7714130f340ad3fcf349089c58.jpg",
bp_grays_a: "https://cdn.orris.care/cdss_images/42e3982ca738d0e6877cc67f524d1fbfcf9d635fdfed6e0372f6519623416ef7.png",
bp_grays_b: "https://cdn.orris.care/cdss_images/62ef9714975a8ea1509371bbecc736c66c2fdd7a02df72fb8141a511a0a08af2.png",
bp_branches: "https://cdn.orris.care/cdss_images/2d1e124866bcf5ef44fe04881ee3568b0ed579f0f211fa7c979d830bd74fde4d.png",
bp_shoulder: "https://cdn.orris.care/cdss_images/bb18d779e57345e0dd2901a2fd6bbb8b1bc3bcd30abe5f3078866a28d6f15b00.png",
bp_table: "https://cdn.orris.care/cdss_images/c5f44e067af5791f418a2b4d80520cff61cad8ac4451516a3710567331c665c6.png",
sa_grays: "https://cdn.orris.care/cdss_images/e86b3797e2a43e429bc205e0a4cbf82668c184881aa0cab5cb2ca86c02d919f7.png",
sa_layers: "https://cdn.orris.care/cdss_images/309b849fc80e813a21de7330fe1b70450e2dc5eb3e084f54f5c6ee18cd844761.png",
sa_mri: "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_b976a62c5ccd49c7f0defd8b3e72c0bb630789f5ab6efb976849718fbb984eaf.jpg",
sa_meninges: "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_c4396d50a486d522e5a4959694c9ffdc8b37e71d753adec2f54d6a7e5c4bf845.jpg",
sa_dissect: "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_ecb3692d5be1d6e0c95ca8e068a0c08b5d612cb9a5868bc03759e843729e33be.jpg",
ep_lf: "https://cdn.orris.care/cdss_images/21d0b52019b115ac8896f2660fc2a3b660dfb86f0be44e9e547bbc63d08ba535.png",
ep_compart: "https://cdn.orris.care/cdss_images/16b155e915375ee13a1ca44ba4cb83217d78f06b48fc25dbd4d561bf2cde5743.png",
ep_ultrasound:"https://cdn.orris.care/cdss_images/pmc_clinical_VQA_8e56a8965234443d2f400986b3e2547c69cf8487e5a7f3f6c47e4015a346c273.jpg",
ep_technique: "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_2bd59a067ce3ad65aa4eebd9e61216370dff8daf9214b178bf42da8fc0518d43.jpg",
ep_mri_comp: "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_5c51ddca992a7c215b82e323d943996ea8c0fc7730aae9cd34f7858c141cc928.jpg",
};
console.log("Fetching images...");
const urlArr = Object.values(URLS);
let imgMap = {};
try {
const raw = execSync(
`node /home/daytona/skills/shared/scripts/fetch_images.js ${urlArr.map(u=>`"${u}"`).join(" ")}`,
{ maxBuffer: 60 * 1024 * 1024, timeout: 90000 }
).toString();
const results = JSON.parse(raw);
Object.keys(URLS).forEach((k,i) => {
imgMap[k] = (results[i] && !results[i].error) ? results[i].base64 : null;
});
} catch(e) {
console.error("Image fetch failed:", e.message.slice(0,200));
Object.keys(URLS).forEach(k => { imgMap[k] = null; });
}
// ─── Helpers ─────────────────────────────────────────────────────────────────
function bg(s, color) {
s.addShape(pres.ShapeType.rect, { x:0,y:0,w:10,h:5.625, fill:{color:color||C.bg}, line:{color:color||C.bg} });
}
function stripe(s, color, h) {
s.addShape(pres.ShapeType.rect, { x:0,y:0,w:10,h:h||0.07, fill:{color:color||C.teal}, line:{color:color||C.teal} });
}
function sideBar(s, color) {
s.addShape(pres.ShapeType.rect, { x:0,y:0,w:0.18,h:5.625, fill:{color:color||C.teal}, line:{color:color||C.teal} });
}
function tag(s, text, color) {
s.addText(text.toUpperCase(), { x:0.38, y:0.1, w:9.2, h:0.28, fontSize:7.5, bold:true, color:color||C.teal, charSpacing:3, align:"left" });
}
function title(s, text, y, color, size) {
s.addText(text, { x:0.38, y:y!==undefined?y:0.42, w:9.3, h:0.65, fontSize:size||22, bold:true, color:color||C.white, align:"left" });
}
function rule(s, y, color) {
s.addShape(pres.ShapeType.line, { x:0.38,y:y||1.08,w:9.24,h:0, line:{color:color||C.teal,width:0.8} });
}
function card(s, x, y, w, h, head, hColor, body, fs) {
s.addShape(pres.ShapeType.roundRect, { x,y,w,h, fill:{color:C.card}, line:{color:hColor||C.teal,width:0.6}, rectRadius:0.07 });
s.addText(head, { x:x+0.12,y:y+0.07,w:w-0.24,h:0.32, fontSize:10.5,bold:true,color:hColor||C.teal });
s.addText(body, { x:x+0.12,y:y+0.42,w:w-0.24,h:h-0.52, fontSize:fs||10,color:C.white,valign:"top" });
}
function bullets(s, items, x, y, w, h, color, fs) {
const arr = items.map((t,i) => ({
text: t,
options: { bullet:{ type:"bullet" }, breakLine: i<items.length-1, color:color||C.white, fontSize:fs||12 }
}));
s.addText(arr, { x,y,w,h, valign:"top" });
}
function addImg(s, key, x, y, w, h) {
if (imgMap[key]) s.addImage({ data:imgMap[key], x,y,w,h });
}
function caption(s, text, x, y, w) {
s.addText(text, { x,y,w:w||9,h:0.35, fontSize:7,color:C.light,italic:true,align:"center" });
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 1 — Title
// ══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide(); bg(s, C.dark);
// left accent bars
s.addShape(pres.ShapeType.rect, {x:0,y:0,w:0.14,h:5.625,fill:{color:C.teal},line:{color:C.teal}});
s.addShape(pres.ShapeType.rect, {x:0.14,y:0,w:0.06,h:5.625,fill:{color:C.green},line:{color:C.green}});
s.addShape(pres.ShapeType.rect, {x:0.20,y:0,w:0.06,h:5.625,fill:{color:C.amber},line:{color:C.amber}});
// top label
s.addText("NEUROANATOMY SERIES", {x:0.5,y:0.3,w:9,h:0.32,fontSize:8,bold:true,color:C.teal,charSpacing:4});
// main title
s.addText("Anatomy of the", {x:0.5,y:0.78,w:9,h:0.55,fontSize:18,color:C.light});
s.addText("Brachial Plexus", {x:0.5,y:1.28,w:9,h:0.75,fontSize:38,bold:true,color:C.teal});
s.addText("Subarachnoid & Epidural Spaces", {x:0.5,y:1.98,w:9,h:0.75,fontSize:28,bold:true,color:C.white});
s.addShape(pres.ShapeType.line, {x:0.5,y:2.9,w:6,h:0,line:{color:C.amber,width:2}});
s.addText("A comprehensive anatomical review from standard medical textbooks", {x:0.5,y:3.05,w:9,h:0.45,fontSize:13,color:C.light,italic:true});
// sources
s.addText("Sources: Gray's Anatomy for Students (4e) · Barash Clinical Anesthesia (9e) · Miller's Anesthesia (10e) · Harrison's Principles (22e)", {x:0.5,y:5.1,w:9,h:0.35,fontSize:8,color:C.light});
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 2 — Contents
// ══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide(); bg(s); stripe(s, C.teal);
tag(s,"Contents"); title(s,"Presentation Outline"); rule(s);
const parts = [
{label:"Part 1 · Brachial Plexus", slides:"Slides 3–16", color:C.teal,
items:["Formation: roots, trunks, divisions, cords","Branch nomenclature & motor/sensory distribution","Relations to vessels","Clinical correlations & injuries"]},
{label:"Part 2 · Subarachnoid Space",slides:"Slides 17–23", color:C.green,
items:["Meningeal layers (dura, arachnoid, pia)","CSF: production, circulation, absorption","Subarachnoid cisterns","Lumbar puncture anatomy & pathology (SAH)"]},
{label:"Part 3 · Epidural Space", slides:"Slides 24–30", color:C.amber,
items:["Boundaries, extent, regional variations","Contents: fat, veins, arteries, nerve roots","Ligamentum flavum anatomy","Epidural anesthesia mechanisms & drug spread"]},
];
parts.forEach((p,i)=>{
const yy = 1.2 + i*1.4;
s.addShape(pres.ShapeType.roundRect,{x:0.3,y:yy,w:9.4,h:1.25,fill:{color:C.card},line:{color:p.color,width:1.0},rectRadius:0.08});
s.addShape(pres.ShapeType.rect,{x:0.3,y:yy,w:2.8,h:1.25,fill:{color:p.color},line:{color:p.color},rectRadius:0});
s.addText(p.label,{x:0.38,y:yy+0.15,w:2.6,h:0.5,fontSize:12,bold:true,color:C.dark,align:"center"});
s.addText(p.slides,{x:0.38,y:yy+0.68,w:2.6,h:0.35,fontSize:10,color:C.dark,align:"center"});
const bText = p.items.map((t,j)=>({text:t,options:{bullet:{type:"bullet"},breakLine:j<p.items.length-1,fontSize:10,color:C.white}}));
s.addText(bText,{x:3.2,y:yy+0.08,w:6.3,h:1.1,valign:"top"});
});
}
// ══════════════════════════════════════════════════════════════════════════════
// PART 1 — BRACHIAL PLEXUS
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 3 — What is the Brachial Plexus?
{
const s = pres.addSlide(); bg(s); stripe(s, C.teal);
tag(s,"Brachial Plexus · Introduction",C.teal); title(s,"Definition & Overview"); rule(s);
// quote block
s.addShape(pres.ShapeType.roundRect,{x:0.3,y:1.15,w:5.4,h:1.3,fill:{color:C.card},line:{color:C.teal,width:0.6},rectRadius:0.08});
s.addText(""The brachial plexus is a somatic nerve plexus formed by the anterior rami of C5 to C8, and most of the anterior ramus of T1. The plexus originates in the neck, passes laterally and inferiorly over rib I, and enters the axilla."",
{x:0.45,y:1.22,w:5.15,h:1.14,fontSize:11,color:C.white,italic:true,valign:"middle"});
s.addText("— Gray's Anatomy for Students, 4e",{x:0.45,y:2.42,w:5.15,h:0.25,fontSize:8,color:C.light,italic:true});
bullets(s,[
"Somatic nerve plexus of the upper limb",
"Components (medial→lateral): Roots → Trunks → Divisions → Cords → Branches",
"All major upper limb nerves arise from its cords",
"Proximal plexus: posterior to subclavian artery (neck)",
"Distal plexus: surrounds axillary artery (axilla)",
"Receives postganglionic sympathetic fibers via gray rami communicantes",
],0.3,2.75,5.5,2.75,C.white,11);
addImg(s,"bp_grays_a",5.85,1.15,3.85,4.25);
caption(s,"Fig. 7.52A – Brachial plexus: major components in neck & axilla (Gray's Anatomy for Students)",5.85,5.3,3.85);
}
// SLIDE 4 — Mnemonic & Structure Overview
{
const s = pres.addSlide(); bg(s); stripe(s,C.teal);
tag(s,"Brachial Plexus · Structure",C.teal); title(s,"Structural Components — Mnemonic"); rule(s);
s.addText("Mnemonic: \"Really Tired During Cold Beers\"",{x:0.38,y:1.15,w:9.2,h:0.42,fontSize:14,bold:true,color:C.gold});
const parts = [
{l:"R",w:"oots", sub:"Ant. rami C5–T1",color:C.teal},
{l:"T",w:"runks", sub:"Superior, Middle, Inferior",color:C.green},
{l:"D",w:"ivisions",sub:"Anterior & Posterior (×3)",color:C.blue},
{l:"C",w:"ords", sub:"Lateral, Posterior, Medial",color:C.amber},
{l:"B",w:"ranches", sub:"5 terminal nerves",color:C.red},
];
parts.forEach((p,i)=>{
const xx = 0.3 + i*1.9;
s.addShape(pres.ShapeType.roundRect,{x:xx,y:1.7,w:1.75,h:2.4,fill:{color:C.card},line:{color:p.color,width:1.2},rectRadius:0.1});
s.addShape(pres.ShapeType.rect,{x:xx,y:1.7,w:1.75,h:0.72,fill:{color:p.color},line:{color:p.color}});
s.addText(p.l,{x:xx,y:1.72,w:0.55,h:0.68,fontSize:30,bold:true,color:C.dark,align:"center",valign:"middle"});
s.addText(p.w,{x:xx+0.5,y:1.72,w:1.2,h:0.68,fontSize:16,bold:true,color:C.dark,align:"left",valign:"middle"});
s.addText(p.sub,{x:xx+0.07,y:2.5,w:1.6,h:1.45,fontSize:9.5,color:C.white,align:"center",valign:"middle"});
});
addImg(s,"bp_grays_b",0.3,4.2,9.4,1.25);
caption(s,"Fig. 7.52B – Schematic parts of the brachial plexus (Gray's Anatomy for Students)",0.3,5.35,9.4);
}
// SLIDE 5 — Harrison's Full Plexus Diagram
{
const s = pres.addSlide(); bg(s); stripe(s,C.teal);
tag(s,"Brachial Plexus · Schematic",C.teal); title(s,"Full Plexus Diagram — Roots to Terminal Branches"); rule(s);
addImg(s,"bp_harrison",0.3,1.15,9.4,4.1);
caption(s,"Brachial plexus: roots (C5–T1) → trunks → divisions → cords → peripheral nerves. Yellow = anterior divisions; orange = posterior divisions. (Harrison's Principles of Internal Medicine, 22e)",0.3,5.2,9.4);
}
// SLIDE 6 — Roots (C5–T1)
{
const s = pres.addSlide(); bg(s); stripe(s,C.teal);
tag(s,"Brachial Plexus · Roots",C.teal); title(s,"The Roots (C5–T1)"); rule(s);
s.addText("The roots of the brachial plexus are the anterior rami of C5–C8 and most of T1. They enter the posterior triangle by passing between the anterior and middle scalene muscles, lying posterior to the subclavian artery. Roots receive gray rami communicantes (postganglionic sympathetic fibers) close to their origin. — Gray's Anatomy for Students",
{x:0.38,y:1.15,w:9.2,h:0.72,fontSize:10.5,color:C.light,italic:true});
const roots=[
{r:"C5",f:"Contributes to superior trunk; gives phrenic nerve branch (C3–C5); dorsal scapular nerve (C5)"},
{r:"C6",f:"Joins C5 → superior trunk; long thoracic nerve (C5–C7)"},
{r:"C7",f:"Sole contributor to middle trunk; long thoracic nerve (C5–C7)"},
{r:"C8",f:"Joins T1 → inferior trunk; lies on rib I, posterior to subclavian artery"},
{r:"T1",f:"Majority joins C8; small contribution to intercostal nerve; sometimes contribution to phrenic nerve"},
];
roots.forEach((r,i)=>{
const yy=1.95+i*0.67;
s.addShape(pres.ShapeType.roundRect,{x:0.3,y:yy,w:0.7,h:0.57,fill:{color:C.teal},line:{color:C.teal},rectRadius:0.06});
s.addText(r.r,{x:0.3,y:yy,w:0.7,h:0.57,fontSize:14,bold:true,color:C.dark,align:"center",valign:"middle"});
s.addText(r.f,{x:1.1,y:yy+0.08,w:8.6,h:0.44,fontSize:11,color:C.white});
});
s.addShape(pres.ShapeType.roundRect,{x:0.3,y:5.18,w:9.4,h:0.35,fill:{color:C.card},line:{color:C.amber,width:0.5},rectRadius:0.05});
s.addText("Clinical: The roots lie between the scalene muscles — scalene blocks target this level; cervical rib may compress C8–T1 (thoracic outlet syndrome).",{x:0.42,y:5.21,w:9.1,h:0.27,fontSize:8.5,color:C.amber});
}
// SLIDE 7 — Trunks
{
const s = pres.addSlide(); bg(s); stripe(s,C.teal);
tag(s,"Brachial Plexus · Trunks",C.teal); title(s,"The Three Trunks"); rule(s);
s.addText("The three trunks originate from the roots, pass laterally over rib I, and enter the axilla. — Gray's Anatomy for Students",
{x:0.38,y:1.15,w:9.2,h:0.38,fontSize:10.5,color:C.light,italic:true});
const trunks=[
{n:"Superior Trunk",roots:"C5 + C6",pos:"Superior to middle trunk; anterior to posterior scalene",
note:"Branches: suprascapular nerve, nerve to subclavius (only trunk branches)",color:C.teal},
{n:"Middle Trunk", roots:"C7 alone",pos:"Continuation of C7 root; between superior & inferior",
note:"No direct branches from the middle trunk",color:C.green},
{n:"Inferior Trunk",roots:"C8 + T1",pos:"Lies on rib I, posterior to subclavian artery",
note:"Most medial and posterior; vulnerable to compression (Klumpke's)",color:C.amber},
];
trunks.forEach((t,i)=>{
const xx=0.3+i*3.23;
s.addShape(pres.ShapeType.roundRect,{x:xx,y:1.6,w:3.1,h:3.75,fill:{color:C.card},line:{color:t.color,width:1.2},rectRadius:0.1});
s.addShape(pres.ShapeType.rect,{x:xx,y:1.6,w:3.1,h:0.55,fill:{color:t.color},line:{color:t.color}});
s.addText(t.n,{x:xx+0.07,y:1.62,w:2.96,h:0.51,fontSize:12.5,bold:true,color:C.dark,align:"center",valign:"middle"});
s.addText("Roots: "+t.roots,{x:xx+0.1,y:2.22,w:2.9,h:0.35,fontSize:11,bold:true,color:t.color});
s.addText("Position:",{x:xx+0.1,y:2.59,w:2.9,h:0.22,fontSize:9.5,bold:true,color:C.light});
s.addText(t.pos,{x:xx+0.1,y:2.8,w:2.9,h:0.5,fontSize:9.5,color:C.white});
s.addText("Branch/Note:",{x:xx+0.1,y:3.38,w:2.9,h:0.22,fontSize:9.5,bold:true,color:C.light});
s.addText(t.note,{x:xx+0.1,y:3.6,w:2.9,h:0.65,fontSize:9.5,color:C.white});
});
}
// SLIDE 8 — Divisions
{
const s = pres.addSlide(); bg(s); stripe(s,C.teal);
tag(s,"Brachial Plexus · Divisions",C.teal); title(s,"Anterior & Posterior Divisions"); rule(s);
s.addText("Each of the three trunks divides into an anterior and posterior division as the plexus passes beneath the clavicle. No peripheral nerves originate directly from the divisions. — Gray's Anatomy for Students",
{x:0.38,y:1.15,w:9.2,h:0.52,fontSize:10.5,color:C.light,italic:true});
// two columns
s.addShape(pres.ShapeType.roundRect,{x:0.3,y:1.75,w:4.6,h:3.55,fill:{color:C.card},line:{color:C.teal,width:1},rectRadius:0.1});
s.addShape(pres.ShapeType.rect,{x:0.3,y:1.75,w:4.6,h:0.52,fill:{color:C.teal},line:{color:C.teal}});
s.addText("ANTERIOR DIVISIONS (×3)",{x:0.38,y:1.77,w:4.44,h:0.48,fontSize:12,bold:true,color:C.dark,align:"center",valign:"middle"});
bullets(s,[
"Anterior divisions of SUPERIOR & MIDDLE trunks → join to form LATERAL CORD",
"Anterior division of INFERIOR trunk → continues as MEDIAL CORD",
"Collectively supply flexor compartments of arm & forearm",
"Carry C5–C7 (lateral) and C8–T1 (medial) contributions",
],0.4,2.35,4.35,2.85,C.white,11);
s.addShape(pres.ShapeType.roundRect,{x:5.1,y:1.75,w:4.6,h:3.55,fill:{color:C.card},line:{color:C.amber,width:1},rectRadius:0.1});
s.addShape(pres.ShapeType.rect,{x:5.1,y:1.75,w:4.6,h:0.52,fill:{color:C.amber},line:{color:C.amber}});
s.addText("POSTERIOR DIVISIONS (×3)",{x:5.18,y:1.77,w:4.44,h:0.48,fontSize:12,bold:true,color:C.dark,align:"center",valign:"middle"});
bullets(s,[
"ALL three posterior divisions combine → form POSTERIOR CORD",
"Carry contributions from ALL roots (C5–T1)",
"Supply extensor compartments of arm & forearm",
"Give rise to the large radial nerve and axillary nerve",
],5.2,2.35,4.35,2.85,C.white,11);
}
// SLIDE 9 — Cords
{
const s = pres.addSlide(); bg(s); stripe(s,C.teal);
tag(s,"Brachial Plexus · Cords",C.teal); title(s,"The Three Cords — Named by Relation to Axillary Artery"); rule(s);
const cords=[
{n:"Lateral Cord",comp:"C5–C7",rel:"LATERAL to axillary artery (2nd part)",
origin:"Ant. divisions of superior + middle trunks",
branches:"Lateral pectoral n. · Musculocutaneous n. · Lateral root of median n.",color:C.teal},
{n:"Posterior Cord",comp:"C5–T1",rel:"POSTERIOR to axillary artery (2nd part)",
origin:"ALL three posterior divisions",
branches:"Upper subscapular · Thoracodorsal · Lower subscapular · Axillary n. · Radial n.",color:C.amber},
{n:"Medial Cord",comp:"C8–T1",rel:"MEDIAL to axillary artery (2nd part)",
origin:"Ant. division of inferior trunk",
branches:"Medial pectoral n. · Med. cut. of arm · Med. cut. of forearm · Medial root of median n. · Ulnar n.",color:C.green},
];
cords.forEach((c,i)=>{
const xx=0.3+i*3.22;
s.addShape(pres.ShapeType.roundRect,{x:xx,y:1.15,w:3.06,h:4.25,fill:{color:C.card},line:{color:c.color,width:1.3},rectRadius:0.1});
s.addShape(pres.ShapeType.rect,{x:xx,y:1.15,w:3.06,h:0.55,fill:{color:c.color},line:{color:c.color}});
s.addText(c.n,{x:xx+0.06,y:1.17,w:2.94,h:0.51,fontSize:12,bold:true,color:C.dark,align:"center",valign:"middle"});
[["Components",c.comp],["Relation",c.rel],["Origin",c.origin],["Branches",c.branches]].forEach(([lbl,val],li)=>{
const ly=1.77+li*0.93;
s.addText(lbl+":",{x:xx+0.1,y:ly,w:2.86,h:0.26,fontSize:9,bold:true,color:c.color});
s.addText(val,{x:xx+0.1,y:ly+0.26,w:2.86,h:0.62,fontSize:9.5,color:C.white});
});
});
}
// SLIDE 10 — MRI & Cadaver Views
{
const s = pres.addSlide(); bg(s); stripe(s,C.teal);
tag(s,"Brachial Plexus · Imaging",C.teal); title(s,"Cadaveric Anatomy & MRI Correlation"); rule(s);
addImg(s,"bp_cadaver",0.3,1.15,9.4,4.1);
caption(s,"(A) Cadaveric dissection exposing C5–T1 roots. (B) Schematic: roots→trunks→divisions→cords→terminal branches. (C) Scalene triangle with SCA & IJV. (D) Infraclavicular region showing terminal branches. (PMC clinical VQA)",0.3,5.2,9.4);
}
// SLIDE 11 — Branches: Roots & Trunks
{
const s = pres.addSlide(); bg(s); stripe(s,C.teal);
tag(s,"Brachial Plexus · Branches (Roots & Trunks)",C.teal); title(s,"Branches from Roots & Trunks"); rule(s);
addImg(s,"bp_shoulder",5.4,1.15,4.3,3.4);
caption(s,"Branches from roots and trunks to scapular muscles (Gray's Anatomy for Students)",5.4,4.5,4.3);
bullets(s,[
"FROM ROOTS:",
"Dorsal scapular nerve (C5): passes posteriorly, often piercing middle scalene → innervates rhomboid major & minor",
"Long thoracic nerve (C5–C7): passes vertically down neck → axillary inlet → medial wall of axilla → serratus anterior",
"Phrenic nerve (partial C5): continues to diaphragm",
"FROM SUPERIOR TRUNK only:",
"Suprascapular nerve (C5–C6): through suprascapular notch → supraspinatus & infraspinatus + sensory to shoulder joint",
"Nerve to subclavius (C5–C6): short nerve to subclavius muscle",
],0.3,1.15,4.95,4.2,C.white,10.5);
}
// SLIDE 12 — Branches: Lateral & Medial Cord
{
const s = pres.addSlide(); bg(s); stripe(s,C.teal);
tag(s,"Brachial Plexus · Lateral & Medial Cord Branches",C.teal); title(s,"Branches: Lateral & Medial Cords"); rule(s);
s.addText("LATERAL CORD (C5–C7)",{x:0.3,y:1.15,w:4.55,h:0.38,fontSize:12,bold:true,color:C.teal});
bullets(s,[
"Lateral pectoral nerve → pectoralis major (and minor via communication)",
"Musculocutaneous nerve (C5–C7) → coracobrachialis, biceps brachii, brachialis; terminates as lateral cutaneous nerve of forearm",
"Lateral root of median nerve → combines with medial root",
],0.3,1.58,4.55,2.5,C.white,10.5);
s.addText("MEDIAL CORD (C8–T1)",{x:5.1,y:1.15,w:4.6,h:0.38,fontSize:12,bold:true,color:C.green});
bullets(s,[
"Medial pectoral nerve (C8–T1) → pectoralis minor & major",
"Medial cutaneous nerve of arm (C8–T1) → medial 1/3 of arm",
"Medial cutaneous nerve of forearm (C8–T1) → medial forearm",
"Medial root of median nerve → joins lateral root",
"Ulnar nerve (C7–T1) → medial forearm muscles, most intrinsic hand muscles, medial 1½ fingers",
],5.1,1.58,4.6,2.5,C.white,10.5);
s.addShape(pres.ShapeType.roundRect,{x:0.3,y:4.2,w:9.4,h:1.2,fill:{color:C.card},line:{color:C.gold,width:0.5},rectRadius:0.08});
s.addText("The MEDIAN NERVE (C5–T1) = lateral root (lateral cord) + medial root (medial cord). The musculocutaneous nerve, lateral root, median nerve, medial root and ulnar nerve form a characteristic 'M' over the 3rd part of the axillary artery — used to identify plexus components in axilla. — Gray's Anatomy for Students",
{x:0.42,y:4.27,w:9.1,h:1.05,fontSize:10,color:C.white,italic:true,valign:"middle"});
}
// SLIDE 13 — Branches: Posterior Cord
{
const s = pres.addSlide(); bg(s); stripe(s,C.teal);
tag(s,"Brachial Plexus · Posterior Cord Branches",C.teal); title(s,"Branches: Posterior Cord (C5–T1)"); rule(s);
const branches=[
{n:"Upper Subscapular Nerve (C5–C6)",fn:"Subscapularis (upper portion)",color:C.teal},
{n:"Thoracodorsal Nerve (C6–C8)",fn:"Latissimus dorsi — longest branch of posterior cord",color:C.green},
{n:"Lower Subscapular Nerve (C5–C6)",fn:"Subscapularis (lower portion) + teres major",color:C.blue},
{n:"Axillary Nerve (C5–C6)",fn:"Deltoid, teres minor; sensory to lateral arm (badge area). Accompanies posterior circumflex humeral artery.",color:C.amber},
{n:"Radial Nerve (C5–T1)",fn:"LARGEST branch. All posterior compartment muscles (triceps, brachioradialis, extensors of forearm). Sensory to posterior arm, forearm & hand.",color:C.red},
];
branches.forEach((b,i)=>{
const yy=1.15+i*0.85;
s.addShape(pres.ShapeType.roundRect,{x:0.3,y:yy,w:9.4,h:0.77,fill:{color:C.card},line:{color:b.color,width:0.7},rectRadius:0.07});
s.addShape(pres.ShapeType.rect,{x:0.3,y:yy,w:3.4,h:0.77,fill:{color:b.color},line:{color:b.color}});
s.addText(b.n,{x:0.38,y:yy+0.08,w:3.24,h:0.62,fontSize:10,bold:true,color:C.dark,align:"left",valign:"middle"});
s.addText("→ "+b.fn,{x:3.8,y:yy+0.12,w:5.8,h:0.55,fontSize:10.5,color:C.white,valign:"middle"});
});
}
// SLIDE 14 — The Five Terminal Nerves
{
const s = pres.addSlide(); bg(s); stripe(s,C.teal);
tag(s,"Brachial Plexus · Terminal Nerves",C.teal); title(s,"The Five Terminal Nerves of the Brachial Plexus"); rule(s);
addImg(s,"bp_branches",5.5,1.15,4.2,3.8);
caption(s,"Branches of brachial plexus and relation to axillary artery (Gray's Anatomy for Students)",5.5,4.9,4.2);
const nerves=[
{n:"Musculocutaneous",seg:"C5–C7",m:"Coracobrachialis, biceps brachii, brachialis",s:"Lateral forearm (terminal)",color:C.teal},
{n:"Median",seg:"C5–T1",m:"Forearm flexors (pronator teres, FDS, FDP-lat, FPL), thenar mm., lat. 2 lumbricals",s:"Palmar lateral 3½ fingers",color:C.green},
{n:"Ulnar",seg:"C7–T1",m:"FCU, FDP-med, hypothenar mm., most intrinsic hand mm., med. 2 lumbricals",s:"Medial 1½ fingers (hand)",color:C.blue},
{n:"Radial",seg:"C5–T1",m:"All posterior arm & forearm extensors (triceps, anconeus, supinator, ext. digitorum etc.)",s:"Post. arm, post. forearm, dorsal hand",color:C.amber},
{n:"Axillary",seg:"C5–C6",m:"Deltoid, teres minor",s:"Lateral arm (badge area)",color:C.red},
];
const hdr=["Nerve","Seg.","Motor","Sensory"];
const cx=[0.3,1.65,2.4,4.0]; const cw=[1.3,0.7,1.6,1.4];
hdr.forEach((h,i)=>{
s.addShape(pres.ShapeType.rect,{x:cx[i],y:1.15,w:cw[i],h:0.38,fill:{color:C.teal},line:{color:C.teal}});
s.addText(h,{x:cx[i]+0.04,y:1.15,w:cw[i]-0.08,h:0.38,fontSize:10,bold:true,color:C.dark,valign:"middle"});
});
nerves.forEach((n,ri)=>{
const ry=1.56+ri*0.7;
const bg2=ri%2===0?C.card:C.bgAlt;
[n.n,n.seg,n.m,n.s].forEach((cell,ci)=>{
s.addShape(pres.ShapeType.rect,{x:cx[ci],y:ry,w:cw[ci],h:0.68,fill:{color:bg2},line:{color:n.color,width:ci===0?0.8:0.2}});
s.addText(cell,{x:cx[ci]+0.04,y:ry+0.04,w:cw[ci]-0.08,h:0.6,fontSize:ci===0?9.5:8.5,color:ci===0?n.color:C.white,bold:ci===0,valign:"middle"});
});
});
}
// SLIDE 15 — Clinical Correlations
{
const s = pres.addSlide(); bg(s); stripe(s,C.red);
tag(s,"Brachial Plexus · Clinical Correlations",C.red); title(s,"Clinical Syndromes & Injuries",0.42,C.red); rule(s,1.08,C.red);
const clins=[
{n:"Erb–Duchenne Palsy (Upper Trunk C5–C6)",desc:"Excessive separation of head & shoulder → stretches C5–C6. 'Waiter's tip': arm adducted, medially rotated, forearm pronated, wrist flexed. Loss of deltoid, supraspinatus, biceps, brachioradialis, supinator.",color:C.amber},
{n:"Klumpke's Palsy (Lower Trunk C8–T1)",desc:"Excessive abduction of arm (baby during breech delivery, grabbing overhead). Weak intrinsic hand muscles (claw hand). If T1 avulsed: ipsilateral Horner's syndrome (ptosis, miosis, anhidrosis).",color:C.red},
{n:"Long Thoracic Nerve Palsy",desc:"Injury during axillary node dissection, mastectomy, or repeated microtrauma. Serratus anterior paralysis → medial border scapula protrudes = 'winged scapula'. Inability to raise arm above 90°.",color:C.teal},
{n:"Thoracic Outlet Syndrome",desc:"Compression of brachial plexus (+ subclavian vessels) between anterior/middle scalene or under clavicle/rib. Medial cord (C8–T1) most affected. Pain/paraesthesiae in medial forearm & hand.",color:C.green},
{n:"Axillary Nerve (Surgical Neck Fracture/Dislocation)",desc:"Deltoid paralysis → inability to abduct 15–90°. Sensory loss over badge area (lateral arm). Often accompanies anterior shoulder dislocation.",color:C.blue},
];
clins.forEach((c,i)=>{
const yy=1.15+i*0.87;
s.addShape(pres.ShapeType.roundRect,{x:0.3,y:yy,w:9.4,h:0.79,fill:{color:C.card},line:{color:c.color,width:0.7},rectRadius:0.07});
s.addText(c.n,{x:0.42,y:yy+0.04,w:9.1,h:0.28,fontSize:10.5,bold:true,color:c.color});
s.addText(c.desc,{x:0.42,y:yy+0.34,w:9.1,h:0.4,fontSize:9.5,color:C.white});
});
}
// SLIDE 16 — Brachial Plexus Summary Table
{
const s = pres.addSlide(); bg(s); stripe(s,C.teal);
tag(s,"Brachial Plexus · Summary",C.teal); title(s,"Complete Branch Summary (Gray's Anatomy for Students)"); rule(s);
addImg(s,"bp_table",0.3,1.15,9.4,4.15);
caption(s,"Table of brachial plexus branches: origins, spinal segments, motor and sensory functions (Gray's Anatomy for Students, 4e, pp. 864–865)",0.3,5.25,9.4);
}
// ══════════════════════════════════════════════════════════════════════════════
// PART 2 — SUBARACHNOID SPACE
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 17 — Part 2 Title Card
{
const s = pres.addSlide(); bg(s,C.dark);
s.addShape(pres.ShapeType.rect,{x:0,y:0,w:0.14,h:5.625,fill:{color:C.green},line:{color:C.green}});
s.addShape(pres.ShapeType.rect,{x:0.14,y:0,w:0.06,h:5.625,fill:{color:C.teal},line:{color:C.teal}});
s.addText("PART 2",{x:0.5,y:1.2,w:9,h:0.6,fontSize:18,color:C.green,bold:true});
s.addText("Subarachnoid Space",{x:0.5,y:1.78,w:9,h:1.0,fontSize:38,bold:true,color:C.white});
s.addShape(pres.ShapeType.line,{x:0.5,y:2.95,w:4.5,h:0,line:{color:C.green,width:2}});
s.addText("Anatomy · Meninges · CSF · Cisterns · Clinical Applications",{x:0.5,y:3.1,w:9,h:0.52,fontSize:14,color:C.light,italic:true});
s.addText("Sources: Gray's Anatomy for Students · Barash Clinical Anesthesia 9e · Bradley & Daroff's Neurology",{x:0.5,y:5.1,w:9,h:0.35,fontSize:8,color:C.light});
}
// SLIDE 18 — Meninges Overview
{
const s = pres.addSlide(); bg(s); stripe(s,C.green);
tag(s,"Subarachnoid Space · Meninges",C.green); title(s,"The Three Meningeal Layers"); rule(s,1.08,C.green);
addImg(s,"sa_dissect",5.5,1.15,4.2,3.5);
caption(s,"Microsurgical dissection: dura mater (1, thicker opaque) and arachnoid mater (2, thinner, translucent) over spinal cord",5.5,4.6,4.2);
const layers=[
{n:"Dura Mater",sub:"(Hard mother) — outermost",color:C.amber,
text:"270–280 μm thick; ~80 collagen lamellae; extends foramen magnum → S2; fuses with filum terminale. Potential subdural space between dura and arachnoid. Extends with nerve roots, fuses with epineurium at intervertebral foramina. — Barash 9e"},
{n:"Arachnoid Mater",sub:"(Spider mother) — middle",color:C.teal,
text:"Two parts: compact laminar layer (inner surface of dura) + trabecular web to pia. The arachnoid — NOT dura — is the primary barrier to drug diffusion. Forms arachnoid granulations for CSF reabsorption into dural venous sinuses. — Barash 9e"},
{n:"Pia Mater",sub:"(Soft mother) — innermost",color:C.green,
text:"Flat overlapping cells, highly vascular, adherent to cord surface. Enters anterior median fissure. Forms denticulate ligaments anchoring cord in subarachnoid space. Fenestrations along lumbar nerve roots. — Barash 9e"},
];
layers.forEach((l,i)=>{
const yy=1.15+i*1.38;
s.addText(l.n+" "+l.sub,{x:0.3,y:yy,w:5.0,h:0.32,fontSize:11.5,bold:true,color:l.color});
s.addText(l.text,{x:0.3,y:yy+0.34,w:5.0,h:0.96,fontSize:9.5,color:C.white});
});
}
// SLIDE 19 — Subarachnoid Space Anatomy
{
const s = pres.addSlide(); bg(s); stripe(s,C.green);
tag(s,"Subarachnoid Space · Anatomy",C.green); title(s,"Anatomy of the Subarachnoid Space"); rule(s,1.08,C.green);
addImg(s,"sa_grays",5.5,1.15,4.2,3.8);
caption(s,"Fig. 2.59: Subarachnoid space, meninges, denticulate ligaments & spinal cord (Gray's Anatomy for Students)",5.5,4.9,4.2);
bullets(s,[
"Located between arachnoid mater and pia mater",
"Contains CSF + arachnoid trabeculae + suspended blood vessels",
"Continuous at foramen magnum with cranial subarachnoid space",
"Extends inferiorly to lower border of S2",
"Spinal cord terminates at L1–L2 disc level (conus medullaris)",
"Below cord = cauda equina + filum terminale float in CSF",
"Lumbar cistern (L1–S2): largest sub-space — safe for LP",
"Denticulate ligaments (pia): suspend cord in center of subarachnoid space",
"Large blood vessels suspended by arachnoid strands with perivascular coating",
"Vertebral plexus of veins in extradural (fatty) space around dural sac",
],0.3,1.15,5.0,4.2,C.white,11);
}
// SLIDE 20 — Meninges Layers Diagram
{
const s = pres.addSlide(); bg(s); stripe(s,C.green);
tag(s,"Subarachnoid Space · Meningeal Architecture",C.green); title(s,"Meningeal Architecture — Diagram"); rule(s,1.08,C.green);
addImg(s,"sa_meninges",0.3,1.15,9.4,4.1);
caption(s,"3D structure of meninges: (a) dura mater, (b) arachnoid mater, (c) subarachnoid space with trabeculae, (d) pia mater, (e) brain parenchyma. Scale bar 100 µm. (PMC clinical VQA)",0.3,5.2,9.4);
}
// SLIDE 21 — CSF Physiology
{
const s = pres.addSlide(); bg(s); stripe(s,C.green);
tag(s,"Subarachnoid Space · CSF",C.green); title(s,"Cerebrospinal Fluid — Physiology"); rule(s,1.08,C.green);
card(s,0.3,1.15,4.55,2.05,"Composition (Barash 9e)",C.green,
"99% water; minor: protein (15–45 mg/dL), glucose (>60% serum), electrolytes, neurotransmitters\nVolume: 100–160 mL total (adult)\nOpening pressure: 6–20 cmH₂O (lateral decubitus)\nProduction: ~450–500 mL/day",10.5);
card(s,5.05,1.15,4.65,2.05,"Production Sites (Barash 9e)",C.teal,
"Primarily choroid plexus (lateral, 3rd, 4th ventricles)\nAlso parenchymal capillaries of brain & spinal cord\nLymphatic system absorbs a considerable amount\nCSF and interstitial fluid are closely related",10.5);
card(s,0.3,3.3,4.55,2.0,"Circulation",C.amber,
"Lateral ventricles → foramen of Monro → 3rd ventricle → Aqueduct of Sylvius → 4th ventricle → Foramina of Luschka & Magendie → Subarachnoid space\nCardiac oscillations drive local mixing (not unidirectional)",10.5);
card(s,5.05,3.3,4.65,2.0,"Absorption (Barash 9e)",C.green,
"Arachnoid granulations project into superior sagittal sinus → absorbed into venous blood\nAlso: lymphatic system, parenchymal capillaries\nNot solely via arachnoid granulations as previously thought",10.5);
}
// SLIDE 22 — MRI of Subarachnoid Space
{
const s = pres.addSlide(); bg(s); stripe(s,C.green);
tag(s,"Subarachnoid Space · Imaging",C.green); title(s,"MRI Anatomy of the Spinal Subarachnoid Space"); rule(s,1.08,C.green);
addImg(s,"sa_mri",0.3,1.15,9.4,4.1);
caption(s,"T2-MRI: sagittal (a–c) and axial (d–f) views showing subarachnoid space (SSS), spinal cord (SC), dura (DM), epidural space (ES), anterior spinal artery (ASA), and cauda equina nerve roots (NR). Lumbar cauda equina well shown in (f). (PMC clinical VQA)",0.3,5.2,9.4);
}
// SLIDE 23 — Clinical: Lumbar Puncture & SAH
{
const s = pres.addSlide(); bg(s); stripe(s,C.red);
tag(s,"Subarachnoid Space · Clinical",C.red); title(s,"Clinical Significance — LP & Subarachnoid Haemorrhage",0.42,C.red); rule(s,1.08,C.red);
card(s,0.3,1.15,4.55,2.35,"Lumbar Puncture Anatomy",C.green,
"Cord ends L1–L2 → needle safe at L3–L4 or L4–L5\nNeedle path: skin → supraspinous lig → interspinous lig → lig. flavum → epidural space → dura → arachnoid → subarachnoid space\nNormal CSF: clear, protein 15–45 mg/dL, glucose >60% serum, WBC 0–5/μL, opening pressure 60–200 mmH₂O",10.5);
card(s,5.05,1.15,4.65,2.35,"Subarachnoid Haemorrhage (SAH)",C.red,
"Blood enters subarachnoid space\n85% from ruptured berry aneurysm at Circle of Willis\n'Thunderclap' headache — worst of life\nCSF: xanthochromia (yellow, 2–12 h post-bleed), >100,000 RBC/μL\nComplications: hydrocephalus (blocked arachnoid granulations), vasospasm (day 4–14)",10.5);
card(s,0.3,3.6,4.55,1.85,"Spinal Anaesthesia (Intrathecal)",C.teal,
"Local anaesthetic injected directly into subarachnoid space\nDiffuses through pia → Virchow–Robin spaces → dorsal root ganglia\nSmall dose (2–4 mL) blocks nerve roots rapidly\nDifferential block: sympathetic > pain > touch > motor",10.5);
card(s,5.05,3.6,4.65,1.85,"Post-Dural Puncture Headache (PDPH)",C.amber,
"CSF leak through dural hole → reduced CSF pressure\nBilateral, positional (upright worse, supine better)\nRisk reduced by smaller/pencil-point needles\nTreatment: conservative → epidural blood patch",10.5);
}
// ══════════════════════════════════════════════════════════════════════════════
// PART 3 — EPIDURAL SPACE
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 24 — Part 3 Title Card
{
const s = pres.addSlide(); bg(s,C.dark);
s.addShape(pres.ShapeType.rect,{x:0,y:0,w:0.14,h:5.625,fill:{color:C.amber},line:{color:C.amber}});
s.addShape(pres.ShapeType.rect,{x:0.14,y:0,w:0.06,h:5.625,fill:{color:C.teal},line:{color:C.teal}});
s.addText("PART 3",{x:0.5,y:1.2,w:9,h:0.6,fontSize:18,color:C.amber,bold:true});
s.addText("Epidural Space",{x:0.5,y:1.78,w:9,h:1.0,fontSize:40,bold:true,color:C.white});
s.addShape(pres.ShapeType.line,{x:0.5,y:2.95,w:4.5,h:0,line:{color:C.amber,width:2}});
s.addText("Anatomy · Boundaries · Contents · Anesthetic Applications",{x:0.5,y:3.1,w:9,h:0.52,fontSize:14,color:C.light,italic:true});
s.addText("Sources: Barash Clinical Anesthesia 9e · Miller's Anesthesia 10e · Gray's Anatomy for Students",{x:0.5,y:5.1,w:9,h:0.35,fontSize:8,color:C.light});
}
// SLIDE 25 — Definition & Boundaries
{
const s = pres.addSlide(); bg(s); stripe(s,C.amber);
tag(s,"Epidural Space · Definition",C.amber); title(s,"Definition, Extent & Boundaries"); rule(s,1.08,C.amber);
s.addText([
{text:""The epidural space lies within the vertebral canal but ",options:{color:C.white}},
{text:"outside the dural sac",options:{bold:true,color:C.amber}},
{text:". It extends from the foramen magnum to the end of the dural sac at S2. … The epidural space is often absent because the dura intermittently abuts the bony and ligamentous structures of the spine. The remainder consists of discontinuous, fat-filled pockets that open readily upon injection." — Barash Clinical Anesthesia, 9e",options:{color:C.white}},
],{x:0.3,y:1.15,w:9.4,h:0.85,fontSize:10.5,italic:true});
card(s,0.3,2.1,3.05,3.25,"Anterior Boundary",C.amber,
"Posterior longitudinal ligament (PLL)\nPosterior aspect of vertebral bodies\nIntervertebral discs",10.5);
card(s,3.47,2.1,3.06,3.25,"Posterior Boundary",C.teal,
"Laminae of vertebrae\nLigamentum flavum (KEY landmark)\nInterspinous ligaments\nSpinolaminar junction",10.5);
card(s,6.64,2.1,3.06,3.25,"Lateral / Other Limits",C.green,
"Pedicles laterally\nIntervertebral foramina (communicates with paravertebral space)\nForamen magnum (superior)\nS2 / sacrococcygeal lig (inferior)",10.5);
}
// SLIDE 26 — Contents of Epidural Space
{
const s = pres.addSlide(); bg(s); stripe(s,C.amber);
tag(s,"Epidural Space · Contents",C.amber); title(s,"Contents of the Epidural Space"); rule(s,1.08,C.amber);
addImg(s,"ep_compart",5.6,1.15,4.1,3.6);
caption(s,"Fig. 35-3: Discontinuous epidural space compartments (grey); intervening areas where dura abuts canal (Barash 9e)",5.6,4.7,4.1);
const contents=[
{n:"Epidural Fat",color:C.amber,
t:"Absent at cervical level. In lumbar: discrete, metameric fat pads (anterior & posterior aspects). Diminishes with age. Important in drug kinetics — larger fat volume = more drug sequestration. — Barash 9e"},
{n:"Epidural Veins (Batson's Plexus)",color:C.red,
t:"Located mostly in anterior epidural space. VALVELESS — transmit intra-abdominal pressure. Pregnancy: engorgement → more frequent venous cannulation + enhanced drug spread."},
{n:"Spinal Nerve Roots",color:C.green,
t:"Pass through epidural space before exiting intervertebral foramina. Covered by dural sleeve. Primary target for epidural local anaesthetics."},
{n:"Arteries (Segmental)",color:C.teal,
t:"Artery of Adamkiewicz (T9–L2 left): critical supply to lower spinal cord. Vulnerable during aortic surgery. Radiculomedullary arteries enter via foramina."},
];
contents.forEach((c,i)=>{
const yy=1.15+i*1.07;
s.addText(c.n+":",{x:0.3,y:yy,w:5.15,h:0.28,fontSize:11,bold:true,color:c.color});
s.addText(c.t,{x:0.3,y:yy+0.28,w:5.15,h:0.72,fontSize:9.5,color:C.white});
});
}
// SLIDE 27 — Ligamentum Flavum
{
const s = pres.addSlide(); bg(s); stripe(s,C.amber);
tag(s,"Epidural Space · Ligamentum Flavum",C.amber); title(s,"Ligamentum Flavum — Key Landmark for Epidural Access"); rule(s,1.08,C.amber);
addImg(s,"ep_lf",5.5,1.15,4.2,3.6);
caption(s,"3D reconstruction of lumbar ligamentum flavum — note gap (arrow) between bilateral halves at midline. Barash Clinical Anesthesia 9e",5.5,4.7,4.2);
bullets(s,[
"Bilateral yellow elastic ligament connecting adjacent laminae",
"80% elastic fibres → generates characteristic resistance to needle tip",
"Thickness: lumbar 3–5 mm, thoracic 2–3 mm, cervical ~1 mm",
"Gap (incomplete fusion) at midline between two halves — preferred needle entry point",
"Hypertrophy (>4 mm) contributes to lumbar spinal stenosis",
"Posterior boundary of the epidural space — passage through it signals epidural space entry",
"Loss-of-resistance (LOR) technique: resistance felt in ligamentum flavum → sudden loss = epidural space",
"Absent midline gap at thoracic level → paramedian approach often needed",
],0.3,1.15,5.0,4.2,C.white,11);
}
// SLIDE 28 — Regional Differences Along Spine
{
const s = pres.addSlide(); bg(s); stripe(s,C.amber);
tag(s,"Epidural Space · Regional Variations",C.amber); title(s,"Regional Differences Along the Vertebral Column"); rule(s,1.08,C.amber);
const regions=[
{r:"Cervical",fat:"None (no epidural fat)",depth:"2–3 mm from LF",lf:"Thin (~1 mm)",approach:"Midline possible; no LOR to air (pneumocephalus risk)",color:C.teal},
{r:"Thoracic",fat:"Small; posterior > anterior",depth:"3–5 mm",lf:"2–3 mm",approach:"Steep laminar angle → paramedian approach often required",color:C.green},
{r:"Lumbar",fat:"Abundant; discrete metameric pads",depth:"4–6 mm (up to 8 mm obese)",lf:"3–5 mm",approach:"Most accessible; midline preferred; LOR to saline/air",color:C.amber},
{r:"Sacral (Caudal)",fat:"Fat + sacral venous plexus",depth:"Via sacrococcygeal lig (sacral hiatus)",lf:"Sacrococcygeal membrane",approach:"Caudal block: high volume (15–20 mL) for lumbar spread",color:C.red},
];
regions.forEach((r,i)=>{
const yy=1.15+i*1.07;
s.addShape(pres.ShapeType.roundRect,{x:0.3,y:yy,w:9.4,h:0.97,fill:{color:C.card},line:{color:r.color,width:0.8},rectRadius:0.07});
s.addShape(pres.ShapeType.rect,{x:0.3,y:yy,w:1.3,h:0.97,fill:{color:r.color},line:{color:r.color}});
s.addText(r.r,{x:0.32,y:yy,w:1.26,h:0.97,fontSize:13,bold:true,color:C.dark,align:"center",valign:"middle"});
s.addShape(pres.ShapeType.line,{x:1.7,y:yy+0.12,w:0,h:0.72,line:{color:r.color,width:0.4}});
s.addText("Fat: "+r.fat,{x:1.82,y:yy+0.04,w:3.4,h:0.28,fontSize:9,color:C.light});
s.addText("Depth: "+r.depth+" | LF: "+r.lf,{x:1.82,y:yy+0.33,w:3.4,h:0.28,fontSize:9,color:C.white});
s.addText(r.approach,{x:5.32,y:yy+0.1,w:4.25,h:0.75,fontSize:9.5,color:C.white,valign:"middle"});
});
}
// SLIDE 29 — Epidural Anesthesia Mechanism
{
const s = pres.addSlide(); bg(s); stripe(s,C.amber);
tag(s,"Epidural Space · Anaesthesia Mechanism",C.amber); title(s,"Epidural Anaesthesia — Mechanism & Drug Spread"); rule(s,1.08,C.amber);
addImg(s,"ep_ultrasound",5.5,1.15,4.2,3.5);
caption(s,"Ultrasound L4–L5: ligamentum flavum/dura complex (hyperechoic band), spinal canal (anechoic CSF space), vertebral body. For epidural needle guidance. (PMC clinical VQA)",5.5,4.6,4.2);
bullets(s,[
"Primary targets: spinal nerve roots & dorsal root ganglia in epidural space (Barash 9e)",
"Nerves in subarachnoid space more accessible than extradural nerves",
"Differential block — order of onset (most → least sensitive):",
" → B fibres (sympathetic, 1–3 μm) → C fibres (pain, cold, 0.3–1 μm) → Aδ (pinprick, 1–4 μm) → Aβ (touch, 5–12 μm) → Aα (motor, 12–20 μm)",
"Cold level 1–2 dermatomes ABOVE pinprick; pinprick 1–2 above touch (differential block)",
"Recovery: motor first, then touch, pinprick, cold last",
"Pregnancy: engorged veins → less epidural volume → lower dose needed",
"Age: loss of epidural fat → altered dose requirements",
],0.3,1.15,5.0,4.2,C.white,11);
}
// SLIDE 30 — Comparison Summary Table
{
const s = pres.addSlide(); bg(s); stripe(s,C.teal);
tag(s,"Summary — Comparison",C.teal); title(s,"Subarachnoid vs. Epidural Space — Key Comparison"); rule(s);
const hdr=["Feature","Subarachnoid Space","Epidural Space"];
const rows=[
["Location","Between arachnoid mater & pia mater","Outside dural sac; inside vertebral canal"],
["Contents","CSF, trabeculae, blood vessels, nerve roots","Fat, veins, arteries, nerve roots (no CSF)"],
["Extent","Foramen magnum → S2 (cord ends L1–L2)","Foramen magnum → S2 (sacral hiatus)"],
["Pressure","6–20 cmH₂O (6 mmHg); pulsatile","Near atmospheric; no direct CSF pressure"],
["Drug volume","Spinal: 2–4 mL (direct cord bath)","Epidural: 15–25 mL (per segment)"],
["Onset","Rapid (2–5 min) — direct nerve root access","Slower (15–20 min) — diffusion across dura"],
["Clinical use","Spinal anaesthesia, LP, intrathecal therapy","Epidural anaesthesia, labour analgesia, pain Rx"],
["Key complication","PDPH, meningitis, total spinal","Venous cannulation, patchy block, epidural abscess"],
];
const cW=[2.05,3.65,3.65]; const cX=[0.3,2.38,6.06];
const hC=[C.teal,C.green,C.amber];
hdr.forEach((h,i)=>{
s.addShape(pres.ShapeType.rect,{x:cX[i],y:1.15,w:cW[i],h:0.4,fill:{color:hC[i]},line:{color:hC[i]}});
s.addText(h,{x:cX[i]+0.04,y:1.15,w:cW[i]-0.08,h:0.4,fontSize:10,bold:true,color:C.dark,valign:"middle",align:"center"});
});
rows.forEach((row,ri)=>{
const ry=1.57+ri*0.52;
const bgc=ri%2===0?C.card:C.bgAlt;
row.forEach((cell,ci)=>{
s.addShape(pres.ShapeType.rect,{x:cX[ci],y:ry,w:cW[ci],h:0.5,fill:{color:bgc},line:{color:hC[ci],width:0.2}});
s.addText(cell,{x:cX[ci]+0.05,y:ry+0.03,w:cW[ci]-0.1,h:0.44,fontSize:ci===0?9.5:9,color:ci===0?hC[0]:C.white,bold:ci===0,valign:"middle"});
});
});
s.addShape(pres.ShapeType.roundRect,{x:0.3,y:5.73,w:9.4,h:0.38,fill:{color:C.card},line:{color:C.gold,width:0.5},rectRadius:0.06});
// Note: intentionally keeping caption below the rows since they fit within slide height
}
// ── Write ─────────────────────────────────────────────────────────────────────
const outPath = "/home/daytona/workspace/neuro-anatomy-ppt/Neuroanatomy_BrachialPlexus_Subarachnoid_Epidural.pptx";
pres.writeFile({ fileName: outPath })
.then(()=> console.log("✅ Saved to: " + outPath))
.catch(e=>{ console.error("❌ Save error:", e); process.exit(1); });
Failed to create session: unauthorized: authentication failed: Bearer token is invalid
We encountered an error while processing your request. Please try again or reach out to us for help.