Muscle tone class predestination i want 15 slides matter

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

ls -la /home/daytona/workspace/ 2>/dev/null || mkdir -p /home/daytona/workspace

Running Command

mkdir -p /home/daytona/workspace/muscle-tone-ppt

Writing File

~/muscle-tone-ppt/create_pptx.js

const pptxgen = require("pptxgenjs");

const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Muscle Tone";
pres.author = "Medical Education";

// ─── Color Palette ───────────────────────────────────────────────────────────
const DARK_BG   = "0D1B2A";   // deep navy (dominant dark)
const MID_BG    = "1B3A5C";   // steel blue
const ACCENT    = "2ECC71";   // vivid green (accent)
const ACCENT2   = "F39C12";   // amber (secondary accent)
const LIGHT_TXT = "FFFFFF";
const SOFT_TXT  = "BFD7ED";
const DARK_TXT  = "0D1B2A";
const CARD_BG   = "163350";   // card background
const DIVIDER   = "2ECC71";

// ─── Helper: slide background ────────────────────────────────────────────────
function darkSlide(pres) {
  const s = pres.addSlide();
  s.background = { color: DARK_BG };
  return s;
}
function midSlide(pres) {
  const s = pres.addSlide();
  s.background = { color: MID_BG };
  return s;
}
function lightSlide(pres) {
  const s = pres.addSlide();
  s.background = { color: "EAF2FB" };
  return s;
}

// ─── Helper: section header bar ──────────────────────────────────────────────
function addTopBar(slide, color = ACCENT) {
  slide.addShape("rect", { x: 0, y: 0, w: 10, h: 0.12, fill: { color } });
}
function addBottomBar(slide, color = ACCENT) {
  slide.addShape("rect", { x: 0, y: 5.5, w: 10, h: 0.125, fill: { color } });
}

// ─── SLIDE 1: Title Slide ────────────────────────────────────────────────────
{
  const s = darkSlide(pres);
  // Top accent bar
  s.addShape("rect", { x: 0, y: 0, w: 10, h: 0.18, fill: { color: ACCENT } });
  // Left accent bar
  s.addShape("rect", { x: 0, y: 0, w: 0.22, h: 5.625, fill: { color: ACCENT } });
  // Decorative circle
  s.addShape("ellipse", { x: 6.8, y: 1.0, w: 3.5, h: 3.5, fill: { color: MID_BG }, line: { color: ACCENT, width: 3 } });
  s.addShape("ellipse", { x: 7.1, y: 1.3, w: 2.9, h: 2.9, fill: { color: DARK_BG }, line: { color: ACCENT2, width: 1.5 } });

  // Icon area text
  s.addText("💪", { x: 7.5, y: 2.0, w: 1.8, h: 1.8, fontSize: 60, align: "center", valign: "middle" });

  // Title
  s.addText("MUSCLE TONE", {
    x: 0.5, y: 1.2, w: 6.0, h: 1.2,
    fontSize: 46, bold: true, color: LIGHT_TXT,
    fontFace: "Calibri", align: "left", charSpacing: 4
  });
  // Subtitle
  s.addText("Physiology, Neural Control & Clinical Significance", {
    x: 0.5, y: 2.55, w: 6.0, h: 0.55,
    fontSize: 16, color: ACCENT, fontFace: "Calibri", align: "left", italic: true
  });
  // Divider line
  s.addShape("rect", { x: 0.5, y: 3.2, w: 5.5, h: 0.04, fill: { color: SOFT_TXT } });
  // Tagline
  s.addText("Understanding the foundation of posture, movement & neurological assessment", {
    x: 0.5, y: 3.35, w: 6.0, h: 0.7,
    fontSize: 12, color: SOFT_TXT, fontFace: "Calibri", align: "left"
  });
  // Bottom tag
  s.addText("Medical Physiology & Neurology", {
    x: 0.5, y: 5.1, w: 4.0, h: 0.35,
    fontSize: 11, color: ACCENT2, fontFace: "Calibri", align: "left"
  });
}

// ─── SLIDE 2: Overview / Outline ─────────────────────────────────────────────
{
  const s = midSlide(pres);
  addTopBar(s);
  addBottomBar(s);

  s.addText("OVERVIEW", {
    x: 0.5, y: 0.25, w: 9, h: 0.5,
    fontSize: 11, color: ACCENT, bold: true, charSpacing: 5, fontFace: "Calibri"
  });
  s.addText("Topics Covered", {
    x: 0.5, y: 0.8, w: 9, h: 0.6,
    fontSize: 28, bold: true, color: LIGHT_TXT, fontFace: "Calibri"
  });

  const topics = [
    ["01", "Definition & Concept of Muscle Tone"],
    ["02", "Structural Basis – Muscle Spindle & Golgi Tendon Organ"],
    ["03", "Neural Control – Alpha & Gamma Motor Neurons"],
    ["04", "Stretch Reflex & Gamma Loop"],
    ["05", "Central Nervous System Influences"],
    ["06", "Classification: Normotonia, Hypertonia, Hypotonia"],
    ["07", "Hypertonia – Spasticity"],
    ["08", "Hypertonia – Rigidity"],
    ["09", "Hypotonia – Causes & Features"],
    ["10", "Clinical Assessment of Muscle Tone"],
    ["11", "UMN vs LMN Lesions & Tone"],
    ["12", "Clasp-Knife vs Lead-Pipe Phenomenon"],
    ["13", "Clonus & Hyperreflexia"],
    ["14", "Tone in Special Conditions"],
    ["15", "Summary & Clinical Pearls"],
  ];

  // Two columns
  const col1 = topics.slice(0, 8);
  const col2 = topics.slice(8);

  col1.forEach((t, i) => {
    s.addShape("rect", { x: 0.4, y: 1.55 + i * 0.47, w: 0.38, h: 0.32, fill: { color: ACCENT }, rounding: "0.1" });
    s.addText(t[0], { x: 0.4, y: 1.55 + i * 0.47, w: 0.38, h: 0.32, fontSize: 9, bold: true, color: DARK_TXT, align: "center", valign: "middle" });
    s.addText(t[1], { x: 0.86, y: 1.56 + i * 0.47, w: 4.2, h: 0.3, fontSize: 12, color: LIGHT_TXT, fontFace: "Calibri" });
  });

  col2.forEach((t, i) => {
    s.addShape("rect", { x: 5.2, y: 1.55 + i * 0.47, w: 0.38, h: 0.32, fill: { color: ACCENT2 }, rounding: "0.1" });
    s.addText(t[0], { x: 5.2, y: 1.55 + i * 0.47, w: 0.38, h: 0.32, fontSize: 9, bold: true, color: DARK_TXT, align: "center", valign: "middle" });
    s.addText(t[1], { x: 5.66, y: 1.56 + i * 0.47, w: 4.0, h: 0.3, fontSize: 12, color: LIGHT_TXT, fontFace: "Calibri" });
  });
}

// ─── SLIDE 3: Definition ─────────────────────────────────────────────────────
{
  const s = darkSlide(pres);
  addTopBar(s);
  addBottomBar(s);

  s.addText("01 — DEFINITION", {
    x: 0.5, y: 0.2, w: 9, h: 0.4,
    fontSize: 10, color: ACCENT, bold: true, charSpacing: 4, fontFace: "Calibri"
  });
  s.addText("Definition & Concept of Muscle Tone", {
    x: 0.5, y: 0.6, w: 9, h: 0.65,
    fontSize: 28, bold: true, color: LIGHT_TXT, fontFace: "Calibri"
  });

  // Big quote box
  s.addShape("rect", { x: 0.5, y: 1.4, w: 9, h: 1.2, fill: { color: CARD_BG }, line: { color: ACCENT, width: 2 } });
  s.addText('"The resistance of a muscle to passive stretch — reflecting the background level of continuous, low-grade activation maintained in skeletal muscle."', {
    x: 0.7, y: 1.5, w: 8.6, h: 1.0,
    fontSize: 15, italic: true, color: ACCENT, fontFace: "Calibri", align: "center", valign: "middle"
  });

  const points = [
    "Muscle tone is present even at rest — the muscle is never completely electrically silent",
    "It is produced by a low-frequency, asynchronous discharge of alpha motor neurons",
    "The term 'tonus' comes from Greek — meaning tension or sustained contraction",
    "Clinically tone is assessed by resistance to passive movement of a limb",
    "Normal tone keeps posture upright without conscious effort",
    "Tone differs from strength: tone = resting state; strength = voluntary contraction",
  ];

  points.forEach((p, i) => {
    s.addShape("ellipse", { x: 0.5, y: 2.78 + i * 0.44, w: 0.22, h: 0.22, fill: { color: ACCENT } });
    s.addText(p, { x: 0.82, y: 2.75 + i * 0.44, w: 8.8, h: 0.32, fontSize: 13, color: SOFT_TXT, fontFace: "Calibri" });
  });
}

// ─── SLIDE 4: Structural Basis ────────────────────────────────────────────────
{
  const s = lightSlide(pres);
  addTopBar(s, MID_BG);
  addBottomBar(s, MID_BG);

  s.addText("02 — STRUCTURAL BASIS", {
    x: 0.5, y: 0.2, w: 9, h: 0.4,
    fontSize: 10, color: MID_BG, bold: true, charSpacing: 4, fontFace: "Calibri"
  });
  s.addText("Muscle Spindle & Golgi Tendon Organ", {
    x: 0.5, y: 0.6, w: 9, h: 0.65,
    fontSize: 26, bold: true, color: DARK_TXT, fontFace: "Calibri"
  });

  // Left card - Muscle Spindle
  s.addShape("rect", { x: 0.3, y: 1.45, w: 4.5, h: 3.8, fill: { color: "D6EAF8" }, line: { color: MID_BG, width: 1.5 } });
  s.addShape("rect", { x: 0.3, y: 1.45, w: 4.5, h: 0.45, fill: { color: MID_BG } });
  s.addText("MUSCLE SPINDLE (Intrafusal Fiber)", {
    x: 0.4, y: 1.47, w: 4.3, h: 0.4,
    fontSize: 12, bold: true, color: LIGHT_TXT, fontFace: "Calibri", align: "center"
  });
  const spindlePoints = [
    "Specialized sensory receptor within the muscle belly",
    "Contains intrafusal muscle fibers (nuclear bag & chain)",
    "Innervated by Ia (primary) & II (secondary) afferents",
    "Detects CHANGES in muscle length (stretch)",
    "Gamma motor neurons adjust spindle sensitivity",
    "Responds to both rate of change and absolute length",
    "Activated when muscle is stretched → reflex contraction",
  ];
  spindlePoints.forEach((p, i) => {
    s.addText("• " + p, {
      x: 0.45, y: 2.0 + i * 0.43, w: 4.25, h: 0.38,
      fontSize: 11.5, color: DARK_TXT, fontFace: "Calibri"
    });
  });

  // Right card - GTO
  s.addShape("rect", { x: 5.2, y: 1.45, w: 4.5, h: 3.8, fill: { color: "FDEBD0" }, line: { color: ACCENT2, width: 1.5 } });
  s.addShape("rect", { x: 5.2, y: 1.45, w: 4.5, h: 0.45, fill: { color: ACCENT2 } });
  s.addText("GOLGI TENDON ORGAN (GTO)", {
    x: 5.3, y: 1.47, w: 4.3, h: 0.4,
    fontSize: 12, bold: true, color: DARK_TXT, fontFace: "Calibri", align: "center"
  });
  const gtoPoints = [
    "Located at the musculotendinous junction",
    "Innervated by Ib afferent fibers",
    "Detects TENSION (force) generated by contraction",
    "Triggers inhibition of agonist muscle (inverse stretch reflex)",
    "Prevents excessive force → protects tendons",
    "Activated by active contraction more than passive stretch",
    "Mediates the 'clasp-knife' relaxation phenomenon",
  ];
  gtoPoints.forEach((p, i) => {
    s.addText("• " + p, {
      x: 5.35, y: 2.0 + i * 0.43, w: 4.25, h: 0.38,
      fontSize: 11.5, color: DARK_TXT, fontFace: "Calibri"
    });
  });
}

// ─── SLIDE 5: Neural Control ──────────────────────────────────────────────────
{
  const s = darkSlide(pres);
  addTopBar(s);
  addBottomBar(s);

  s.addText("03 — NEURAL CONTROL", {
    x: 0.5, y: 0.2, w: 9, h: 0.4,
    fontSize: 10, color: ACCENT, bold: true, charSpacing: 4, fontFace: "Calibri"
  });
  s.addText("Alpha & Gamma Motor Neurons", {
    x: 0.5, y: 0.6, w: 9, h: 0.65,
    fontSize: 28, bold: true, color: LIGHT_TXT, fontFace: "Calibri"
  });

  // Alpha MN card
  s.addShape("rect", { x: 0.3, y: 1.45, w: 4.5, h: 3.8, fill: { color: CARD_BG }, line: { color: ACCENT, width: 1.5 } });
  s.addShape("rect", { x: 0.3, y: 1.45, w: 4.5, h: 0.4, fill: { color: ACCENT } });
  s.addText("α (Alpha) Motor Neurons", {
    x: 0.35, y: 1.47, w: 4.4, h: 0.38,
    fontSize: 13, bold: true, color: DARK_TXT, align: "center", fontFace: "Calibri"
  });
  const alphaPts = [
    "Large myelinated neurons — fastest conduction",
    "Innervate extrafusal (working) muscle fibers",
    "Direct producers of muscle force",
    "Located in the anterior horn of spinal cord",
    "Receive inputs from: cortex, brainstem, Ia afferents, interneurons",
    "Low-frequency tonic discharge → resting muscle tone",
    "High-frequency phasic discharge → voluntary contraction",
  ];
  alphaPts.forEach((p, i) => {
    s.addText("→ " + p, {
      x: 0.45, y: 2.0 + i * 0.43, w: 4.25, h: 0.38,
      fontSize: 11.5, color: SOFT_TXT, fontFace: "Calibri"
    });
  });

  // Gamma MN card
  s.addShape("rect", { x: 5.2, y: 1.45, w: 4.5, h: 3.8, fill: { color: CARD_BG }, line: { color: ACCENT2, width: 1.5 } });
  s.addShape("rect", { x: 5.2, y: 1.45, w: 4.5, h: 0.4, fill: { color: ACCENT2 } });
  s.addText("γ (Gamma) Motor Neurons", {
    x: 5.25, y: 1.47, w: 4.4, h: 0.38,
    fontSize: 13, bold: true, color: DARK_TXT, align: "center", fontFace: "Calibri"
  });
  const gammaPts = [
    "Small neurons — slower conduction velocity",
    "Innervate intrafusal (spindle) muscle fibers",
    "Do NOT directly generate external muscle force",
    "Regulate the SENSITIVITY of muscle spindles",
    "Maintain spindle sensitivity during contraction",
    "High γ discharge → spindle taut → hyperactive reflexes",
    "Low γ discharge → spindle slack → reduced tone",
  ];
  gammaPts.forEach((p, i) => {
    s.addText("→ " + p, {
      x: 5.35, y: 2.0 + i * 0.43, w: 4.25, h: 0.38,
      fontSize: 11.5, color: SOFT_TXT, fontFace: "Calibri"
    });
  });
}

// ─── SLIDE 6: Stretch Reflex & Gamma Loop ────────────────────────────────────
{
  const s = midSlide(pres);
  addTopBar(s, ACCENT2);
  addBottomBar(s, ACCENT2);

  s.addText("04 — STRETCH REFLEX", {
    x: 0.5, y: 0.2, w: 9, h: 0.4,
    fontSize: 10, color: ACCENT2, bold: true, charSpacing: 4, fontFace: "Calibri"
  });
  s.addText("Stretch Reflex Arc & Gamma Loop", {
    x: 0.5, y: 0.6, w: 9, h: 0.65,
    fontSize: 28, bold: true, color: LIGHT_TXT, fontFace: "Calibri"
  });

  // Flow boxes
  const steps = [
    { label: "STRETCH", sub: "Muscle lengthened\n(passive or active)", col: ACCENT },
    { label: "Ia AFFERENT", sub: "Spindle → spinal cord\n(monosynaptic)", col: "3498DB" },
    { label: "α MOTOR\nNEURON", sub: "Anterior horn\nactivation", col: ACCENT2 },
    { label: "MUSCLE\nCONTRACTION", sub: "Opposes\nstretch", col: "E74C3C" },
  ];

  steps.forEach((st, i) => {
    s.addShape("rect", { x: 0.35 + i * 2.4, y: 1.55, w: 2.0, h: 1.3, fill: { color: st.col }, rounding: "0.15" });
    s.addText(st.label, {
      x: 0.35 + i * 2.4, y: 1.6, w: 2.0, h: 0.55,
      fontSize: 13, bold: true, color: LIGHT_TXT, align: "center", fontFace: "Calibri"
    });
    s.addText(st.sub, {
      x: 0.35 + i * 2.4, y: 2.15, w: 2.0, h: 0.6,
      fontSize: 10, color: LIGHT_TXT, align: "center", fontFace: "Calibri"
    });
    if (i < 3) {
      s.addText("→", { x: 2.38 + i * 2.4, y: 1.85, w: 0.35, h: 0.7, fontSize: 28, color: LIGHT_TXT, align: "center", bold: true });
    }
  });

  // Gamma loop section
  s.addShape("rect", { x: 0.3, y: 3.15, w: 9.4, h: 0.4, fill: { color: DARK_BG } });
  s.addText("THE GAMMA LOOP", {
    x: 0.3, y: 3.15, w: 9.4, h: 0.4,
    fontSize: 12, bold: true, color: ACCENT2, align: "center", fontFace: "Calibri", charSpacing: 3
  });

  const gammaLoop = [
    "CNS descending signals activate γ motor neurons (co-activation with α)",
    "γ neurons contract intrafusal fibers → spindle stays taut during muscle shortening",
    "This preserves spindle sensitivity even as the whole muscle contracts",
    "Result: spindle can continue signaling stretch even mid-contraction",
    "Dysfunction of γ loop → flaccidity (low) or hypertonicity (high)",
  ];
  gammaLoop.forEach((p, i) => {
    s.addText("▸ " + p, {
      x: 0.45, y: 3.65 + i * 0.36, w: 9.1, h: 0.32,
      fontSize: 12.5, color: SOFT_TXT, fontFace: "Calibri"
    });
  });
}

// ─── SLIDE 7: CNS Influences ──────────────────────────────────────────────────
{
  const s = darkSlide(pres);
  addTopBar(s, ACCENT2);
  addBottomBar(s, ACCENT2);

  s.addText("05 — CNS INFLUENCES", {
    x: 0.5, y: 0.2, w: 9, h: 0.4,
    fontSize: 10, color: ACCENT2, bold: true, charSpacing: 4
  });
  s.addText("Central Nervous System Control of Muscle Tone", {
    x: 0.5, y: 0.6, w: 9, h: 0.65,
    fontSize: 26, bold: true, color: LIGHT_TXT, fontFace: "Calibri"
  });

  const cnsData = [
    { center: "Cerebral Cortex", effect: "Inhibitory (via corticospinal tract)", detail: "Lesion → spasticity (disinhibition of stretch reflexes)" },
    { center: "Basal Ganglia", effect: "Modulates/inhibitory", detail: "Lesion → rigidity & bradykinesia (Parkinson disease)" },
    { center: "Cerebellum", effect: "Inhibitory (via Purkinje cells)", detail: "Lesion → hypotonia, ataxia, decomposition of movement" },
    { center: "Reticular Formation", effect: "Dual (pontine excites; medullary inhibits)", detail: "Reticulospinal tracts fine-tune postural tone" },
    { center: "Vestibular Nuclei", effect: "Excitatory (via vestibulospinal tract)", detail: "Maintains extensor tone for upright posture" },
    { center: "Spinal Cord", effect: "Local segmental reflex arc", detail: "Final common pathway; integrates all signals" },
  ];

  cnsData.forEach((d, i) => {
    const y = 1.45 + i * 0.68;
    s.addShape("rect", { x: 0.3, y, w: 2.5, h: 0.55, fill: { color: CARD_BG }, line: { color: ACCENT2, width: 1 } });
    s.addText(d.center, { x: 0.35, y: y + 0.05, w: 2.4, h: 0.45, fontSize: 12, bold: true, color: ACCENT2, align: "center", fontFace: "Calibri" });

    s.addShape("rect", { x: 2.9, y, w: 2.8, h: 0.55, fill: { color: CARD_BG }, line: { color: ACCENT, width: 1 } });
    s.addText(d.effect, { x: 2.95, y: y + 0.05, w: 2.7, h: 0.45, fontSize: 11, color: ACCENT, align: "center", fontFace: "Calibri" });

    s.addShape("rect", { x: 5.8, y, w: 4.1, h: 0.55, fill: { color: "112233" } });
    s.addText(d.detail, { x: 5.9, y: y + 0.05, w: 3.9, h: 0.45, fontSize: 11, color: SOFT_TXT, fontFace: "Calibri" });
  });

  // Column headers
  s.addText("CNS CENTER", { x: 0.3, y: 1.3, w: 2.5, h: 0.3, fontSize: 10, bold: true, color: ACCENT2, align: "center" });
  s.addText("NET EFFECT", { x: 2.9, y: 1.3, w: 2.8, h: 0.3, fontSize: 10, bold: true, color: ACCENT, align: "center" });
  s.addText("CLINICAL SIGNIFICANCE", { x: 5.8, y: 1.3, w: 4.1, h: 0.3, fontSize: 10, bold: true, color: SOFT_TXT, align: "center" });
}

// ─── SLIDE 8: Classification ──────────────────────────────────────────────────
{
  const s = lightSlide(pres);
  addTopBar(s, MID_BG);
  addBottomBar(s, MID_BG);

  s.addText("06 — CLASSIFICATION", {
    x: 0.5, y: 0.2, w: 9, h: 0.4,
    fontSize: 10, color: MID_BG, bold: true, charSpacing: 4
  });
  s.addText("Types of Muscle Tone", {
    x: 0.5, y: 0.6, w: 9, h: 0.65,
    fontSize: 28, bold: true, color: DARK_TXT, fontFace: "Calibri"
  });

  const types = [
    {
      name: "NORMOTONIA", emoji: "✅", bg: "D5F5E3", border: "27AE60",
      def: "Normal resting muscle tone",
      features: [
        "Smooth, moderate resistance to passive movement",
        "Resistance is VELOCITY-INDEPENDENT",
        "Muscle is neither floppy nor rigid",
        "Normal tendon reflexes (grade 2+)",
        "Good postural control"
      ]
    },
    {
      name: "HYPERTONIA", emoji: "⬆️", bg: "FDEBD0", border: "E67E22",
      def: "Increased resistance to passive movement",
      features: [
        "Two main types: Spasticity & Rigidity",
        "UMN or extrapyramidal lesion",
        "Enhanced stretch reflexes (hyperreflexia)",
        "May impair voluntary movement",
        "Leads to contractures if untreated"
      ]
    },
    {
      name: "HYPOTONIA", emoji: "⬇️", bg: "D6EAF8", border: "2980B9",
      def: "Decreased resistance — 'floppy' muscle",
      features: [
        "LMN lesion, cerebellar, or early UMN injury",
        "Reduced or absent tendon reflexes",
        "Muscle feels soft and doughy",
        "Joints hyperextensible passively",
        "Seen in infants — 'floppy baby' syndrome"
      ]
    },
  ];

  types.forEach((t, i) => {
    const x = 0.25 + i * 3.25;
    s.addShape("rect", { x, y: 1.5, w: 3.05, h: 3.75, fill: { color: t.bg }, line: { color: t.border, width: 2 } });
    s.addShape("rect", { x, y: 1.5, w: 3.05, h: 0.52, fill: { color: t.border } });
    s.addText(t.emoji + " " + t.name, {
      x: x + 0.05, y: 1.52, w: 2.95, h: 0.48,
      fontSize: 13, bold: true, color: LIGHT_TXT, align: "center", fontFace: "Calibri"
    });
    s.addText(t.def, {
      x: x + 0.1, y: 2.1, w: 2.85, h: 0.45,
      fontSize: 11, italic: true, color: DARK_TXT, align: "center", fontFace: "Calibri"
    });
    s.addShape("rect", { x: x + 0.1, y: 2.6, w: 2.85, h: 0.04, fill: { color: t.border } });
    t.features.forEach((f, j) => {
      s.addText("• " + f, {
        x: x + 0.1, y: 2.72 + j * 0.43, w: 2.85, h: 0.38,
        fontSize: 11, color: DARK_TXT, fontFace: "Calibri"
      });
    });
  });
}

// ─── SLIDE 9: Spasticity ──────────────────────────────────────────────────────
{
  const s = darkSlide(pres);
  addTopBar(s, "E74C3C");
  addBottomBar(s, "E74C3C");

  s.addText("07 — HYPERTONIA (I)", {
    x: 0.5, y: 0.2, w: 9, h: 0.4,
    fontSize: 10, color: "E74C3C", bold: true, charSpacing: 4
  });
  s.addText("Spasticity", {
    x: 0.5, y: 0.6, w: 9, h: 0.65,
    fontSize: 34, bold: true, color: LIGHT_TXT, fontFace: "Calibri"
  });

  // Definition box
  s.addShape("rect", { x: 0.3, y: 1.4, w: 9.4, h: 0.7, fill: { color: "E74C3C" } });
  s.addText('Velocity-dependent increase in tonic stretch reflexes — due to UPPER MOTOR NEURON (corticospinal tract) lesion', {
    x: 0.5, y: 1.45, w: 9.0, h: 0.6,
    fontSize: 14, color: LIGHT_TXT, bold: true, align: "center", fontFace: "Calibri"
  });

  const spastCol1 = [
    ["Pathophysiology", "Loss of cortical inhibition → hyperactive Ia-mediated stretch reflex"],
    ["Distribution", "Upper limb: flexors dominant; Lower limb: extensors dominant"],
    ["Velocity Dependent", "Resistance INCREASES with faster passive movement"],
    ["Clasp-Knife Sign", "Initial resistance then sudden release (GTO-mediated)"],
  ];
  const spastCol2 = [
    ["Reflexes", "Hyperreflexia, clonus, Babinski sign positive"],
    ["Onset", "After spinal shock phase following acute UMN lesion"],
    ["Common Causes", "Stroke, spinal cord injury, cerebral palsy, MS"],
    ["Treatment", "Baclofen, tizanidine, botulinum toxin, physio"],
  ];

  spastCol1.forEach((item, i) => {
    s.addShape("rect", { x: 0.3, y: 2.3 + i * 0.72, w: 2.0, h: 0.6, fill: { color: "E74C3C" } });
    s.addText(item[0], { x: 0.3, y: 2.32 + i * 0.72, w: 2.0, h: 0.56, fontSize: 11, bold: true, color: LIGHT_TXT, align: "center", fontFace: "Calibri" });
    s.addShape("rect", { x: 2.35, y: 2.3 + i * 0.72, w: 2.35, h: 0.6, fill: { color: CARD_BG } });
    s.addText(item[1], { x: 2.4, y: 2.32 + i * 0.72, w: 2.25, h: 0.56, fontSize: 11, color: SOFT_TXT, fontFace: "Calibri" });
  });

  spastCol2.forEach((item, i) => {
    s.addShape("rect", { x: 5.0, y: 2.3 + i * 0.72, w: 2.0, h: 0.6, fill: { color: "C0392B" } });
    s.addText(item[0], { x: 5.0, y: 2.32 + i * 0.72, w: 2.0, h: 0.56, fontSize: 11, bold: true, color: LIGHT_TXT, align: "center", fontFace: "Calibri" });
    s.addShape("rect", { x: 7.05, y: 2.3 + i * 0.72, w: 2.6, h: 0.6, fill: { color: CARD_BG } });
    s.addText(item[1], { x: 7.1, y: 2.32 + i * 0.72, w: 2.5, h: 0.56, fontSize: 11, color: SOFT_TXT, fontFace: "Calibri" });
  });
}

// ─── SLIDE 10: Rigidity ───────────────────────────────────────────────────────
{
  const s = darkSlide(pres);
  addTopBar(s, ACCENT2);
  addBottomBar(s, ACCENT2);

  s.addText("08 — HYPERTONIA (II)", {
    x: 0.5, y: 0.2, w: 9, h: 0.4,
    fontSize: 10, color: ACCENT2, bold: true, charSpacing: 4
  });
  s.addText("Rigidity", {
    x: 0.5, y: 0.6, w: 9, h: 0.65,
    fontSize: 34, bold: true, color: LIGHT_TXT, fontFace: "Calibri"
  });

  s.addShape("rect", { x: 0.3, y: 1.4, w: 9.4, h: 0.7, fill: { color: ACCENT2 } });
  s.addText('Velocity-INDEPENDENT increased resistance to passive movement — due to EXTRAPYRAMIDAL (basal ganglia) lesion', {
    x: 0.5, y: 1.45, w: 9.0, h: 0.6,
    fontSize: 14, color: DARK_TXT, bold: true, align: "center", fontFace: "Calibri"
  });

  const rigData = [
    ["Type: Lead Pipe", "Continuous uniform resistance throughout full ROM — like bending a lead pipe"],
    ["Type: Cogwheel", "Ratchet-like intermittent resistance — tremor superimposed on rigidity"],
    ["Velocity Dependence", "DOES NOT increase with velocity (distinguishes from spasticity)"],
    ["Distribution", "Affects both flexor AND extensor groups; tends toward flexed posture"],
    ["Reflexes", "Tendon reflexes are NOT enhanced (unlike spasticity)"],
    ["Pathology", "Extrapyramidal — basal ganglia: Parkinson disease, Wilson disease, drug-induced"],
    ["Paratonia", "Gegenhalten — patient resists all passive movements equally (frontal lobe lesion)"],
  ];

  rigData.forEach((d, i) => {
    s.addShape("rect", { x: 0.3, y: 2.25 + i * 0.46, w: 2.2, h: 0.38, fill: { color: ACCENT2 } });
    s.addText(d[0], { x: 0.35, y: 2.27 + i * 0.46, w: 2.1, h: 0.34, fontSize: 11, bold: true, color: DARK_TXT, align: "center", fontFace: "Calibri" });
    s.addText(d[1], { x: 2.65, y: 2.27 + i * 0.46, w: 7.0, h: 0.34, fontSize: 12, color: SOFT_TXT, fontFace: "Calibri" });
  });
}

// ─── SLIDE 11: Hypotonia ──────────────────────────────────────────────────────
{
  const s = midSlide(pres);
  addTopBar(s, "3498DB");
  addBottomBar(s, "3498DB");

  s.addText("09 — HYPOTONIA", {
    x: 0.5, y: 0.2, w: 9, h: 0.4,
    fontSize: 10, color: "3498DB", bold: true, charSpacing: 4
  });
  s.addText("Hypotonia — Causes & Features", {
    x: 0.5, y: 0.6, w: 9, h: 0.65,
    fontSize: 28, bold: true, color: LIGHT_TXT, fontFace: "Calibri"
  });

  s.addShape("rect", { x: 0.3, y: 1.4, w: 9.4, h: 0.6, fill: { color: "2471A3" } });
  s.addText("Decreased resistance to passive movement — muscle feels soft, floppy, and overly compliant", {
    x: 0.45, y: 1.45, w: 9.0, h: 0.5,
    fontSize: 14, color: LIGHT_TXT, italic: true, align: "center", fontFace: "Calibri"
  });

  // Features column
  s.addText("Clinical Features", {
    x: 0.3, y: 2.1, w: 4.5, h: 0.4,
    fontSize: 14, bold: true, color: "3498DB", fontFace: "Calibri"
  });
  const features = [
    "Limb feels floppy and offers no resistance to passive movement",
    "Joints passively hyperextensible",
    "Muscle bulk may be reduced (atrophy in chronic LMN)",
    "Reduced or absent deep tendon reflexes (hyporeflexia / areflexia)",
    "Infant: 'floppy baby' — slip-through sign on axillary suspension",
    "Posture: limbs hang loosely in gravity-dependent positions",
  ];
  features.forEach((f, i) => {
    s.addShape("ellipse", { x: 0.3, y: 2.62 + i * 0.46, w: 0.2, h: 0.2, fill: { color: "3498DB" } });
    s.addText(f, { x: 0.6, y: 2.6 + i * 0.46, w: 4.3, h: 0.4, fontSize: 12, color: SOFT_TXT, fontFace: "Calibri" });
  });

  // Causes column
  s.addText("Common Causes", {
    x: 5.2, y: 2.1, w: 4.5, h: 0.4,
    fontSize: 14, bold: true, color: ACCENT2, fontFace: "Calibri"
  });
  const causes = [
    ["LMN Lesion", "Peripheral nerve, anterior horn cell"],
    ["Cerebellar", "Cerebellar lesion → hypotonia + ataxia"],
    ["Acute UMN", "Spinal shock phase after cord injury"],
    ["Muscle Disease", "Muscular dystrophy, myopathy"],
    ["Neuromuscular Jn", "Myasthenia gravis, botulism"],
    ["Metabolic", "Hypothyroidism, electrolyte disturbance"],
  ];
  causes.forEach((c, i) => {
    s.addShape("rect", { x: 5.2, y: 2.6 + i * 0.46, w: 1.7, h: 0.36, fill: { color: ACCENT2 } });
    s.addText(c[0], { x: 5.2, y: 2.62 + i * 0.46, w: 1.7, h: 0.32, fontSize: 10.5, bold: true, color: DARK_TXT, align: "center", fontFace: "Calibri" });
    s.addText(c[1], { x: 7.0, y: 2.62 + i * 0.46, w: 2.7, h: 0.32, fontSize: 11, color: SOFT_TXT, fontFace: "Calibri" });
  });
}

// ─── SLIDE 12: Clinical Assessment ───────────────────────────────────────────
{
  const s = darkSlide(pres);
  addTopBar(s, ACCENT);
  addBottomBar(s, ACCENT);

  s.addText("10 — ASSESSMENT", {
    x: 0.5, y: 0.2, w: 9, h: 0.4,
    fontSize: 10, color: ACCENT, bold: true, charSpacing: 4
  });
  s.addText("Clinical Assessment of Muscle Tone", {
    x: 0.5, y: 0.6, w: 9, h: 0.65,
    fontSize: 26, bold: true, color: LIGHT_TXT, fontFace: "Calibri"
  });

  const steps = [
    {
      num: "1", title: "Inspection",
      text: "Observe resting posture. Spastic upper limb: flexed arm, extended leg. Hypotonic: limbs hang loosely."
    },
    {
      num: "2", title: "Palpation",
      text: "Feel the muscle at rest. Hypertonic muscles feel firm; hypotonic muscles feel soft and doughy."
    },
    {
      num: "3", title: "Passive Resistance",
      text: "Move the joint through full ROM. Ask patient: 'Don't help or resist — just let go.' Note velocity dependence."
    },
    {
      num: "4", title: "Velocity Test",
      text: "Perform slow then rapid passive movement. Spasticity increases with speed; rigidity does not change."
    },
    {
      num: "5", title: "Leg Drop Test",
      text: "Supine: lift knee and briskly flex hip. In spasticity, heel lifts off table. Normally heel stays down."
    },
    {
      num: "6", title: "Pendulum Test",
      text: "Seated, let leg swing freely. Hypotonic: swings many times. Hypertonic: stops quickly after 1-2 swings."
    },
    {
      num: "7", title: "Reflexes",
      text: "Tendon reflexes supplement tone assessment: hyperreflexia (UMN), hyporeflexia/areflexia (LMN/cerebellar)."
    },
  ];

  steps.forEach((st, i) => {
    const row = Math.floor(i / 4);
    const col = i % 4;
    if (i < 4) {
      s.addShape("ellipse", { x: 0.25 + col * 2.4, y: 1.45, w: 0.42, h: 0.42, fill: { color: ACCENT } });
      s.addText(st.num, { x: 0.25 + col * 2.4, y: 1.45, w: 0.42, h: 0.42, fontSize: 14, bold: true, color: DARK_TXT, align: "center", valign: "middle" });
      s.addShape("rect", { x: 0.25 + col * 2.4, y: 1.9, w: 2.1, h: 1.5, fill: { color: CARD_BG }, line: { color: ACCENT, width: 1 } });
      s.addText(st.title, { x: 0.3 + col * 2.4, y: 1.95, w: 2.0, h: 0.35, fontSize: 12, bold: true, color: ACCENT, fontFace: "Calibri" });
      s.addText(st.text, { x: 0.3 + col * 2.4, y: 2.35, w: 2.0, h: 1.0, fontSize: 10.5, color: SOFT_TXT, fontFace: "Calibri" });
    } else {
      const ci = i - 4;
      s.addShape("ellipse", { x: 0.25 + ci * 3.18, y: 3.55, w: 0.42, h: 0.42, fill: { color: ACCENT2 } });
      s.addText(st.num, { x: 0.25 + ci * 3.18, y: 3.55, w: 0.42, h: 0.42, fontSize: 14, bold: true, color: DARK_TXT, align: "center", valign: "middle" });
      s.addShape("rect", { x: 0.25 + ci * 3.18, y: 4.0, w: 2.8, h: 1.22, fill: { color: CARD_BG }, line: { color: ACCENT2, width: 1 } });
      s.addText(st.title, { x: 0.3 + ci * 3.18, y: 4.05, w: 2.65, h: 0.35, fontSize: 12, bold: true, color: ACCENT2, fontFace: "Calibri" });
      s.addText(st.text, { x: 0.3 + ci * 3.18, y: 4.45, w: 2.65, h: 0.7, fontSize: 10.5, color: SOFT_TXT, fontFace: "Calibri" });
    }
  });
}

// ─── SLIDE 13: UMN vs LMN ─────────────────────────────────────────────────────
{
  const s = lightSlide(pres);
  addTopBar(s, MID_BG);
  addBottomBar(s, MID_BG);

  s.addText("11 — UMN vs LMN", {
    x: 0.5, y: 0.2, w: 9, h: 0.4,
    fontSize: 10, color: MID_BG, bold: true, charSpacing: 4
  });
  s.addText("Upper vs Lower Motor Neuron Lesions & Tone", {
    x: 0.5, y: 0.6, w: 9, h: 0.65,
    fontSize: 24, bold: true, color: DARK_TXT, fontFace: "Calibri"
  });

  const headers = ["Feature", "UMN Lesion", "LMN Lesion"];
  const rows = [
    ["Tone", "Hypertonia (spasticity)", "Hypotonia (flaccidity)"],
    ["Reflexes", "Hyperreflexia, clonus", "Hyporeflexia / areflexia"],
    ["Babinski Sign", "Positive (extensor plantar)", "Absent / flexor response"],
    ["Muscle Bulk", "Mild disuse atrophy (late)", "Marked atrophy (early)"],
    ["Fasciculations", "Absent", "Present (denervation)"],
    ["Weakness Pattern", "Pyramidal distribution", "Flaccid, individual muscle"],
    ["Examples", "Stroke, cord injury, MS", "Polio, GBS, nerve palsy"],
  ];

  const colW = [2.4, 3.4, 3.4];
  const colX = [0.3, 2.8, 6.3];
  const rowH = 0.44;

  // Header row
  headers.forEach((h, ci) => {
    const bg = ci === 0 ? MID_BG : ci === 1 ? "D5522A" : "1A6DA8";
    s.addShape("rect", { x: colX[ci], y: 1.45, w: colW[ci], h: 0.42, fill: { color: bg } });
    s.addText(h, { x: colX[ci], y: 1.47, w: colW[ci], h: 0.38, fontSize: 13, bold: true, color: LIGHT_TXT, align: "center", fontFace: "Calibri" });
  });

  rows.forEach((row, ri) => {
    const y = 1.9 + ri * rowH;
    const bg = ri % 2 === 0 ? "EBF5FB" : "D6EAF8";
    row.forEach((cell, ci) => {
      const bgc = ci === 0 ? "D6EAF8" : bg;
      s.addShape("rect", { x: colX[ci], y, w: colW[ci], h: rowH - 0.04, fill: { color: bgc }, line: { color: "AED6F1", width: 0.5 } });
      s.addText(cell, {
        x: colX[ci] + 0.05, y: y + 0.04, w: colW[ci] - 0.1, h: rowH - 0.12,
        fontSize: 12, color: DARK_TXT, fontFace: "Calibri",
        bold: ci === 0
      });
    });
  });
}

// ─── SLIDE 14: Clasp-Knife & Lead-Pipe ───────────────────────────────────────
{
  const s = darkSlide(pres);
  addTopBar(s, "E74C3C");
  addBottomBar(s, "E74C3C");

  s.addText("12 — CLINICAL SIGNS", {
    x: 0.5, y: 0.2, w: 9, h: 0.4,
    fontSize: 10, color: "E74C3C", bold: true, charSpacing: 4
  });
  s.addText("Clasp-Knife vs Lead-Pipe Phenomenon", {
    x: 0.5, y: 0.6, w: 9, h: 0.65,
    fontSize: 24, bold: true, color: LIGHT_TXT, fontFace: "Calibri"
  });

  // Clasp-knife box
  s.addShape("rect", { x: 0.3, y: 1.45, w: 4.5, h: 3.8, fill: { color: CARD_BG }, line: { color: "E74C3C", width: 2 } });
  s.addShape("rect", { x: 0.3, y: 1.45, w: 4.5, h: 0.45, fill: { color: "E74C3C" } });
  s.addText("🔪 CLASP-KNIFE (Spasticity)", {
    x: 0.35, y: 1.47, w: 4.4, h: 0.41,
    fontSize: 13, bold: true, color: LIGHT_TXT, align: "center", fontFace: "Calibri"
  });
  const ckPts = [
    "Named after closing a pocket knife",
    "Initial high resistance to passive stretch",
    "Then sudden COLLAPSE of resistance",
    "Due to activation of Golgi Tendon Organ (GTO)",
    "GTO-mediated inhibition silences the agonist",
    "Velocity dependent — faster = greater initial resistance",
    "Classic UMN / corticospinal tract sign",
    "Seen at elbow (biceps) and knee (quadriceps)",
  ];
  ckPts.forEach((p, i) => {
    s.addText("• " + p, { x: 0.4, y: 2.02 + i * 0.38, w: 4.3, h: 0.34, fontSize: 11.5, color: SOFT_TXT, fontFace: "Calibri" });
  });

  // Lead-pipe box
  s.addShape("rect", { x: 5.2, y: 1.45, w: 4.5, h: 3.8, fill: { color: CARD_BG }, line: { color: ACCENT2, width: 2 } });
  s.addShape("rect", { x: 5.2, y: 1.45, w: 4.5, h: 0.45, fill: { color: ACCENT2 } });
  s.addText("🔩 LEAD-PIPE (Rigidity)", {
    x: 5.25, y: 1.47, w: 4.4, h: 0.41,
    fontSize: 13, bold: true, color: DARK_TXT, align: "center", fontFace: "Calibri"
  });
  const lpPts = [
    "Named after bending a lead pipe",
    "UNIFORM resistance throughout entire ROM",
    "No collapse — resistance remains constant",
    "Not velocity dependent",
    "Affects both flexors and extensors equally",
    "Extrapyramidal / basal ganglia pathology",
    "Parkinson disease: lead-pipe + cogwheeling",
    "Cogwheeling = lead-pipe + superimposed tremor",
  ];
  lpPts.forEach((p, i) => {
    s.addText("• " + p, { x: 5.3, y: 2.02 + i * 0.38, w: 4.3, h: 0.34, fontSize: 11.5, color: SOFT_TXT, fontFace: "Calibri" });
  });
}

// ─── SLIDE 15: Summary / Outro ────────────────────────────────────────────────
{
  const s = darkSlide(pres);
  s.addShape("rect", { x: 0, y: 0, w: 10, h: 0.2, fill: { color: ACCENT } });
  s.addShape("rect", { x: 0, y: 5.425, w: 10, h: 0.2, fill: { color: ACCENT } });

  s.addText("15 — SUMMARY", {
    x: 0.5, y: 0.3, w: 9, h: 0.4,
    fontSize: 10, color: ACCENT, bold: true, charSpacing: 5
  });
  s.addText("Key Clinical Pearls", {
    x: 0.5, y: 0.72, w: 9, h: 0.6,
    fontSize: 30, bold: true, color: LIGHT_TXT, fontFace: "Calibri"
  });

  const pearls = [
    ["Tone ≠ Strength", "Tone is the resting background state; strength is voluntary force generation"],
    ["Velocity matters", "If resistance increases with speed → spasticity (UMN); if not → rigidity (extrapyramidal)"],
    ["Clasp-knife = UMN", "Sudden release of resistance = GTO activation — marks corticospinal lesion"],
    ["Cogwheeling = PD", "Ratchet-like resistance = lead-pipe rigidity + tremor — hallmark of Parkinson disease"],
    ["Hypotonia + areflexia", "Think LMN lesion (anterior horn, peripheral nerve) or cerebellar disease"],
    ["Spinal shock", "Acute complete cord injury → initial hypotonia/areflexia → later spasticity"],
    ["Gamma loop key", "High γ discharge → hypertonia; low γ → hypotonia — cerebellum modulates γ"],
  ];

  pearls.forEach((p, i) => {
    const col = i < 4 ? 0 : 1;
    const row = col === 0 ? i : i - 4;
    const x = col === 0 ? 0.3 : 5.1;
    const y = 1.52 + row * 0.88;
    const bg = col === 0 ? ACCENT : ACCENT2;

    s.addShape("rect", { x, y, w: 4.6, h: 0.8, fill: { color: CARD_BG }, line: { color: bg, width: 1.5 } });
    s.addShape("rect", { x, y, w: 1.75, h: 0.8, fill: { color: bg } });
    s.addText(p[0], { x, y: y + 0.1, w: 1.75, h: 0.6, fontSize: 11, bold: true, color: DARK_TXT, align: "center", fontFace: "Calibri" });
    s.addText(p[1], { x: x + 1.85, y: y + 0.1, w: 2.65, h: 0.6, fontSize: 11, color: SOFT_TXT, fontFace: "Calibri" });
  });
}

// ─── Write File ───────────────────────────────────────────────────────────────
pres.writeFile({ fileName: "/home/daytona/workspace/muscle-tone-ppt/Muscle_Tone.pptx" })
  .then(() => console.log("✅ Created: /home/daytona/workspace/muscle-tone-ppt/Muscle_Tone.pptx"))
  .catch(e => { console.error("❌ Error:", e.message); process.exit(1); });
Running Command

cd /home/daytona/workspace/muscle-tone-ppt && node create_pptx.js

Running Command

ls -lh /home/daytona/workspace/muscle-tone-ppt/Muscle_Tone.pptx

Your 15-slide Muscle Tone presentation is ready:

Muscle Tone

Presentation · PPTX


Here is what each slide covers:
#Slide TitleContent
1Title SlideMuscle Tone - Physiology, Neural Control & Clinical Significance
2OverviewAll 15 topics listed with numbered index
3DefinitionConcept of tone, tonus, normal vs abnormal, tone vs strength
4Structural BasisMuscle spindle (intrafusal fibers, Ia/II afferents) vs Golgi Tendon Organ (Ib, inverse stretch reflex)
5Neural ControlAlpha (extrafusal, force) vs Gamma (intrafusal, spindle sensitivity) motor neurons
6Stretch Reflex & Gamma LoopMonosynaptic arc, gamma co-activation, spindle sensitivity maintenance
7CNS InfluencesCortex, basal ganglia, cerebellum, reticular formation, vestibular nuclei - roles in tone
8ClassificationNormotonia, Hypertonia, Hypotonia - side-by-side comparison cards
9SpasticityVelocity-dependent, UMN, clasp-knife, causes, treatment
10RigidityVelocity-independent, extrapyramidal, lead-pipe, cogwheel, Parkinson
11HypotoniaFloppy features, LMN/cerebellar/NMJ/metabolic causes
12Clinical Assessment7 assessment methods: inspection, palpation, passive resistance, velocity, leg drop, pendulum, reflexes
13UMN vs LMNFull comparison table - tone, reflexes, Babinski, atrophy, fasciculations
14Clasp-Knife vs Lead-PipeMechanism of each sign, GTO pathway, clinical correlation
15Summary & Clinical Pearls7 high-yield pearls for exams and practice
Design: Deep navy background with vivid green accents, amber highlights, card-based layouts - clean and professional.
This is a shared conversation. Sign in to Orris to start your own chat.