Spinal cord lesions class predestination i want 15 slides matter

Reading File
Finding Sources
Finding Sources
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Running Command

mkdir -p /home/daytona/workspace/spinal-cord-lesions && ls /home/daytona/workspa…

Writing File

~/spinal-cord-lesions/create_pptx.js

const pptxgen = require("pptxgenjs");

let pres = new pptxgen();
pres.layout = 'LAYOUT_16x9';
pres.title = 'Spinal Cord Lesions - Classification & Localization';
pres.author = 'Medical Education';

// ─── COLOR PALETTE ───────────────────────────────────────────────
// Deep navy dominant, teal accent, white text, gold highlight
const C = {
  navy:       "0B1F4B",
  navyMid:    "122660",
  teal:       "0F7E8A",
  tealLight:  "19A8B8",
  gold:       "E8A020",
  white:      "FFFFFF",
  offWhite:   "EFF4FB",
  lightGray:  "C8D6E8",
  red:        "C0392B",
  green:      "1A7A4A",
  orange:     "D4660A",
};

// ─── HELPER FUNCTIONS ────────────────────────────────────────────
function addSlideTitle(slide, title, subtitle) {
  // Dark background header bar
  slide.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 0, w: 10, h: 1.1,
    fill: { color: C.navy },
    line: { color: C.navy }
  });
  // Gold accent line
  slide.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 1.1, w: 10, h: 0.07,
    fill: { color: C.gold },
    line: { color: C.gold }
  });
  slide.addText(title, {
    x: 0.4, y: 0.05, w: 9.2, h: 0.95,
    fontSize: 24, bold: true, color: C.white,
    fontFace: "Calibri", valign: "middle", margin: 0
  });
  if (subtitle) {
    slide.addShape(pres.shapes.RECTANGLE, {
      x: 0, y: 5.25, w: 10, h: 0.375,
      fill: { color: C.teal },
      line: { color: C.teal }
    });
    slide.addText(subtitle, {
      x: 0.4, y: 5.25, w: 9.2, h: 0.375,
      fontSize: 10, color: C.white, italic: true,
      fontFace: "Calibri", valign: "middle", margin: 0
    });
  }
}

function addBullets(slide, items, x, y, w, h, fontSize=15) {
  const richText = items.map((item, i) => {
    if (typeof item === 'object') {
      return [
        { text: item.title, options: { bold: true, color: C.teal, breakLine: false } },
        { text: " " + item.body, options: { bold: false, color: "1A1A2E", breakLine: i < items.length - 1 } }
      ];
    }
    return [{ text: item, options: { bullet: { code: '25B6', color: C.gold }, color: "1A1A2E", breakLine: i < items.length - 1 } }];
  }).flat();

  slide.addText(richText, {
    x, y, w, h,
    fontSize, fontFace: "Calibri",
    bullet: false, valign: "top",
    paraSpaceAfter: 4
  });
}

// ═══════════════════════════════════════════════════════════════
// SLIDE 1 — TITLE SLIDE
// ═══════════════════════════════════════════════════════════════
{
  let sl = pres.addSlide();
  // Full dark background
  sl.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 0, w: 10, h: 5.625,
    fill: { color: C.navy }, line: { color: C.navy }
  });
  // Teal left accent bar
  sl.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 0, w: 0.18, h: 5.625,
    fill: { color: C.teal }, line: { color: C.teal }
  });
  // Gold horizontal divider
  sl.addShape(pres.shapes.RECTANGLE, {
    x: 0.35, y: 2.85, w: 9.3, h: 0.06,
    fill: { color: C.gold }, line: { color: C.gold }
  });
  sl.addText("SPINAL CORD LESIONS", {
    x: 0.35, y: 1.1, w: 9.3, h: 1.3,
    fontSize: 40, bold: true, color: C.white,
    fontFace: "Calibri", align: "center", valign: "middle",
    charSpacing: 3
  });
  sl.addText("Classification & Localization", {
    x: 0.35, y: 2.45, w: 9.3, h: 0.55,
    fontSize: 22, color: C.tealLight,
    fontFace: "Calibri", align: "center", valign: "middle"
  });
  sl.addText("Anatomy · Syndromes · Clinical Correlation", {
    x: 0.35, y: 2.95, w: 9.3, h: 0.55,
    fontSize: 14, color: C.lightGray, italic: true,
    fontFace: "Calibri", align: "center"
  });
  sl.addText("Bradley & Daroff's Neurology · Rosen's Emergency Medicine · Principles of Neural Science", {
    x: 0.35, y: 5.1, w: 9.3, h: 0.4,
    fontSize: 9, color: C.lightGray, italic: true,
    fontFace: "Calibri", align: "center"
  });
}

// ═══════════════════════════════════════════════════════════════
// SLIDE 2 — ANATOMY OF SPINAL CORD
// ═══════════════════════════════════════════════════════════════
{
  let sl = pres.addSlide();
  sl.background = { color: C.offWhite };
  addSlideTitle(sl, "Anatomy of the Spinal Cord", "Source: Bradley & Daroff's Neurology in Clinical Practice");

  // Left column - segments
  sl.addShape(pres.shapes.RECTANGLE, {
    x: 0.3, y: 1.25, w: 4.3, h: 3.85,
    fill: { color: C.white },
    shadow: { type: "outer", color: "000000", blur: 6, offset: 2, angle: 135, opacity: 0.1 }
  });
  sl.addText("Spinal Cord Segments", {
    x: 0.3, y: 1.25, w: 4.3, h: 0.42,
    fontSize: 13, bold: true, color: C.white,
    fontFace: "Calibri", align: "center", valign: "middle",
    fill: { color: C.teal }
  });
  const segments = [
    "8 Cervical (C1–C8): upper limbs, diaphragm (C3–C5)",
    "12 Thoracic (T1–T12): trunk muscles, intercostals",
    "5 Lumbar (L1–L5): lower limbs",
    "5 Sacral (S1–S5): bladder, bowel, sexual function",
    "1 Coccygeal (Co1)",
    "Total: 31 pairs of spinal nerves",
    "Cord ends at L1–L2 (conus medullaris)",
  ];
  sl.addText(segments.map((s, i) => ({
    text: s,
    options: { bullet: { code: '25CF', color: C.teal }, color: "1A1A2E", breakLine: i < segments.length - 1, fontSize: 12 }
  })).flat(), {
    x: 0.4, y: 1.72, w: 4.1, h: 3.3,
    fontFace: "Calibri", valign: "top", paraSpaceAfter: 3
  });

  // Right column - tracts
  sl.addShape(pres.shapes.RECTANGLE, {
    x: 4.9, y: 1.25, w: 4.8, h: 3.85,
    fill: { color: C.white },
    shadow: { type: "outer", color: "000000", blur: 6, offset: 2, angle: 135, opacity: 0.1 }
  });
  sl.addText("Key Tracts & Functions", {
    x: 4.9, y: 1.25, w: 4.8, h: 0.42,
    fontSize: 13, bold: true, color: C.white,
    fontFace: "Calibri", align: "center", valign: "middle",
    fill: { color: C.navy }
  });
  const tracts = [
    { title: "Corticospinal (lateral):", body: "voluntary motor — ipsilateral" },
    { title: "Dorsal Columns:", body: "vibration, proprioception, fine touch — ipsilateral" },
    { title: "Spinothalamic (lateral):", body: "pain & temperature — contralateral (crosses 1–2 levels above)" },
    { title: "Spinothalamic (anterior):", body: "crude touch — contralateral" },
    { title: "Autonomic fibers:", body: "bladder, bowel, sexual function" },
  ];
  let ty = 1.72;
  tracts.forEach(t => {
    sl.addText([
      { text: t.title + " ", options: { bold: true, color: C.teal } },
      { text: t.body, options: { color: "1A1A2E" } }
    ], { x: 5.0, y: ty, w: 4.6, h: 0.6, fontSize: 12, fontFace: "Calibri", valign: "top" });
    ty += 0.6;
  });
}

// ═══════════════════════════════════════════════════════════════
// SLIDE 3 — CLASSIFICATION OVERVIEW
// ═══════════════════════════════════════════════════════════════
{
  let sl = pres.addSlide();
  sl.background = { color: C.offWhite };
  addSlideTitle(sl, "Classification of Spinal Cord Lesions", "Rosen's Emergency Medicine — Table 92.1");

  // Two-column classification cards
  const categories = [
    { label: "By Completeness", color: C.navy, items: ["Complete (Transverse) — total loss below lesion", "Incomplete — partial preservation"] },
    { label: "By Location (Axial)", color: C.teal, items: ["Intramedullary — within cord parenchyma", "Extramedullary intradural", "Extradural (epidural)"] },
    { label: "By Longitudinal Level", color: C.gold, items: ["Cervical", "Thoracic", "Lumbar", "Sacral / Conus / Cauda equina"] },
    { label: "By Etiology", color: "7B3F9E", items: ["Traumatic", "Vascular (infarction/hemorrhage)", "Compressive (tumor, disc, abscess)", "Demyelinating (MS, NMOSD)", "Inflammatory / Infectious"] },
  ];

  const positions = [
    { x: 0.3, y: 1.25 }, { x: 5.1, y: 1.25 },
    { x: 0.3, y: 3.35 }, { x: 5.1, y: 3.35 }
  ];

  categories.forEach((cat, i) => {
    const { x, y } = positions[i];
    sl.addShape(pres.shapes.RECTANGLE, {
      x, y, w: 4.5, h: 1.85,
      fill: { color: C.white },
      shadow: { type: "outer", color: "000000", blur: 5, offset: 2, angle: 135, opacity: 0.1 }
    });
    sl.addShape(pres.shapes.RECTANGLE, {
      x, y, w: 4.5, h: 0.4,
      fill: { color: cat.color }, line: { color: cat.color }
    });
    sl.addText(cat.label, {
      x: x + 0.1, y, w: 4.3, h: 0.4,
      fontSize: 12, bold: true, color: C.white,
      fontFace: "Calibri", valign: "middle", margin: 0
    });
    sl.addText(cat.items.map((item, j) => ({
      text: item,
      options: { bullet: { code: '2022' }, color: "1A1A2E", breakLine: j < cat.items.length - 1, fontSize: 11 }
    })).flat(), {
      x: x + 0.1, y: y + 0.45, w: 4.3, h: 1.35,
      fontFace: "Calibri", valign: "top", paraSpaceAfter: 2
    });
  });
}

// ═══════════════════════════════════════════════════════════════
// SLIDE 4 — COMPLETE (TRANSVERSE) CORD SYNDROME
// ═══════════════════════════════════════════════════════════════
{
  let sl = pres.addSlide();
  sl.background = { color: C.offWhite };
  addSlideTitle(sl, "Complete (Transverse) Spinal Cord Syndrome", "Rosen's Emergency Medicine, p. 1504");

  sl.addShape(pres.shapes.RECTANGLE, {
    x: 0.3, y: 1.25, w: 9.4, h: 3.85,
    fill: { color: C.white },
    shadow: { type: "outer", color: "000000", blur: 6, offset: 2, angle: 135, opacity: 0.1 }
  });

  // Red accent left strip
  sl.addShape(pres.shapes.RECTANGLE, {
    x: 0.3, y: 1.25, w: 0.12, h: 3.85,
    fill: { color: C.red }, line: { color: C.red }
  });

  sl.addText("Definition", { x: 0.55, y: 1.32, w: 9, h: 0.35, fontSize: 14, bold: true, color: C.red, fontFace: "Calibri" });
  sl.addText("Total loss of sensory, autonomic, and voluntary motor innervation distal to the level of injury.", {
    x: 0.55, y: 1.65, w: 9, h: 0.45, fontSize: 13, color: "1A1A2E", fontFace: "Calibri"
  });

  const cols = [
    {
      heading: "Clinical Features", color: C.red,
      items: [
        "Complete motor paralysis below level",
        "Complete sensory loss below level",
        "Sphincter (bladder/bowel) control lost",
        "Autonomic dysfunction: hypotension, priapism",
        "Spinal shock in acute phase"
      ]
    },
    {
      heading: "Prognosis & Causes", color: C.navy,
      items: [
        "No functional recovery if complete >24 hrs",
        "Sacral sparing = incomplete → better prognosis",
        "Most common cause: trauma",
        "Others: infarction, hemorrhage, extrinsic compression",
        "Reflex activity may return (hyperreflexia, spasticity)"
      ]
    }
  ];

  cols.forEach((col, i) => {
    const cx = i === 0 ? 0.55 : 5.2;
    sl.addText(col.heading, {
      x: cx, y: 2.18, w: 4.3, h: 0.35,
      fontSize: 13, bold: true, color: col.color, fontFace: "Calibri"
    });
    sl.addText(col.items.map((item, j) => ({
      text: item,
      options: { bullet: { code: '25B8', color: col.color }, color: "1A1A2E", breakLine: j < col.items.length - 1, fontSize: 12 }
    })).flat(), {
      x: cx, y: 2.57, w: 4.3, h: 2.45,
      fontFace: "Calibri", valign: "top", paraSpaceAfter: 3
    });
  });
}

// ═══════════════════════════════════════════════════════════════
// SLIDE 5 — SPINAL SHOCK
// ═══════════════════════════════════════════════════════════════
{
  let sl = pres.addSlide();
  sl.background = { color: C.offWhite };
  addSlideTitle(sl, "Spinal Shock", "Bradley & Daroff's Neurology in Clinical Practice, p. 482");

  // Definition box
  sl.addShape(pres.shapes.RECTANGLE, {
    x: 0.3, y: 1.25, w: 9.4, h: 0.75,
    fill: { color: C.navy }, line: { color: C.navy }
  });
  sl.addText("Spinal shock = period of depressed spinal reflexes caudal to an acute cord injury, followed by pathological reflexes and return of cutaneous / muscle stretch reflexes.", {
    x: 0.45, y: 1.25, w: 9.1, h: 0.75,
    fontSize: 12.5, color: C.white, italic: false, fontFace: "Calibri", valign: "middle"
  });

  const cards = [
    { heading: "Timing", color: C.teal, items: ["Typically lasts <24 hours", "May persist for days to weeks", "Marker: loss of bulbocavernosus reflex"] },
    { heading: "Reflex Recovery Order", color: C.gold, items: ["Bulbocavernosus & cremasteric return first", "Babinski sign, ankle jerk, knee jerk follow", "Hyperreflexia replaces flaccidity over time"] },
    { heading: "Phase Progression", color: C.navy, items: ["Phase 1 (0–24 h): areflexia", "Phase 2 (1–3 days): reflex return begins", "Phase 3 (weeks): hyperreflexia / spasticity", "Phase 4: autonomic dysreflexia emerges"] },
  ];

  cards.forEach((card, i) => {
    const cx = 0.3 + i * 3.2;
    sl.addShape(pres.shapes.RECTANGLE, {
      x: cx, y: 2.15, w: 3.05, h: 3.0,
      fill: { color: C.white },
      shadow: { type: "outer", color: "000000", blur: 5, offset: 2, angle: 135, opacity: 0.1 }
    });
    sl.addShape(pres.shapes.RECTANGLE, {
      x: cx, y: 2.15, w: 3.05, h: 0.42,
      fill: { color: card.color }, line: { color: card.color }
    });
    sl.addText(card.heading, {
      x: cx + 0.1, y: 2.15, w: 2.85, h: 0.42,
      fontSize: 13, bold: true, color: C.white, fontFace: "Calibri", valign: "middle", margin: 0
    });
    sl.addText(card.items.map((item, j) => ({
      text: item,
      options: { bullet: { code: '2022', color: card.color }, color: "1A1A2E", breakLine: j < card.items.length - 1, fontSize: 11.5 }
    })).flat(), {
      x: cx + 0.1, y: 2.62, w: 2.85, h: 2.45,
      fontFace: "Calibri", valign: "top", paraSpaceAfter: 3
    });
  });
}

// ═══════════════════════════════════════════════════════════════
// SLIDE 6 — CENTRAL CORD SYNDROME
// ═══════════════════════════════════════════════════════════════
{
  let sl = pres.addSlide();
  sl.background = { color: C.offWhite };
  addSlideTitle(sl, "Central Cord Syndrome", "Bradley & Daroff's Neurology, p. 1305 — Most common incomplete SCI (9%)");

  sl.addShape(pres.shapes.RECTANGLE, {
    x: 0.3, y: 1.25, w: 9.4, h: 3.85,
    fill: { color: C.white },
    shadow: { type: "outer", color: "000000", blur: 6, offset: 2, angle: 135, opacity: 0.1 }
  });
  sl.addShape(pres.shapes.RECTANGLE, {
    x: 0.3, y: 1.25, w: 0.12, h: 3.85,
    fill: { color: C.teal }, line: { color: C.teal }
  });

  const leftItems = [
    "Most common spinal cord syndrome (9% of traumatic SCIs)",
    "First described by Schneider et al. (1954)",
    "Mechanism: hyperextension injury + pre-existing cervical spondylosis",
    "Anterior bone spurs + hypertrophied ligamentum flavum compress cord centrally",
    "Axonal disruption in white matter (not central gray hematomyelia as originally proposed)"
  ];
  const rightItems = [
    "Upper extremity weakness > lower extremity weakness",
    "Variable sensory disturbances below lesion",
    "Bladder dysfunction (often urinary retention)",
    "Dissociated sensory loss in upper limbs (↓ pinprick/temp; intact light touch)",
    "Prognosis: relatively good — up to 90% with any sparing at 4 weeks become functional ambulators"
  ];

  sl.addText("Pathophysiology & Mechanism", {
    x: 0.55, y: 1.32, w: 4.3, h: 0.35, fontSize: 13, bold: true, color: C.teal, fontFace: "Calibri"
  });
  sl.addText(leftItems.map((item, j) => ({
    text: item,
    options: { bullet: { code: '25B8', color: C.teal }, color: "1A1A2E", breakLine: j < leftItems.length - 1, fontSize: 11.5 }
  })).flat(), {
    x: 0.55, y: 1.72, w: 4.3, h: 3.3, fontFace: "Calibri", valign: "top", paraSpaceAfter: 3
  });

  sl.addText("Clinical Features", {
    x: 5.2, y: 1.32, w: 4.3, h: 0.35, fontSize: 13, bold: true, color: C.navy, fontFace: "Calibri"
  });
  sl.addText(rightItems.map((item, j) => ({
    text: item,
    options: { bullet: { code: '25B8', color: C.navy }, color: "1A1A2E", breakLine: j < rightItems.length - 1, fontSize: 11.5 }
  })).flat(), {
    x: 5.2, y: 1.72, w: 4.3, h: 3.3, fontFace: "Calibri", valign: "top", paraSpaceAfter: 3
  });
}

// ═══════════════════════════════════════════════════════════════
// SLIDE 7 — ANTERIOR CORD SYNDROME
// ═══════════════════════════════════════════════════════════════
{
  let sl = pres.addSlide();
  sl.background = { color: C.offWhite };
  addSlideTitle(sl, "Anterior Cord Syndrome", "Bradley & Daroff's Neurology, p. 1305 — Worst prognosis among incomplete SCIs");

  // Diagram schematic (text-based cross-section depiction)
  sl.addShape(pres.shapes.RECTANGLE, {
    x: 0.3, y: 1.25, w: 3.5, h: 3.85,
    fill: { color: C.navy }, line: { color: C.navy }
  });
  sl.addText("AFFECTED", { x: 0.3, y: 1.3, w: 3.5, h: 0.4, fontSize: 11, bold: true, color: C.red, fontFace: "Calibri", align: "center" });
  sl.addText([
    { text: "Anterior 2/3 of spinal cord", options: { breakLine: true } },
    { text: "Corticospinal tract (motor)", options: { breakLine: true } },
    { text: "Spinothalamic tract (pain/temp)", options: { breakLine: true } },
    { text: "", options: { breakLine: true } },
    { text: "SPARED", options: { bold: true, color: C.green, breakLine: true } },
    { text: "Posterior columns (dorsal)", options: { breakLine: true } },
    { text: "Vibration, proprioception", options: { breakLine: true } },
    { text: "Fine/discriminative touch", options: {} },
  ], {
    x: 0.4, y: 1.75, w: 3.3, h: 3.3,
    fontSize: 12, color: C.white, fontFace: "Calibri", valign: "top", paraSpaceAfter: 3
  });

  sl.addShape(pres.shapes.RECTANGLE, {
    x: 3.95, y: 1.25, w: 5.75, h: 3.85,
    fill: { color: C.white },
    shadow: { type: "outer", color: "000000", blur: 6, offset: 2, angle: 135, opacity: 0.1 }
  });
  const items = [
    { title: "Incidence:", body: "2.7% of all traumatic SCIs" },
    { title: "Mechanism:", body: "Anterior spinal artery compromise; flexion injuries; retropulsed disc/bone" },
    { title: "Motor:", body: "Complete motor loss distal to lesion (corticospinal involvement)" },
    { title: "Sensory:", body: "Loss of pain & temperature; vibration & proprioception INTACT" },
    { title: "Bladder/Bowel:", body: "Variable sphincter involvement" },
    { title: "Prognosis:", body: "Worst prognosis among incomplete cord syndromes; very limited motor recovery" },
    { title: "Hyperesthesia:", body: "Patients may feel hyperesthesia & hypoalgesia below lesion" },
  ];
  sl.addText(items.map((item, j) => [
    { text: item.title + " ", options: { bold: true, color: C.red } },
    { text: item.body, options: { color: "1A1A2E", breakLine: j < items.length - 1 } }
  ]).flat(), {
    x: 4.1, y: 1.35, w: 5.45, h: 3.65,
    fontSize: 12, fontFace: "Calibri", valign: "top", paraSpaceAfter: 5
  });
}

// ═══════════════════════════════════════════════════════════════
// SLIDE 8 — POSTERIOR CORD SYNDROME
// ═══════════════════════════════════════════════════════════════
{
  let sl = pres.addSlide();
  sl.background = { color: C.offWhite };
  addSlideTitle(sl, "Posterior Cord Syndrome", "Bradley & Daroff's Neurology — Rare (<1% of SCIs)");

  sl.addShape(pres.shapes.RECTANGLE, {
    x: 0.3, y: 1.25, w: 9.4, h: 3.85,
    fill: { color: C.white },
    shadow: { type: "outer", color: "000000", blur: 6, offset: 2, angle: 135, opacity: 0.1 }
  });
  sl.addShape(pres.shapes.RECTANGLE, {
    x: 0.3, y: 1.25, w: 0.12, h: 3.85,
    fill: { color: C.gold }, line: { color: C.gold }
  });

  const sections = [
    { heading: "Incidence & Mechanism", color: C.gold, x: 0.55, items: [
      "Incidence <1% — rarest cord syndrome",
      "Neck hyperextension injuries",
      "Also seen in pernicious anemia (subacute combined degeneration)",
      "NOT included in international SCI classification standards"
    ]},
    { heading: "Tracts Affected", color: C.red, x: 3.55, items: [
      "Posterior columns (dorsal columns) damaged",
      "Spinothalamic tracts SPARED",
      "May have associated motor involvement"
    ]},
    { heading: "Clinical Features", color: C.navy, x: 6.55, items: [
      "Loss of vibration sensation",
      "Loss of proprioception (position sense)",
      "Loss of discriminative touch",
      "Pain & temperature sensation PRESERVED",
      "Ataxic gait (sensory ataxia)",
      "Positive Romberg sign"
    ]},
  ];

  sections.forEach(sec => {
    sl.addText(sec.heading, {
      x: sec.x, y: 1.35, w: 2.8, h: 0.35,
      fontSize: 12, bold: true, color: sec.color, fontFace: "Calibri"
    });
    sl.addText(sec.items.map((item, j) => ({
      text: item,
      options: { bullet: { code: '25B8', color: sec.color }, color: "1A1A2E", breakLine: j < sec.items.length - 1, fontSize: 11.5 }
    })).flat(), {
      x: sec.x, y: 1.75, w: 2.8, h: 3.2,
      fontFace: "Calibri", valign: "top", paraSpaceAfter: 3
    });
  });
}

// ═══════════════════════════════════════════════════════════════
// SLIDE 9 — BROWN-SÉQUARD SYNDROME
// ═══════════════════════════════════════════════════════════════
{
  let sl = pres.addSlide();
  sl.background = { color: C.offWhite };
  addSlideTitle(sl, "Brown-Séquard Syndrome", "Bradley & Daroff's Neurology — Hemisection of the cord (1–4% of SCIs)");

  sl.addShape(pres.shapes.RECTANGLE, {
    x: 0.3, y: 1.25, w: 9.4, h: 3.85,
    fill: { color: C.white },
    shadow: { type: "outer", color: "000000", blur: 6, offset: 2, angle: 135, opacity: 0.1 }
  });

  // Left side = IPSILATERAL findings
  sl.addShape(pres.shapes.RECTANGLE, {
    x: 0.3, y: 1.25, w: 4.5, h: 0.42,
    fill: { color: C.navy }, line: { color: C.navy }
  });
  sl.addText("IPSILATERAL to Lesion", {
    x: 0.3, y: 1.25, w: 4.5, h: 0.42,
    fontSize: 13, bold: true, color: C.white, fontFace: "Calibri", align: "center", valign: "middle", margin: 0
  });
  sl.addText([
    { text: "Corticospinal tract:", options: { bold: true, color: C.navy, breakLine: false } },
    { text: " UMN motor loss (pyramidal deficit)", options: { color: "1A1A2E", breakLine: true } },
    { text: "Dorsal columns:", options: { bold: true, color: C.navy, breakLine: false } },
    { text: " Loss of vibration, proprioception, fine touch", options: { color: "1A1A2E", breakLine: true } },
    { text: "At level of lesion:", options: { bold: true, color: C.navy, breakLine: false } },
    { text: " LMN signs (flaccid weakness, atrophy)", options: { color: "1A1A2E", breakLine: false } }
  ], { x: 0.45, y: 1.72, w: 4.2, h: 2.0, fontSize: 12, fontFace: "Calibri", valign: "top", paraSpaceAfter: 5 });

  // Right side = CONTRALATERAL
  sl.addShape(pres.shapes.RECTANGLE, {
    x: 5.2, y: 1.25, w: 4.5, h: 0.42,
    fill: { color: C.red }, line: { color: C.red }
  });
  sl.addText("CONTRALATERAL to Lesion", {
    x: 5.2, y: 1.25, w: 4.5, h: 0.42,
    fontSize: 13, bold: true, color: C.white, fontFace: "Calibri", align: "center", valign: "middle", margin: 0
  });
  sl.addText([
    { text: "Spinothalamic tract crosses:", options: { bold: true, color: C.red, breakLine: false } },
    { text: " Loss of pain & temperature (1–2 dermatomes below lesion)", options: { color: "1A1A2E", breakLine: true } },
    { text: "Crude touch:", options: { bold: true, color: C.red, breakLine: false } },
    { text: " May be decreased", options: { color: "1A1A2E", breakLine: true } },
    { text: "Vibration/proprioception:", options: { bold: true, color: C.red, breakLine: false } },
    { text: " PRESERVED", options: { color: C.green, breakLine: false } }
  ], { x: 5.35, y: 1.72, w: 4.2, h: 2.0, fontSize: 12, fontFace: "Calibri", valign: "top", paraSpaceAfter: 5 });

  // Bottom notes
  sl.addShape(pres.shapes.RECTANGLE, {
    x: 0.3, y: 3.78, w: 9.4, h: 1.22,
    fill: { color: C.offWhite }, line: { color: C.lightGray }
  });
  sl.addText([
    { text: "Causes: ", options: { bold: true, color: C.navy } },
    { text: "Penetrating injuries (stab wounds) most common; blunt trauma, disc herniation, MS plaque\n", options: { color: "1A1A2E" } },
    { text: "Brown-Séquard Plus: ", options: { bold: true, color: "7B3F9E" } },
    { text: "Asymmetric hemiplegia + hypoalgesia more prominent on less paretic side — classic form is actually rare", options: { color: "1A1A2E" } }
  ], { x: 0.45, y: 3.82, w: 9.1, h: 1.1, fontSize: 11.5, fontFace: "Calibri", valign: "top", paraSpaceAfter: 2 });
}

// ═══════════════════════════════════════════════════════════════
// SLIDE 10 — CONUS MEDULLARIS SYNDROME
// ═══════════════════════════════════════════════════════════════
{
  let sl = pres.addSlide();
  sl.background = { color: C.offWhite };
  addSlideTitle(sl, "Conus Medullaris Syndrome", "Bradley & Daroff's Neurology — Injury at T12–L1–L2 level");

  sl.addShape(pres.shapes.RECTANGLE, {
    x: 0.3, y: 1.25, w: 9.4, h: 3.85,
    fill: { color: C.white },
    shadow: { type: "outer", color: "000000", blur: 6, offset: 2, angle: 135, opacity: 0.1 }
  });
  sl.addShape(pres.shapes.RECTANGLE, {
    x: 0.3, y: 1.25, w: 0.12, h: 3.85,
    fill: { color: "7B3F9E" }, line: { color: "7B3F9E" }
  });

  const cols2 = [
    {
      heading: "Anatomy & Mechanism", color: "7B3F9E",
      items: [
        "Conus medullaris = most distal part of spinal cord (S3–S5 sacral segments)",
        "Located at vertebral level T12–L1–L2",
        "Injury from burst fractures at T12–L1",
        "Involves sacral cord and often lumbar nerve roots simultaneously",
        "Mixed UMN and LMN picture due to mixed involvement"
      ]
    },
    {
      heading: "Clinical Features", color: C.navy,
      items: [
        "Saddle anesthesia (S3–S5 distribution: perineum, genitals, inner thighs)",
        "Bladder & bowel dysfunction — often UMN type initially",
        "Sexual dysfunction (erectile/ejaculatory)",
        "Lower limb weakness — may be bilateral and UMN type",
        "Sensory loss: patchy to complete transverse pattern",
        "Absent or abnormal bulbocavernosus reflex",
        "Prognosis for sphincter function: guarded"
      ]
    }
  ];

  cols2.forEach((col, i) => {
    const cx = i === 0 ? 0.55 : 5.2;
    sl.addText(col.heading, {
      x: cx, y: 1.32, w: 4.3, h: 0.35, fontSize: 13, bold: true, color: col.color, fontFace: "Calibri"
    });
    sl.addText(col.items.map((item, j) => ({
      text: item,
      options: { bullet: { code: '25B8', color: col.color }, color: "1A1A2E", breakLine: j < col.items.length - 1, fontSize: 11.5 }
    })).flat(), {
      x: cx, y: 1.72, w: 4.3, h: 3.25, fontFace: "Calibri", valign: "top", paraSpaceAfter: 3
    });
  });
}

// ═══════════════════════════════════════════════════════════════
// SLIDE 11 — CAUDA EQUINA SYNDROME
// ═══════════════════════════════════════════════════════════════
{
  let sl = pres.addSlide();
  sl.background = { color: C.offWhite };
  addSlideTitle(sl, "Cauda Equina Syndrome", "Bradley & Daroff's Neurology — Injury below L1–L2; pure LMN lesion");

  sl.addShape(pres.shapes.RECTANGLE, {
    x: 0.3, y: 1.25, w: 9.4, h: 3.85,
    fill: { color: C.white },
    shadow: { type: "outer", color: "000000", blur: 6, offset: 2, angle: 135, opacity: 0.1 }
  });

  // Comparison table Conus vs Cauda
  sl.addText("Cauda Equina vs Conus Medullaris — Key Differences", {
    x: 0.5, y: 1.3, w: 9, h: 0.35, fontSize: 13, bold: true, color: C.teal, fontFace: "Calibri"
  });

  const tableData = [
    ["Feature", "Cauda Equina", "Conus Medullaris"],
    ["Type of lesion", "Pure LMN (peripheral nerve roots)", "Mixed UMN + LMN"],
    ["Level", "Below L1–L2 (lumbar/sacral roots)", "T12–L1–L2 (spinal cord)"],
    ["Motor signs", "Flaccid weakness, atrophy, ↓ DTRs", "May have UMN + LMN signs"],
    ["Reflexes", "Areflexic, hyporeflexic", "May be hyperreflexic later"],
    ["Pain", "Severe radicular pain common", "Less prominent root pain"],
    ["Bladder/Bowel", "Atonic bladder; overflow incontinence", "Hyperreflexic/spastic bladder"],
    ["Laterality", "Often unilateral or asymmetric", "Often bilateral/symmetric"],
    ["Prognosis", "Better — peripheral nerve regeneration possible", "Less favorable for sphincters"],
  ];

  const colWidths = [2.2, 3.4, 3.4];
  const rowH = 0.37;
  const startX = 0.35;
  const startY = 1.72;

  tableData.forEach((row, ri) => {
    row.forEach((cell, ci) => {
      const cx = startX + colWidths.slice(0, ci).reduce((a, b) => a + b, 0);
      const isHeader = ri === 0;
      sl.addShape(pres.shapes.RECTANGLE, {
        x: cx, y: startY + ri * rowH, w: colWidths[ci], h: rowH,
        fill: { color: isHeader ? C.navy : (ri % 2 === 0 ? C.offWhite : C.white) },
        line: { color: C.lightGray, width: 0.5 }
      });
      sl.addText(cell, {
        x: cx + 0.05, y: startY + ri * rowH, w: colWidths[ci] - 0.1, h: rowH,
        fontSize: isHeader ? 11 : 10,
        bold: isHeader || ci === 0,
        color: isHeader ? C.white : (ci === 1 ? C.red : ci === 2 ? "7B3F9E" : "1A1A2E"),
        fontFace: "Calibri", valign: "middle", margin: 2
      });
    });
  });
}

// ═══════════════════════════════════════════════════════════════
// SLIDE 12 — INTRAMEDULLARY vs EXTRAMEDULLARY LESIONS
// ═══════════════════════════════════════════════════════════════
{
  let sl = pres.addSlide();
  sl.background = { color: C.offWhite };
  addSlideTitle(sl, "Intramedullary vs Extramedullary Lesions", "Bradley & Daroff's Neurology, Washington Manual — Localization by anatomy");

  const boxes = [
    {
      label: "INTRAMEDULLARY", color: C.teal, x: 0.3, y: 1.25,
      items: [
        "Within cord parenchyma",
        "Dissociated sensory loss (segmental ↓ pinprick/temp; intact vibration/position)",
        "Central cord pattern: upper limbs > lower limbs",
        "No radicular pain at onset",
        "Sacral sparing of sensation (peripherally located fibers)",
        "Examples: glioma, ependymoma, syringomyelia, MS plaque, AVM",
        "MRI: cord swelling → suspect glioma, lymphoma, ependymoma",
        "Cavity on MRI → syringomyelia"
      ]
    },
    {
      label: "EXTRAMEDULLARY (INTRADURAL)", color: C.navy, x: 5.1, y: 1.25,
      items: [
        "Outside cord but inside dural sac",
        "Radicular pain often first symptom",
        "Ipsilateral proprioception + motor loss; contralateral pain/temp loss (Brown-Séquard pattern common)",
        "Sacral sensation affected early",
        "Examples: meningioma, neurofibroma, leptomeningeal metastasis",
        "Most common cause of cord compression: cervical spondylosis"
      ]
    }
  ];

  boxes.forEach(box => {
    sl.addShape(pres.shapes.RECTANGLE, {
      x: box.x, y: box.y, w: 4.5, h: 3.85,
      fill: { color: C.white },
      shadow: { type: "outer", color: "000000", blur: 6, offset: 2, angle: 135, opacity: 0.1 }
    });
    sl.addShape(pres.shapes.RECTANGLE, {
      x: box.x, y: box.y, w: 4.5, h: 0.42,
      fill: { color: box.color }, line: { color: box.color }
    });
    sl.addText(box.label, {
      x: box.x + 0.1, y: box.y, w: 4.3, h: 0.42,
      fontSize: 12, bold: true, color: C.white, fontFace: "Calibri", valign: "middle", margin: 0, align: "center"
    });
    sl.addText(box.items.map((item, j) => ({
      text: item,
      options: { bullet: { code: '25B8', color: box.color }, color: "1A1A2E", breakLine: j < box.items.length - 1, fontSize: 11 }
    })).flat(), {
      x: box.x + 0.15, y: box.y + 0.48, w: 4.2, h: 3.3,
      fontFace: "Calibri", valign: "top", paraSpaceAfter: 3
    });
  });
}

// ═══════════════════════════════════════════════════════════════
// SLIDE 13 — DIFFERENTIAL DIAGNOSIS
// ═══════════════════════════════════════════════════════════════
{
  let sl = pres.addSlide();
  sl.background = { color: C.offWhite };
  addSlideTitle(sl, "Differential Diagnosis of Spinal Cord Disease", "Bradley & Daroff's Neurology — Box 27.1");

  const cats = [
    {
      label: "Compressive — Non-Neoplastic", color: C.red, x: 0.3, y: 1.25, w: 3.0,
      items: ["Trauma: vertebral fracture/dislocation", "Cervical & lumbar spondylosis/stenosis", "Intervertebral disc herniation", "Infectious abscess, TB", "Epidural hematoma", "Arachnoid cysts, Paget disease"]
    },
    {
      label: "Compressive — Neoplastic", color: C.gold, x: 3.5, y: 1.25, w: 3.0,
      items: ["Epidural metastasis", "Intradural extramedullary: meningioma, neurofibroma", "Intramedullary tumors", "Leptomeningeal metastasis"]
    },
    {
      label: "Non-Compressive Myelopathies", color: C.navy, x: 6.7, y: 1.25, w: 3.0,
      items: ["Demyelinating: MS, ADEM", "Vascular: infarction, AVM", "Viral myelitis: VZV, HIV, HTLV-1", "Syringomyelia", "Vit B12 deficiency (subacute combined)", "Autoimmune: NMO spectrum", "Syphilis, Lyme disease", "Radiation-induced myelopathy"]
    }
  ];

  cats.forEach(cat => {
    sl.addShape(pres.shapes.RECTANGLE, {
      x: cat.x, y: cat.y, w: cat.w, h: 3.85,
      fill: { color: C.white },
      shadow: { type: "outer", color: "000000", blur: 5, offset: 2, angle: 135, opacity: 0.1 }
    });
    sl.addShape(pres.shapes.RECTANGLE, {
      x: cat.x, y: cat.y, w: cat.w, h: 0.42,
      fill: { color: cat.color }, line: { color: cat.color }
    });
    sl.addText(cat.label, {
      x: cat.x + 0.05, y: cat.y, w: cat.w - 0.1, h: 0.42,
      fontSize: 10.5, bold: true, color: C.white, fontFace: "Calibri", valign: "middle", margin: 2
    });
    sl.addText(cat.items.map((item, j) => ({
      text: item,
      options: { bullet: { code: '2022', color: cat.color }, color: "1A1A2E", breakLine: j < cat.items.length - 1, fontSize: 11 }
    })).flat(), {
      x: cat.x + 0.1, y: cat.y + 0.48, w: cat.w - 0.2, h: 3.3,
      fontFace: "Calibri", valign: "top", paraSpaceAfter: 3
    });
  });
}

// ═══════════════════════════════════════════════════════════════
// SLIDE 14 — CLINICAL LOCALIZATION SUMMARY TABLE
// ═══════════════════════════════════════════════════════════════
{
  let sl = pres.addSlide();
  sl.background = { color: C.offWhite };
  addSlideTitle(sl, "Clinical Localization Summary", "Rosen's EM Table 92.1 | Bradley & Daroff — All Syndromes at a Glance");

  const headers = ["Syndrome", "Motor", "Vibration/Prop.", "Pain/Temp.", "Bladder/Bowel", "Prognosis"];
  const rows = [
    ["Complete Transverse", "Bilateral loss below", "Bilateral loss", "Bilateral loss", "Lost", "Poor if >24 h"],
    ["Central Cord", "UE > LE weakness", "Variable", "Variable (disso-ciated in UE)", "Retention common", "Relatively good"],
    ["Anterior Cord", "Bilateral ↓ below", "Preserved", "Bilateral loss", "Variable", "Worst incomplete"],
    ["Posterior Cord", "Usually preserved", "Bilateral loss", "Preserved", "May be affected", "Moderate"],
    ["Brown-Séquard", "Ipsilateral UMN loss", "Ipsilateral loss", "Contralateral loss (1–2 levels below)", "Variable", "Best incomplete"],
    ["Conus Medullaris", "Bilateral UMN+LMN", "Saddle anesthesia", "Saddle anesthesia", "UMN-type dysfunction", "Guarded"],
    ["Cauda Equina", "Bilateral LMN flaccid", "Saddle anesthesia", "Saddle anesthesia", "Atonic/overflow", "Better (regen possible)"],
  ];

  const colW = [1.85, 1.35, 1.25, 1.55, 1.4, 1.75];
  const rowH = 0.49;
  const sx = 0.2, sy = 1.28;

  // Header row
  headers.forEach((h, ci) => {
    const cx = sx + colW.slice(0, ci).reduce((a, b) => a + b, 0);
    sl.addShape(pres.shapes.RECTANGLE, {
      x: cx, y: sy, w: colW[ci], h: 0.42,
      fill: { color: C.navy }, line: { color: C.lightGray, width: 0.5 }
    });
    sl.addText(h, {
      x: cx + 0.03, y: sy, w: colW[ci] - 0.06, h: 0.42,
      fontSize: 10, bold: true, color: C.white, fontFace: "Calibri", valign: "middle", margin: 2
    });
  });

  // Data rows
  const rowColors = [C.red, C.teal, C.orange, C.gold, "1A7A4A", "7B3F9E", C.navy];
  rows.forEach((row, ri) => {
    row.forEach((cell, ci) => {
      const cx = sx + colW.slice(0, ci).reduce((a, b) => a + b, 0);
      const ry = sy + 0.42 + ri * rowH;
      sl.addShape(pres.shapes.RECTANGLE, {
        x: cx, y: ry, w: colW[ci], h: rowH,
        fill: { color: ri % 2 === 0 ? C.white : C.offWhite },
        line: { color: C.lightGray, width: 0.5 }
      });
      sl.addText(cell, {
        x: cx + 0.03, y: ry, w: colW[ci] - 0.06, h: rowH,
        fontSize: ci === 0 ? 10 : 9.5,
        bold: ci === 0,
        color: ci === 0 ? rowColors[ri] : "1A1A2E",
        fontFace: "Calibri", valign: "middle", margin: 2
      });
    });
  });
}

// ═══════════════════════════════════════════════════════════════
// SLIDE 15 — KEY TAKEAWAYS
// ═══════════════════════════════════════════════════════════════
{
  let sl = pres.addSlide();
  sl.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 0, w: 10, h: 5.625,
    fill: { color: C.navy }, line: { color: C.navy }
  });
  sl.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 0, w: 0.18, h: 5.625,
    fill: { color: C.teal }, line: { color: C.teal }
  });
  sl.addShape(pres.shapes.RECTANGLE, {
    x: 0.35, y: 1.02, w: 9.3, h: 0.06,
    fill: { color: C.gold }, line: { color: C.gold }
  });

  sl.addText("Key Takeaways", {
    x: 0.35, y: 0.2, w: 9.3, h: 0.78,
    fontSize: 28, bold: true, color: C.white, fontFace: "Calibri", align: "center", valign: "middle"
  });

  const takeaways = [
    { num: "01", text: "Spinal cord localization relies on the interplay of motor, sensory, and autonomic deficits — each tract crosses at a different level." },
    { num: "02", text: "Central cord syndrome is the most common incomplete SCI — UE > LE weakness after cervical hyperextension with spondylosis." },
    { num: "03", text: "Brown-Séquard = cord hemisection — ipsilateral motor + proprioception loss; contralateral pain/temperature loss 1–2 levels below." },
    { num: "04", text: "Anterior cord syndrome carries the worst prognosis — motor + spinothalamic loss with spared posterior columns (vibration intact)." },
    { num: "05", text: "Conus vs Cauda Equina: both cause saddle anesthesia but conus has UMN signs and bilateral findings; cauda equina has pure LMN (flaccid, areflexic) with potential for recovery via peripheral nerve regeneration." },
    { num: "06", text: "Sacral sparing in an acute injury signifies an incomplete lesion — always check perineal sensation before declaring complete injury." },
  ];

  takeaways.forEach((t, i) => {
    const y = 1.18 + i * 0.7;
    sl.addShape(pres.shapes.RECTANGLE, {
      x: 0.35, y, w: 0.52, h: 0.52,
      fill: { color: C.teal }, line: { color: C.teal }
    });
    sl.addText(t.num, {
      x: 0.35, y, w: 0.52, h: 0.52,
      fontSize: 13, bold: true, color: C.white, fontFace: "Calibri", align: "center", valign: "middle"
    });
    sl.addText(t.text, {
      x: 0.98, y: y + 0.05, w: 8.7, h: 0.52,
      fontSize: 11.5, color: C.white, fontFace: "Calibri", valign: "top"
    });
  });
}

// ─── WRITE FILE ──────────────────────────────────────────────
pres.writeFile({ fileName: "/home/daytona/workspace/spinal-cord-lesions/Spinal_Cord_Lesions_Classification.pptx" })
  .then(() => console.log("Done: Spinal_Cord_Lesions_Classification.pptx"))
  .catch(e => { console.error(e); process.exit(1); });
Running Command

cd /home/daytona/workspace/spinal-cord-lesions && node create_pptx.js

Running Command

ls -lh /home/daytona/workspace/spinal-cord-lesions/

Your 15-slide presentation is ready for download:

Spinal Cord Lesions Classification

Presentation · PPTX


Here is what is covered across all 15 slides (deep navy + teal + gold color scheme, sourced from Bradley & Daroff's Neurology, Rosen's Emergency Medicine, and Principles of Neural Science):
#Slide Title
1Title Slide
2Anatomy of the Spinal Cord (segments + key tracts)
3Classification Overview (by completeness, location, level, etiology)
4Complete (Transverse) Cord Syndrome
5Spinal Shock (phases, reflex recovery order)
6Central Cord Syndrome (most common, 9% of SCIs)
7Anterior Cord Syndrome (worst prognosis)
8Posterior Cord Syndrome (rare, <1%)
9Brown-Séquard Syndrome (ipsilateral vs contralateral findings table)
10Conus Medullaris Syndrome
11Cauda Equina Syndrome (with Conus vs Cauda comparison table)
12Intramedullary vs Extramedullary Lesions
13Differential Diagnosis (compressive neoplastic/non-neoplastic + non-compressive)
14Clinical Localization Summary Table (all 7 syndromes side-by-side)
15Key Takeaways (6 high-yield points)
This is a shared conversation. Sign in to Orris to start your own chat.