Poster and reflex class predestination i want 15 slides matter

Asking for Preferences
Reading File
Reading File
Reading File
Finding Sources
Finding Sources
Finding Sources
Reading File
Finding Sources
Finding Sources
Reading File
Finding Sources
Reading File
Reading File
Reading File
Reading File
Running Command

ls -la /home/daytona/workspace/ 2>/dev/null | head -20

Running Command

mkdir -p /home/daytona/workspace/reflex-classification-ppt

Writing File

~/reflex-classification-ppt/build.js

const pptxgen = require("pptxgenjs");

const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Classification of Reflexes";
pres.author = "Neurophysiology Lecture";

// ─── Color Palette ───────────────────────────────────────────────────────────
const C = {
  navy:    "0D1B40",   // dominant dark bg
  teal:    "0F7173",   // accent
  gold:    "E8A838",   // highlight
  white:   "F4F6FA",
  light:   "D6E4F0",
  mid:     "1D3461",
  text:    "E8ECF2",
  dark:    "091029",
};

// ─── Helper: Section Banner ──────────────────────────────────────────────────
function addBanner(slide, text) {
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 4.9, w: 10, h: 0.72, fill: { color: C.teal } });
  slide.addText(text, {
    x: 0.2, y: 4.92, w: 9.6, h: 0.65,
    fontSize: 13, color: C.white, bold: true, valign: "middle", margin: 0,
  });
}

// ─── Helper: Content Box ─────────────────────────────────────────────────────
function contentBox(slide, x, y, w, h, title, bullets, titleColor) {
  slide.addShape(pres.ShapeType.roundRect, {
    x, y, w, h,
    fill: { color: C.mid },
    line: { color: C.teal, width: 1.5 },
    rectRadius: 0.08,
  });
  slide.addText(title, {
    x: x + 0.12, y: y + 0.05, w: w - 0.24, h: 0.38,
    fontSize: 13, bold: true, color: titleColor || C.gold, margin: 0,
  });
  const items = bullets.map((b, i) => ({
    text: b,
    options: { bullet: { type: "bullet" }, fontSize: 11, color: C.text, breakLine: i < bullets.length - 1 },
  }));
  slide.addText(items, { x: x + 0.15, y: y + 0.42, w: w - 0.3, h: h - 0.5 });
}

// ─── SLIDE 1 — Title ─────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.navy } });
  // Accent bar left
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.25, h: 5.625, fill: { color: C.teal } });
  // Gold accent top strip
  s.addShape(pres.ShapeType.rect, { x: 0.25, y: 0, w: 9.75, h: 0.08, fill: { color: C.gold } });

  s.addText("CLASSIFICATION OF REFLEXES", {
    x: 0.5, y: 1.2, w: 9, h: 1,
    fontSize: 38, bold: true, color: C.white,
    charSpacing: 2, align: "center", valign: "middle",
  });
  s.addText("Neurophysiology & Spinal Cord Motor Control", {
    x: 0.5, y: 2.3, w: 9, h: 0.5,
    fontSize: 18, color: C.light, align: "center", italic: true,
  });
  s.addShape(pres.ShapeType.rect, { x: 3.5, y: 2.95, w: 3, h: 0.04, fill: { color: C.gold } });
  s.addText([
    { text: "Topics: ", options: { bold: true, color: C.gold } },
    { text: "Reflex Arc · Types · Stretch · Golgi Tendon · Withdrawal · Clinical Significance", options: { color: C.light } },
  ], { x: 0.5, y: 3.15, w: 9, h: 0.5, fontSize: 13, align: "center" });

  s.addText("Source: Costanzo Physiology, 7th Ed. | Kandel Principles of Neural Science", {
    x: 0.5, y: 5.15, w: 9, h: 0.35,
    fontSize: 10, color: C.teal, align: "center", italic: true,
  });
}

// ─── SLIDE 2 — Learning Objectives ──────────────────────────────────────────
{
  const s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.navy } });
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.9, fill: { color: C.mid } });
  s.addText("LEARNING OBJECTIVES", {
    x: 0.4, y: 0.1, w: 9, h: 0.7,
    fontSize: 22, bold: true, color: C.gold, valign: "middle",
  });

  const objectives = [
    "Define a reflex and describe the five components of a reflex arc",
    "Classify reflexes by number of synapses: monosynaptic vs. polysynaptic",
    "Distinguish somatic reflexes from autonomic (visceral) reflexes",
    "Explain the stretch reflex (myotatic) and its clinical significance",
    "Describe the Golgi tendon reflex (inverse myotatic) mechanism",
    "Understand the flexor-withdrawal reflex and crossed-extension reflex",
    "Interpret deep tendon reflex grading and clinical relevance",
    "Recognize UMN vs. LMN lesion patterns affecting reflexes",
  ];

  objectives.forEach((obj, i) => {
    const col = i < 4 ? 0 : 1;
    const row = i % 4;
    const x = col === 0 ? 0.3 : 5.2;
    const y = 1.05 + row * 1.08;
    s.addShape(pres.ShapeType.roundRect, {
      x, y, w: 4.6, h: 0.9,
      fill: { color: C.mid },
      line: { color: C.teal, width: 1 },
      rectRadius: 0.06,
    });
    s.addShape(pres.ShapeType.ellipse, {
      x: x + 0.08, y: y + 0.22, w: 0.45, h: 0.45,
      fill: { color: C.gold },
    });
    s.addText(`${i + 1}`, {
      x: x + 0.08, y: y + 0.22, w: 0.45, h: 0.45,
      fontSize: 13, bold: true, color: C.navy, align: "center", valign: "middle",
    });
    s.addText(obj, {
      x: x + 0.62, y: y + 0.1, w: 3.85, h: 0.72,
      fontSize: 10.5, color: C.text, valign: "middle",
    });
  });
}

// ─── SLIDE 3 — What is a Reflex? ─────────────────────────────────────────────
{
  const s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.navy } });
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.9, fill: { color: C.mid } });
  s.addText("WHAT IS A REFLEX?", {
    x: 0.4, y: 0.1, w: 9, h: 0.7,
    fontSize: 22, bold: true, color: C.gold, valign: "middle",
  });

  // Definition box
  s.addShape(pres.ShapeType.rect, { x: 0.3, y: 1.0, w: 9.4, h: 1.0, fill: { color: C.mid }, line: { color: C.gold, width: 2 } });
  s.addText([
    { text: "DEFINITION: ", options: { bold: true, color: C.gold } },
    { text: "A reflex is a stereotyped, involuntary motor response to a sensory stimulus. The response is predictable, rapid, and does not require conscious involvement of higher brain centers.", options: { color: C.text } },
  ], { x: 0.5, y: 1.05, w: 9, h: 0.9, fontSize: 13, valign: "middle" });

  // Key features
  const features = [
    ["Involuntary", "Does not require conscious thought — occurs automatically"],
    ["Stereotyped", "Same stimulus always produces the same response"],
    ["Rapid", "Response occurs before conscious awareness"],
    ["Protective", "Many reflexes protect from injury (e.g., withdrawal from pain)"],
  ];

  features.forEach(([title, desc], i) => {
    const x = (i % 2) * 4.8 + 0.3;
    const y = 2.15 + Math.floor(i / 2) * 1.55;
    s.addShape(pres.ShapeType.roundRect, { x, y, w: 4.5, h: 1.35, fill: { color: C.mid }, line: { color: C.teal, width: 1.5 }, rectRadius: 0.07 });
    s.addText(title, { x: x + 0.15, y: y + 0.08, w: 4.2, h: 0.35, fontSize: 13, bold: true, color: C.gold, margin: 0 });
    s.addText(desc, { x: x + 0.15, y: y + 0.45, w: 4.2, h: 0.8, fontSize: 11, color: C.text });
  });
}

// ─── SLIDE 4 — The Reflex Arc ─────────────────────────────────────────────────
{
  const s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.navy } });
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.9, fill: { color: C.mid } });
  s.addText("THE REFLEX ARC — 5 COMPONENTS", {
    x: 0.4, y: 0.1, w: 9, h: 0.7,
    fontSize: 22, bold: true, color: C.gold, valign: "middle",
  });

  const components = [
    { num: "1", name: "Receptor", desc: "Sensory organ that detects the stimulus (e.g., muscle spindle, skin mechanoreceptor, nociceptor). Converts stimulus to action potential." },
    { num: "2", name: "Afferent (Sensory) Nerve", desc: "Carries impulse from receptor toward the CNS (spinal cord). Group Ia, Ib, II, III or IV fibers depending on reflex type." },
    { num: "3", name: "Interneuron (Integration)", desc: "Located in spinal cord gray matter. May be absent (monosynaptic) or multiple (polysynaptic). Site of reflex integration." },
    { num: "4", name: "Efferent (Motor) Nerve", desc: "Carries impulse from CNS to effector organ. α-motoneurons for skeletal muscle; preganglionic autonomic for visceral reflexes." },
    { num: "5", name: "Effector Organ", desc: "Organ that executes the response — usually skeletal muscle (somatic) or smooth muscle/gland (autonomic)." },
  ];

  components.forEach((c, i) => {
    const y = 1.0 + i * 0.89;
    // Arrow connector
    if (i < 4) {
      s.addShape(pres.ShapeType.rect, { x: 1.65, y: y + 0.78, w: 0.06, h: 0.12, fill: { color: C.teal } });
    }
    s.addShape(pres.ShapeType.ellipse, { x: 0.3, y: y + 0.1, w: 0.58, h: 0.58, fill: { color: C.teal } });
    s.addText(c.num, { x: 0.3, y: y + 0.1, w: 0.58, h: 0.58, fontSize: 16, bold: true, color: C.white, align: "center", valign: "middle" });
    s.addShape(pres.ShapeType.roundRect, { x: 1.05, y, w: 8.65, h: 0.78, fill: { color: C.mid }, line: { color: C.teal, width: 1 }, rectRadius: 0.05 });
    s.addText(`${c.name}:  `, { x: 1.2, y: y + 0.08, w: 2, h: 0.62, fontSize: 12, bold: true, color: C.gold, valign: "middle" });
    s.addText(c.desc, { x: 3.1, y: y + 0.08, w: 6.4, h: 0.62, fontSize: 10.5, color: C.text, valign: "middle" });
  });
}

// ─── SLIDE 5 — Classification Overview ───────────────────────────────────────
{
  const s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.navy } });
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.9, fill: { color: C.mid } });
  s.addText("CLASSIFICATION OF REFLEXES — OVERVIEW", {
    x: 0.4, y: 0.1, w: 9, h: 0.7,
    fontSize: 21, bold: true, color: C.gold, valign: "middle",
  });

  // 3 classification categories
  const cats = [
    {
      title: "By Number of Synapses",
      color: C.teal,
      items: ["Monosynaptic — 1 synapse (e.g., stretch reflex)", "Disynaptic — 2 synapses (e.g., Golgi tendon reflex)", "Polysynaptic — many synapses (e.g., withdrawal reflex)"],
    },
    {
      title: "By Division of Nervous System",
      color: "7B2D8B",
      items: ["Somatic reflex — effector is skeletal muscle", "Autonomic (visceral) reflex — effector is smooth muscle, cardiac muscle, or gland", "Examples: pupillary light reflex, micturition reflex"],
    },
    {
      title: "By Location of Reflex Center",
      color: "C44B36",
      items: ["Spinal reflex — integrated in spinal cord (e.g., knee jerk)", "Cranial reflex — integrated in brain stem (e.g., corneal reflex, pupillary reflex)", "Supraspinal reflexes — involve higher centers"],
    },
  ];

  cats.forEach((cat, i) => {
    const x = 0.25 + i * 3.2;
    s.addShape(pres.ShapeType.rect, { x, y: 0.95, w: 3.05, h: 0.42, fill: { color: cat.color } });
    s.addText(cat.title, { x: x + 0.08, y: 0.97, w: 2.9, h: 0.38, fontSize: 11.5, bold: true, color: C.white, valign: "middle", margin: 0 });
    s.addShape(pres.ShapeType.roundRect, {
      x, y: 1.37, w: 3.05, h: 4.1,
      fill: { color: C.mid }, line: { color: cat.color, width: 1.5 }, rectRadius: 0.05,
    });
    cat.items.forEach((item, j) => {
      s.addShape(pres.ShapeType.rect, { x: x + 0.18, y: 1.55 + j * 1.26, w: 0.06, h: 0.06, fill: { color: cat.color } });
      s.addText(item, { x: x + 0.33, y: 1.46 + j * 1.26, w: 2.55, h: 1.1, fontSize: 11, color: C.text });
    });
  });
}

// ─── SLIDE 6 — Monosynaptic vs Polysynaptic ───────────────────────────────────
{
  const s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.navy } });
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.9, fill: { color: C.mid } });
  s.addText("MONOSYNAPTIC vs. POLYSYNAPTIC REFLEXES", {
    x: 0.4, y: 0.1, w: 9, h: 0.7,
    fontSize: 20, bold: true, color: C.gold, valign: "middle",
  });

  // Monosynaptic
  s.addShape(pres.ShapeType.roundRect, { x: 0.3, y: 1.0, w: 4.4, h: 4.4, fill: { color: C.mid }, line: { color: C.teal, width: 2 }, rectRadius: 0.1 });
  s.addShape(pres.ShapeType.rect, { x: 0.3, y: 1.0, w: 4.4, h: 0.5, fill: { color: C.teal } });
  s.addText("MONOSYNAPTIC", { x: 0.4, y: 1.02, w: 4.2, h: 0.46, fontSize: 14, bold: true, color: C.white, align: "center", valign: "middle" });
  const monoPoints = [
    "Only ONE synapse in the reflex arc",
    "Ia afferent → α-motoneuron (direct)",
    "Fastest reflex type (no interneuron delay)",
    "Example: Stretch reflex / Knee-jerk reflex",
    "Receptor: Muscle spindle (nuclear bag & chain fibers)",
    "Afferent: Group Ia (largest, fastest conducting)",
    "Response: Contraction of homonymous muscle",
    "Clinical use: Tests integrity of spinal cord segments",
  ];
  s.addText(monoPoints.map((p, i) => ({ text: p, options: { bullet: true, fontSize: 11, color: C.text, breakLine: i < monoPoints.length - 1 } })),
    { x: 0.5, y: 1.6, w: 4.0, h: 3.6 });

  // Polysynaptic
  s.addShape(pres.ShapeType.roundRect, { x: 5.3, y: 1.0, w: 4.4, h: 4.4, fill: { color: C.mid }, line: { color: C.gold, width: 2 }, rectRadius: 0.1 });
  s.addShape(pres.ShapeType.rect, { x: 5.3, y: 1.0, w: 4.4, h: 0.5, fill: { color: C.gold } });
  s.addText("POLYSYNAPTIC", { x: 5.4, y: 1.02, w: 4.2, h: 0.46, fontSize: 14, bold: true, color: C.navy, align: "center", valign: "middle" });
  const polyPoints = [
    "MULTIPLE synapses via interneurons",
    "Longer conduction time than monosynaptic",
    "Can involve bilateral cord segments",
    "Example: Flexor-withdrawal reflex",
    "Receptor: Nociceptors, thermoreceptors",
    "Afferent: Group II, III, IV fibers",
    "Feature: Afterdischarge — prolonged response",
    "Feature: Crossed-extension reflex component",
  ];
  s.addText(polyPoints.map((p, i) => ({ text: p, options: { bullet: true, fontSize: 11, color: C.text, breakLine: i < polyPoints.length - 1 } })),
    { x: 5.5, y: 1.6, w: 4.0, h: 3.6 });
}

// ─── SLIDE 7 — Stretch Reflex ─────────────────────────────────────────────────
{
  const s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.navy } });
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.9, fill: { color: C.mid } });
  s.addText("STRETCH REFLEX (Myotatic Reflex)", {
    x: 0.4, y: 0.1, w: 9, h: 0.7, fontSize: 22, bold: true, color: C.gold, valign: "middle",
  });

  // Tag
  s.addShape(pres.ShapeType.roundRect, { x: 0.3, y: 1.0, w: 2.5, h: 0.38, fill: { color: C.teal }, rectRadius: 0.06 });
  s.addText("MONOSYNAPTIC — 1 Synapse", { x: 0.3, y: 1.0, w: 2.5, h: 0.38, fontSize: 11, bold: true, color: C.white, align: "center", valign: "middle" });

  const steps = [
    ["1. STIMULUS", "Muscle is stretched → extrafusal & intrafusal fibers lengthen"],
    ["2. RECEPTOR", "Muscle spindle (nuclear bag + nuclear chain fibers) activated"],
    ["3. AFFERENT", "Group Ia afferent fibers → action potentials → enter dorsal horn"],
    ["4. SYNAPSE", "Ia fibers synapse DIRECTLY on α-motoneurons (ventral horn)"],
    ["5. EFFERENT", "α-motoneurons activate → contract homonymous muscle"],
    ["6. RESULT", "Muscle shortens → decreases stretch → Ia firing returns to baseline"],
  ];

  steps.forEach(([label, text], i) => {
    const col = i < 3 ? 0 : 1;
    const row = i % 3;
    const x = col === 0 ? 0.3 : 5.2;
    const y = 1.5 + row * 1.3;
    s.addShape(pres.ShapeType.roundRect, { x, y, w: 4.6, h: 1.15, fill: { color: C.mid }, line: { color: C.teal, width: 1.2 }, rectRadius: 0.06 });
    s.addText(label, { x: x + 0.1, y: y + 0.06, w: 4.3, h: 0.32, fontSize: 10.5, bold: true, color: C.teal, margin: 0 });
    s.addText(text, { x: x + 0.1, y: y + 0.38, w: 4.3, h: 0.7, fontSize: 11, color: C.text, valign: "top" });
    // Arrow (except last in each column)
    if (row < 2) {
      s.addText("▼", { x: x + 2.0, y: y + 1.15, w: 0.5, h: 0.15, fontSize: 11, color: C.teal, align: "center" });
    }
  });

  // Key facts strip
  s.addShape(pres.ShapeType.rect, { x: 0, y: 5.25, w: 10, h: 0.38, fill: { color: C.teal } });
  s.addText("Key Fact: Simultaneous reciprocal inhibition — antagonist muscles are inhibited (via Ia inhibitory interneurons) so homonymous muscle contracts unopposed", {
    x: 0.2, y: 5.27, w: 9.6, h: 0.32, fontSize: 10, color: C.white, valign: "middle",
  });
}

// ─── SLIDE 8 — Muscle Spindle in Detail ──────────────────────────────────────
{
  const s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.navy } });
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.9, fill: { color: C.mid } });
  s.addText("MUSCLE SPINDLE — The Stretch Receptor", {
    x: 0.4, y: 0.1, w: 9, h: 0.7, fontSize: 22, bold: true, color: C.gold, valign: "middle",
  });

  const rows = [
    ["Component", "Fiber Type", "Function", "Innervation"],
    ["Nuclear Bag Fiber", "Intrafusal", "Detects VELOCITY of length change", "Group Ia (primary)"],
    ["Nuclear Chain Fiber", "Intrafusal", "Detects STATIC muscle length", "Group Ia (primary) + Group II (secondary)"],
    ["Extrafusal Fiber", "Main muscle fiber", "Generates force / contraction", "α-motoneurons"],
    ["γ Dynamic motoneuron", "Efferent", "Adjusts spindle sensitivity during contraction", "Synapses on nuclear bag"],
    ["γ Static motoneuron", "Efferent", "Adjusts baseline spindle sensitivity", "Synapses on nuclear chain"],
  ];

  const colW = [2.4, 1.8, 3.5, 2.0];
  const colX = [0.2, 2.65, 4.5, 8.05];
  const rowColors = [C.teal, C.mid, C.mid, C.mid, C.mid, C.mid];
  const headerTextColor = C.white;

  rows.forEach((row, ri) => {
    row.forEach((cell, ci) => {
      const y = 1.0 + ri * 0.75;
      s.addShape(pres.ShapeType.rect, {
        x: colX[ci], y, w: colW[ci], h: 0.72,
        fill: { color: ri === 0 ? C.teal : (ri % 2 === 0 ? C.mid : C.dark) },
        line: { color: C.navy, width: 0.5 },
      });
      s.addText(cell, {
        x: colX[ci] + 0.06, y: y + 0.05, w: colW[ci] - 0.12, h: 0.62,
        fontSize: ri === 0 ? 11 : 10.5,
        bold: ri === 0,
        color: ri === 0 ? headerTextColor : C.text,
        valign: "middle",
      });
    });
  });

  // Gamma co-activation note
  s.addShape(pres.ShapeType.rect, { x: 0.2, y: 5.55, w: 9.6, h: 0, fill: { color: C.teal } });
  s.addText("γ-coactivation: α and γ motoneurons are activated simultaneously, keeping spindle sensitive even as muscle shortens during contraction.", {
    x: 0.2, y: 5.23, w: 9.6, h: 0.38, fontSize: 10.5, color: C.gold, italic: true,
  });
}

// ─── SLIDE 9 — Golgi Tendon Reflex ───────────────────────────────────────────
{
  const s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.navy } });
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.9, fill: { color: C.mid } });
  s.addText("GOLGI TENDON REFLEX (Inverse Myotatic Reflex)", {
    x: 0.4, y: 0.1, w: 9, h: 0.7, fontSize: 20, bold: true, color: C.gold, valign: "middle",
  });

  // Tag
  s.addShape(pres.ShapeType.roundRect, { x: 0.3, y: 1.0, w: 2.4, h: 0.38, fill: { color: "7B2D8B" }, rectRadius: 0.06 });
  s.addText("DISYNAPTIC — 2 Synapses", { x: 0.3, y: 1.0, w: 2.4, h: 0.38, fontSize: 11, bold: true, color: C.white, align: "center", valign: "middle" });

  // Left panel - steps
  const steps = [
    ["STIMULUS", "Muscle CONTRACTS (shortens) → tension rises in tendon"],
    ["RECEPTOR", "Golgi tendon organ (GTO) in series with extrafusal fibers"],
    ["AFFERENT", "Group Ib fibers activated → enter spinal cord dorsal horn"],
    ["INTERNEURON", "Ib fibers synapse on INHIBITORY interneuron (1st synapse)"],
    ["EFFERENT", "Inhibitory interneuron → inhibits α-motoneurons (2nd synapse)"],
    ["RESULT", "Muscle RELAXES — prevents excessive force injury (clasp-knife)"],
  ];

  steps.forEach(([label, text], i) => {
    const y = 1.52 + i * 0.67;
    s.addShape(pres.ShapeType.roundRect, { x: 0.3, y, w: 5.8, h: 0.6, fill: { color: C.mid }, line: { color: "7B2D8B", width: 1 }, rectRadius: 0.05 });
    s.addText(label + ": ", { x: 0.45, y: y + 0.07, w: 1.5, h: 0.46, fontSize: 11, bold: true, color: "B86FCE", margin: 0, valign: "middle" });
    s.addText(text, { x: 1.9, y: y + 0.07, w: 4.1, h: 0.46, fontSize: 10.5, color: C.text, valign: "middle" });
  });

  // Right panel - comparison
  s.addShape(pres.ShapeType.roundRect, { x: 6.3, y: 1.0, w: 3.4, h: 4.5, fill: { color: C.mid }, line: { color: C.gold, width: 1.5 }, rectRadius: 0.08 });
  s.addShape(pres.ShapeType.rect, { x: 6.3, y: 1.0, w: 3.4, h: 0.45, fill: { color: C.gold } });
  s.addText("vs. STRETCH REFLEX", { x: 6.35, y: 1.02, w: 3.3, h: 0.41, fontSize: 11.5, bold: true, color: C.navy, align: "center", valign: "middle" });

  const compRows = [
    ["Feature", "Stretch", "Golgi"],
    ["Stimulus", "Stretch", "Contraction"],
    ["Receptor", "Spindle", "GTO"],
    ["Afferent", "Ia", "Ib"],
    ["Arrangement", "Parallel", "Series"],
    ["Synapses", "1", "2"],
    ["Interneuron", "None", "Inhibitory"],
    ["Effect", "Contract", "Relax"],
  ];
  compRows.forEach((row, ri) => {
    const y = 1.5 + ri * 0.48;
    row.forEach((cell, ci) => {
      s.addText(cell, {
        x: 6.35 + ci * 1.1, y: y + 0.04, w: 1.05, h: 0.4,
        fontSize: ri === 0 ? 10 : 9.5,
        bold: ri === 0,
        color: ri === 0 ? C.navy : (ci === 0 ? C.gold : C.text),
        align: "center", valign: "middle",
        fill: ri === 0 ? { color: C.gold } : undefined,
      });
    });
  });
}

// ─── SLIDE 10 — Flexor Withdrawal Reflex ─────────────────────────────────────
{
  const s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.navy } });
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.9, fill: { color: C.mid } });
  s.addText("FLEXOR-WITHDRAWAL REFLEX", {
    x: 0.4, y: 0.1, w: 9, h: 0.7, fontSize: 22, bold: true, color: C.gold, valign: "middle",
  });

  s.addShape(pres.ShapeType.roundRect, { x: 0.3, y: 1.0, w: 2.6, h: 0.38, fill: { color: "C44B36" }, rectRadius: 0.06 });
  s.addText("POLYSYNAPTIC — Many Synapses", { x: 0.3, y: 1.0, w: 2.6, h: 0.38, fontSize: 11, bold: true, color: C.white, align: "center", valign: "middle" });

  // Main features in 2 columns
  contentBox(s, 0.3, 1.5, 4.5, 3.9, "Mechanism", [
    "Stimulus: Nociceptive / thermal pain",
    "Afferent: Group II, III (Aδ), IV (C) fibers",
    "Multiple interneurons activated in spinal cord",
    "IPSILATERAL: Flexors contracted, extensors inhibited",
    "Result: Limb WITHDRAWS from painful stimulus",
    "Afterdischarge: Limb stays withdrawn briefly",
    "Critical function: PROTECTIVE reflex from injury",
  ], C.gold);

  contentBox(s, 5.0, 1.5, 4.7, 1.8, "Crossed-Extension Reflex", [
    "Occurs simultaneously with flexor withdrawal",
    "CONTRALATERAL limb: Extensors contract, flexors inhibited",
    "Purpose: Maintain balance while ipsilateral limb withdraws",
    "Example: Step on nail — left foot withdraws, right foot extends to bear weight",
  ], "FF8C42");

  contentBox(s, 5.0, 3.45, 4.7, 1.95, "Special Features", [
    "Irradiation: Spreads to multiple muscle groups",
    "Magnitude of response ∝ intensity of stimulus",
    "Afterdischarge: Neural circuits maintain response briefly",
    "Bilateral coordination via commissural interneurons",
  ], C.teal);
}

// ─── SLIDE 11 — Somatic vs Autonomic Reflexes ─────────────────────────────────
{
  const s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.navy } });
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.9, fill: { color: C.mid } });
  s.addText("SOMATIC vs. AUTONOMIC REFLEXES", {
    x: 0.4, y: 0.1, w: 9, h: 0.7, fontSize: 22, bold: true, color: C.gold, valign: "middle",
  });

  // Somatic
  s.addShape(pres.ShapeType.roundRect, { x: 0.3, y: 1.0, w: 4.4, h: 4.4, fill: { color: C.mid }, line: { color: C.teal, width: 2 }, rectRadius: 0.1 });
  s.addShape(pres.ShapeType.rect, { x: 0.3, y: 1.0, w: 4.4, h: 0.5, fill: { color: C.teal } });
  s.addText("SOMATIC REFLEXES", { x: 0.4, y: 1.02, w: 4.2, h: 0.46, fontSize: 14, bold: true, color: C.white, align: "center", valign: "middle" });

  const somaticItems = [
    "Effector: Skeletal muscle",
    "One efferent neuron (motoneuron to muscle)",
    "Always EXCITATORY at neuromuscular junction",
    "",
    "Examples:",
    "• Stretch reflex (knee jerk — L3, L4)",
    "• Biceps reflex (C5, C6)",
    "• Triceps reflex (C6, C7)",
    "• Ankle jerk (S1, S2)",
    "• Flexor-withdrawal reflex",
    "• Corneal blink reflex (CN V, VII)",
    "• Abdominal reflex (T8–T12)",
  ];
  s.addText(somaticItems.map((p, i) => ({ text: p, options: { bullet: !p.startsWith("•") && p !== "" && !p.startsWith("Examples"), fontSize: 10.5, color: p.startsWith("Examples") ? C.gold : C.text, bold: p.startsWith("Examples"), breakLine: i < somaticItems.length - 1 } })),
    { x: 0.5, y: 1.6, w: 4.0, h: 3.7 });

  // Autonomic
  s.addShape(pres.ShapeType.roundRect, { x: 5.3, y: 1.0, w: 4.4, h: 4.4, fill: { color: C.mid }, line: { color: "C44B36", width: 2 }, rectRadius: 0.1 });
  s.addShape(pres.ShapeType.rect, { x: 5.3, y: 1.0, w: 4.4, h: 0.5, fill: { color: "C44B36" } });
  s.addText("AUTONOMIC REFLEXES", { x: 5.4, y: 1.02, w: 4.2, h: 0.46, fontSize: 14, bold: true, color: C.white, align: "center", valign: "middle" });
  const autoItems = [
    "Effector: Smooth muscle, cardiac muscle, gland",
    "TWO efferent neurons: preganglionic + postganglionic",
    "Can be excitatory OR inhibitory",
    "",
    "Examples:",
    "• Pupillary light reflex (CN II → CN III)",
    "• Carotid sinus (baroreceptor) reflex",
    "• Micturition (urination) reflex",
    "• Defecation reflex",
    "• Cough & gag reflexes",
    "• Vomiting (emetic) reflex",
    "• Erection / ejaculation reflexes",
  ];
  s.addText(autoItems.map((p, i) => ({ text: p, options: { bullet: !p.startsWith("•") && p !== "" && !p.startsWith("Examples"), fontSize: 10.5, color: p.startsWith("Examples") ? C.gold : C.text, bold: p.startsWith("Examples"), breakLine: i < autoItems.length - 1 } })),
    { x: 5.5, y: 1.6, w: 4.0, h: 3.7 });
}

// ─── SLIDE 12 — Cranial Reflexes ──────────────────────────────────────────────
{
  const s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.navy } });
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.9, fill: { color: C.mid } });
  s.addText("CRANIAL (BRAINSTEM) REFLEXES", {
    x: 0.4, y: 0.1, w: 9, h: 0.7, fontSize: 22, bold: true, color: C.gold, valign: "middle",
  });

  const cranialReflexes = [
    { name: "Pupillary Light Reflex", cn: "CN II → CN III", desc: "Light → retina → optic nerve → Edinger-Westphal nucleus → ciliary ganglion → pupil constricts (both sides — consensual reflex)", segment: "Midbrain" },
    { name: "Corneal Blink Reflex", cn: "CN V → CN VII", desc: "Touch cornea → trigeminal sensory → CN VII nucleus → orbicularis oculi contracts → blink response", segment: "Pons" },
    { name: "Gag Reflex", cn: "CN IX → CN X", desc: "Posterior pharynx stimulation → glossopharyngeal → vagus → pharyngeal muscles contract", segment: "Medulla" },
    { name: "Jaw-Jerk Reflex", cn: "CN V → CN V", desc: "MONOSYNAPTIC cranial reflex — tap chin → stretches masseter → contracts masseter. Brisk = upper motor neuron lesion above pons", segment: "Pons" },
    { name: "Vestibulo-Ocular Reflex", cn: "CN VIII → CN III/IV/VI", desc: "Head rotation → semicircular canals → eye moves opposite direction to maintain visual fixation", segment: "Pons/Medulla" },
  ];

  cranialReflexes.forEach((r, i) => {
    const y = 1.0 + i * 0.9;
    s.addShape(pres.ShapeType.roundRect, { x: 0.3, y, w: 9.4, h: 0.82, fill: { color: C.mid }, line: { color: C.teal, width: 0.8 }, rectRadius: 0.05 });
    s.addShape(pres.ShapeType.rect, { x: 0.3, y, w: 2.5, h: 0.82, fill: { color: C.dark } });
    s.addText(r.name, { x: 0.38, y: y + 0.06, w: 2.35, h: 0.4, fontSize: 11, bold: true, color: C.gold, margin: 0 });
    s.addText(r.cn, { x: 0.38, y: y + 0.44, w: 2.35, h: 0.3, fontSize: 10, color: C.teal, italic: true });
    s.addShape(pres.ShapeType.roundRect, { x: 2.88, y: y + 0.15, w: 1.1, h: 0.52, fill: { color: C.teal }, rectRadius: 0.04 });
    s.addText(r.segment, { x: 2.88, y: y + 0.15, w: 1.1, h: 0.52, fontSize: 9.5, bold: true, color: C.white, align: "center", valign: "middle" });
    s.addText(r.desc, { x: 4.1, y: y + 0.1, w: 5.5, h: 0.64, fontSize: 10, color: C.text, valign: "middle" });
  });
}

// ─── SLIDE 13 — Deep Tendon Reflex Grading ────────────────────────────────────
{
  const s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.navy } });
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.9, fill: { color: C.mid } });
  s.addText("DEEP TENDON REFLEX GRADING (NIDSS Scale)", {
    x: 0.4, y: 0.1, w: 9, h: 0.7, fontSize: 20, bold: true, color: C.gold, valign: "middle",
  });

  const grades = [
    { grade: "0", label: "Absent", desc: "No response even with reinforcement (Jendrassik)", color: "C44B36", clinical: "LMN lesion, peripheral neuropathy, myopathy" },
    { grade: "1+", label: "Diminished", desc: "Reduced response, requires reinforcement to elicit", color: "D4704A", clinical: "LMN pathology, hypothyroidism, early neuropathy" },
    { grade: "2+", label: "Normal", desc: "Normal response — present, not exaggerated", color: "2E8B57", clinical: "Normal finding" },
    { grade: "3+", label: "Brisk", desc: "More brisk than normal, spreading to adjacent muscles", color: "E8A838", clinical: "May be normal or early UMN lesion" },
    { grade: "4+", label: "Very Brisk", desc: "Markedly exaggerated, clonus may be present", color: C.teal, clinical: "UMN lesion (stroke, myelopathy, MS)" },
  ];

  // Table header
  ["Grade", "Label", "Description", "Clinical Significance"].forEach((h, ci) => {
    const colX2 = [0.2, 1.05, 2.3, 6.3];
    const colW2 = [0.8, 1.2, 3.9, 3.45];
    s.addShape(pres.ShapeType.rect, { x: colX2[ci], y: 1.0, w: colW2[ci], h: 0.42, fill: { color: C.teal } });
    s.addText(h, { x: colX2[ci] + 0.05, y: 1.02, w: colW2[ci] - 0.1, h: 0.38, fontSize: 11, bold: true, color: C.white, valign: "middle" });
  });

  grades.forEach((g, i) => {
    const y = 1.45 + i * 0.8;
    const colX2 = [0.2, 1.05, 2.3, 6.3];
    const colW2 = [0.8, 1.2, 3.9, 3.45];
    const bg = i % 2 === 0 ? C.mid : C.dark;
    colX2.forEach((cx, ci) => {
      s.addShape(pres.ShapeType.rect, { x: cx, y, w: colW2[ci], h: 0.75, fill: { color: bg }, line: { color: C.navy, width: 0.5 } });
    });
    s.addShape(pres.ShapeType.ellipse, { x: 0.25, y: y + 0.13, w: 0.5, h: 0.5, fill: { color: g.color } });
    s.addText(g.grade, { x: 0.25, y: y + 0.13, w: 0.5, h: 0.5, fontSize: 13, bold: true, color: C.white, align: "center", valign: "middle" });
    s.addText(g.label, { x: colX2[1] + 0.06, y: y + 0.15, w: colW2[1] - 0.12, h: 0.45, fontSize: 11, bold: true, color: g.color, valign: "middle" });
    s.addText(g.desc, { x: colX2[2] + 0.06, y: y + 0.08, w: colW2[2] - 0.12, h: 0.62, fontSize: 10.5, color: C.text, valign: "middle" });
    s.addText(g.clinical, { x: colX2[3] + 0.06, y: y + 0.08, w: colW2[3] - 0.12, h: 0.62, fontSize: 10.5, color: C.text, valign: "middle" });
  });

  addBanner(s, "Jendrassik Maneuver: Ask patient to hook fingers and pull — reinforces reflex via descending facilitation. Use when reflex appears absent.");
}

// ─── SLIDE 14 — UMN vs LMN Lesions and Reflexes ──────────────────────────────
{
  const s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.navy } });
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.9, fill: { color: C.mid } });
  s.addText("UMN vs. LMN LESIONS — Reflex Changes", {
    x: 0.4, y: 0.1, w: 9, h: 0.7, fontSize: 22, bold: true, color: C.gold, valign: "middle",
  });

  // UMN Panel
  s.addShape(pres.ShapeType.roundRect, { x: 0.3, y: 1.0, w: 4.4, h: 4.4, fill: { color: C.mid }, line: { color: C.teal, width: 2 }, rectRadius: 0.1 });
  s.addShape(pres.ShapeType.rect, { x: 0.3, y: 1.0, w: 4.4, h: 0.5, fill: { color: C.teal } });
  s.addText("UPPER MOTOR NEURON (UMN)", { x: 0.4, y: 1.02, w: 4.2, h: 0.46, fontSize: 12.5, bold: true, color: C.white, align: "center", valign: "middle" });
  const umnItems = [
    "Location: Cortex → spinal cord (corticospinal tract)",
    "DTRs: HYPERREFLEXIA (exaggerated)",
    "Babinski sign: POSITIVE (extensor plantar response)",
    "Clonus: Present",
    "Tone: SPASTIC (increased)",
    "Weakness: Usually distal > proximal",
    "Muscle atrophy: Minimal (disuse only)",
    "Fasciculations: ABSENT",
    "Examples: Stroke, MS, spinal cord compression",
  ];
  s.addText(umnItems.map((p, i) => ({ text: p, options: { bullet: true, fontSize: 10.5, color: C.text, breakLine: i < umnItems.length - 1 } })),
    { x: 0.5, y: 1.6, w: 4.0, h: 3.7 });

  // LMN Panel
  s.addShape(pres.ShapeType.roundRect, { x: 5.3, y: 1.0, w: 4.4, h: 4.4, fill: { color: C.mid }, line: { color: "C44B36", width: 2 }, rectRadius: 0.1 });
  s.addShape(pres.ShapeType.rect, { x: 5.3, y: 1.0, w: 4.4, h: 0.5, fill: { color: "C44B36" } });
  s.addText("LOWER MOTOR NEURON (LMN)", { x: 5.4, y: 1.02, w: 4.2, h: 0.46, fontSize: 12.5, bold: true, color: C.white, align: "center", valign: "middle" });
  const lmnItems = [
    "Location: Anterior horn cell → muscle (final path)",
    "DTRs: HYPOREFLEXIA or ABSENT",
    "Babinski sign: NEGATIVE (normal flexor)",
    "Clonus: Absent",
    "Tone: FLACCID (decreased/absent)",
    "Weakness: Segmental distribution",
    "Muscle atrophy: SIGNIFICANT (denervation)",
    "Fasciculations: PRESENT (pathognomonic)",
    "Examples: Polio, GBS, ALS (mixed), disc herniation",
  ];
  s.addText(lmnItems.map((p, i) => ({ text: p, options: { bullet: true, fontSize: 10.5, color: C.text, breakLine: i < lmnItems.length - 1 } })),
    { x: 5.5, y: 1.6, w: 4.0, h: 3.7 });
}

// ─── SLIDE 15 — Summary ───────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.dark } });
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.08, fill: { color: C.gold } });
  s.addShape(pres.ShapeType.rect, { x: 0, y: 5.54, w: 10, h: 0.08, fill: { color: C.teal } });

  s.addText("SUMMARY — Classification of Reflexes", {
    x: 0.4, y: 0.15, w: 9.2, h: 0.72, fontSize: 22, bold: true, color: C.gold, valign: "middle", charSpacing: 1,
  });

  const summaryData = [
    {
      title: "Reflex Arc Components",
      color: C.teal,
      items: ["Receptor → Afferent nerve → Interneuron → Efferent nerve → Effector"],
    },
    {
      title: "Synaptic Complexity",
      color: C.gold,
      items: ["Monosynaptic: Stretch reflex (1 synapse)", "Disynaptic: Golgi tendon reflex (2 synapses)", "Polysynaptic: Flexor-withdrawal (many synapses)"],
    },
    {
      title: "Effector Type",
      color: "7B2D8B",
      items: ["Somatic: Skeletal muscle (single efferent neuron)", "Autonomic: Smooth/cardiac muscle & glands (2-neuron chain)"],
    },
    {
      title: "Reflex Center",
      color: "C44B36",
      items: ["Spinal reflexes: Integrated in spinal cord", "Cranial reflexes: Integrated in brainstem"],
    },
    {
      title: "Key Spinal Reflexes",
      color: "2E8B57",
      items: ["Stretch: Ia afferent → α-motoneuron (contract)", "Golgi tendon: Ib → inhibitory interneuron (relax)", "Withdrawal: Nociceptive → flex + crossed extension"],
    },
    {
      title: "Clinical Applications",
      color: "D4704A",
      items: ["DTR Grade 0-1+: LMN lesion (flaccid, atrophy, fasciculations)", "DTR Grade 3-4+: UMN lesion (spastic, Babinski+, clonus)"],
    },
  ];

  const positions = [
    [0.2, 0.98], [3.55, 0.98], [6.9, 0.98],
    [0.2, 3.1], [3.55, 3.1], [6.9, 3.1],
  ];

  summaryData.forEach((item, i) => {
    const [x, y] = positions[i];
    s.addShape(pres.ShapeType.roundRect, { x, y, w: 3.2, h: 1.98, fill: { color: C.mid }, line: { color: item.color, width: 1.5 }, rectRadius: 0.08 });
    s.addShape(pres.ShapeType.rect, { x, y, w: 3.2, h: 0.38, fill: { color: item.color } });
    s.addText(item.title, { x: x + 0.08, y: y + 0.04, w: 3.04, h: 0.3, fontSize: 11, bold: true, color: C.white, valign: "middle", margin: 0 });
    s.addText(item.items.map((p, j) => ({ text: p, options: { bullet: true, fontSize: 9.5, color: C.text, breakLine: j < item.items.length - 1 } })),
      { x: x + 0.12, y: y + 0.44, w: 2.96, h: 1.48 });
  });

  s.addText("Reference: Costanzo Physiology 7th Ed. | Kandel Principles of Neural Science 6th Ed. | Medical Physiology (Boron & Boulpaep)", {
    x: 0.2, y: 5.38, w: 9.6, h: 0.2, fontSize: 8.5, color: C.teal, align: "center", italic: true,
  });
}

// ─── Write file ───────────────────────────────────────────────────────────────
pres.writeFile({ fileName: "/home/daytona/workspace/reflex-classification-ppt/Reflex_Classification.pptx" })
  .then(() => console.log("SUCCESS: Reflex_Classification.pptx written"))
  .catch(e => { console.error("ERROR:", e); process.exit(1); });
Running Command

cd /home/daytona/workspace/reflex-classification-ppt && node build.js 2>&1

Running Command

ls -lh /home/daytona/workspace/reflex-classification-ppt/Reflex_Classification.p…

Your 15-slide presentation is ready:

Reflex Classification

Presentation · PPTX


Here is exactly what each slide covers:
#Slide Title
1Title Slide — Classification of Reflexes
2Learning Objectives (8 objectives)
3What is a Reflex? (definition + 4 key features)
4The Reflex Arc — 5 Components (receptor → effector)
5Classification Overview (by synapses, effector, location)
6Monosynaptic vs. Polysynaptic Reflexes
7Stretch Reflex (Myotatic) — step-by-step mechanism
8Muscle Spindle in Detail (nuclear bag, chain, γ-motoneurons)
9Golgi Tendon Reflex (Inverse Myotatic) + comparison table
10Flexor-Withdrawal Reflex + Crossed-Extension Reflex
11Somatic vs. Autonomic (Visceral) Reflexes
12Cranial/Brainstem Reflexes (pupillary, corneal, gag, jaw-jerk, VOR)
13Deep Tendon Reflex Grading (0 to 4+ scale with clinical meaning)
14UMN vs. LMN Lesions and their reflex changes
15Summary card — all classifications at a glance
The design uses a dark navy/teal/gold palette with labeled boxes, tables, and numbered sequences throughout. Content is sourced from Costanzo Physiology 7th Ed. and Kandel Principles of Neural Science 6th Ed.
This is a shared conversation. Sign in to Orris to start your own chat.