Make mri spine anatomy and pathology ppt for radiology lecture include images from radiology textbook and colourful theme
MRI spine normal anatomy sagittal
MRI spine disc herniation pathology
spinal cord compression stenosis MRI
vertebral osteomyelitis discitis MRI spine infection
spinal metastasis epidural compression MRI
spinal cord intramedullary tumor ependymoma astrocytoma MRI
MRI lumbar spine spondylolisthesis degenerative
mkdir -p /home/daytona/workspace/mri-spine-ppt && ls /home/daytona/workspace/mri-spine-ppt
cd /home/daytona/workspace/mri-spine-ppt && node /home/daytona/skills/shared/scripts/fetch_images.js \ "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_27d52441af7835bd73f30a6c9beff86838e1755b271254da9165fcea651aeefd.jpg" \ "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_a3e65c0721f09bea08a7645df08116c852d9623f4df3e26e2b61eac78a33d8d8.jpg" \ "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_855fca48a7c8d11079d4d4dab10b9ce0d4d43df934b3a7a592bc801b8aef3a29.jpg" \ "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_945cc5f18653e5fdaf974f8ffac6b2f1c820ed66cc24138c041ed16faf582137.jpg" \ "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_87b42f5e10e2e6f3a9a1d0e42348bf95c51357e169e75e551cde265088e3a9cb.jpg" \ "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_48f93d7226950580a3c0dad08e8a8cab7ef2167230c514e1d7d20770776d5e9d.jpg" \ "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_921ac2afb3e00e23b0fd5aae4d22c925d2fa7189c79a4356cb38b97e47e8e6a2.jpg" \ "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_c7ad89bb72133e7c31ad153feca626d3f8eb2473d7a56a3333b039596925c790.jpg" \ "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_e600be8381ba40c5af6cefad883f70eb28c6bdf093a2cf24f3bed7359a7d67cf.jpg" \ "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_a1d78f6e324feb6af58530573c2afae5be442f58b3b67b9b3bae57e355d7f55d.jpg" \ > /home/daytona/workspace/mri-spine-ppt/images.json 2>&1 echo "Exit: $?" wc -c /home/daytona/workspace/mri-spine-ppt/images.json
~/mri-spine-ppt/build.js
const pptxgen = require("pptxgenjs");
const fs = require("fs");
// Load pre-fetched images
const imgs = JSON.parse(fs.readFileSync("/home/daytona/workspace/mri-spine-ppt/images.json", "utf8"));
// imgs[0]=normal sagittal both, [1]=thoracic normal, [2]=cervical FIESTA, [3]=lumbar disc herniation,
// [4]=thoracic disc herniation, [5]=cervical cord compression, [6]=discitis, [7]=metastasis axial,
// [8]=IMSCT comparison, [9]=spondylolisthesis
function imgData(i) { return imgs[i] && imgs[i].base64 ? imgs[i].base64 : null; }
// ── Palette ──────────────────────────────────────────────────────────────
const C = {
dark: "0D1B2A", // deep navy (background dominant)
mid: "1B3A5C", // mid navy
blue: "1565C0", // royal blue accent
cyan: "00BCD4", // bright cyan highlight
teal: "00897B", // teal
amber: "FFB300", // amber accent
white: "FFFFFF",
light: "E8F4FD", // very light blue
grey: "B0BEC5",
red: "E53935",
green: "43A047",
purple: "7B1FA2",
};
// ── Helper: dark slide background ─────────────────────────────────────────
function darkBg(slide) {
slide.addShape(pptxgen.ShapeType.rect, { x: 0, y: 0, w: "100%", h: "100%", fill: { color: C.dark } });
}
function accentBar(slide, color) {
slide.addShape(pptxgen.ShapeType.rect, { x: 0, y: 0, w: 0.22, h: "100%", fill: { color: color || C.cyan } });
}
function sectionTag(slide, text, color) {
slide.addShape(pptxgen.ShapeType.rect, { x: 0.35, y: 0.18, w: 2.5, h: 0.32, fill: { color: color || C.cyan }, rectRadius: 0.06 });
slide.addText(text.toUpperCase(), { x: 0.35, y: 0.18, w: 2.5, h: 0.32, color: C.dark, fontSize: 9, bold: true, align: "center", valign: "middle", margin: 0 });
}
function slideTitle(slide, text, color) {
slide.addText(text, { x: 0.35, y: 0.55, w: 9.3, h: 0.65, color: color || C.white, fontSize: 22, bold: true, fontFace: "Calibri" });
}
function dividerLine(slide, y, color) {
slide.addShape(pptxgen.ShapeType.rect, { x: 0.35, y: y || 1.25, w: 9.3, h: 0.04, fill: { color: color || C.cyan } });
}
// ── Presentation setup ────────────────────────────────────────────────────
const pres = new pptxgen();
pres.layout = "LAYOUT_WIDE"; // 13.3" × 7.5"
pres.title = "MRI Spine: Anatomy & Pathology";
pres.author = "Radiology Lecture";
// ════════════════════════════════════════════════════════════════════════════
// SLIDE 1 — Title
// ════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
// Full dark bg
s.addShape(pptxgen.ShapeType.rect, { x: 0, y: 0, w: "100%", h: "100%", fill: { color: C.dark } });
// Cyan left stripe
s.addShape(pptxgen.ShapeType.rect, { x: 0, y: 0, w: 0.5, h: "100%", fill: { color: C.cyan } });
// Blue bottom banner
s.addShape(pptxgen.ShapeType.rect, { x: 0, y: 6.2, w: "100%", h: 1.3, fill: { color: C.mid } });
// Decorative circle
s.addShape(pptxgen.ShapeType.ellipse, { x: 9.5, y: -1, w: 5, h: 5, fill: { color: C.blue }, line: { color: C.blue } });
s.addShape(pptxgen.ShapeType.ellipse, { x: 10.2, y: -0.4, w: 3.5, h: 3.5, fill: { color: C.mid }, line: { color: C.mid } });
s.addText("MRI SPINE", { x: 0.8, y: 1.4, w: 9, h: 1.0, color: C.cyan, fontSize: 52, bold: true, fontFace: "Calibri", charSpacing: 6 });
s.addText("ANATOMY & PATHOLOGY", { x: 0.8, y: 2.5, w: 9, h: 0.8, color: C.white, fontSize: 34, bold: false, fontFace: "Calibri", charSpacing: 3 });
s.addText("A Comprehensive Radiology Lecture", { x: 0.8, y: 3.45, w: 7, h: 0.45, color: C.grey, fontSize: 16, italic: true });
// Subtitle line
s.addShape(pptxgen.ShapeType.rect, { x: 0.8, y: 3.35, w: 5, h: 0.05, fill: { color: C.amber } });
s.addText("Grainger & Allison's Diagnostic Radiology", { x: 0.8, y: 6.3, w: 7, h: 0.35, color: C.grey, fontSize: 12 });
s.addText("April 2026", { x: 0.8, y: 6.75, w: 4, h: 0.3, color: C.grey, fontSize: 11 });
}
// ════════════════════════════════════════════════════════════════════════════
// SLIDE 2 — Table of Contents
// ════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
darkBg(s);
accentBar(s, C.cyan);
sectionTag(s, "Overview", C.cyan);
slideTitle(s, "Lecture Outline");
dividerLine(s);
const sections = [
{ n: "01", t: "MRI Physics & Sequences", sub: "T1, T2, STIR, FLAIR, Gd-enhancement", c: C.cyan },
{ n: "02", t: "Normal Spine Anatomy", sub: "Cervical, Thoracic & Lumbar — key landmarks", c: C.teal },
{ n: "03", t: "Degenerative Disc Disease", sub: "Disc herniation, stenosis, spondylolisthesis", c: C.blue },
{ n: "04", t: "Spinal Infections", sub: "Discitis-osteomyelitis, epidural abscess", c: C.amber },
{ n: "05", t: "Spinal Tumours", sub: "Intramedullary, intradural-extramedullary, extradural", c: C.red },
{ n: "06", t: "Spinal Trauma", sub: "Cord injury, haematoma, syrinx", c: C.purple },
];
sections.forEach((sec, i) => {
const col = i < 3 ? 0 : 1;
const row = i % 3;
const bx = col === 0 ? 0.45 : 6.8;
const by = 1.42 + row * 1.6;
s.addShape(pptxgen.ShapeType.rect, { x: bx, y: by, w: 6.0, h: 1.4, fill: { color: C.mid }, shadow: { type: "outer", color: "000000", blur: 8, offset: 2, angle: 135, opacity: 0.3 } });
s.addShape(pptxgen.ShapeType.rect, { x: bx, y: by, w: 0.5, h: 1.4, fill: { color: sec.c } });
s.addText(sec.n, { x: bx, y: by, w: 0.5, h: 1.4, color: C.dark, fontSize: 14, bold: true, align: "center", valign: "middle", margin: 0 });
s.addText(sec.t, { x: bx + 0.6, y: by + 0.15, w: 5.25, h: 0.5, color: C.white, fontSize: 14, bold: true });
s.addText(sec.sub, { x: bx + 0.6, y: by + 0.65, w: 5.25, h: 0.55, color: C.grey, fontSize: 11, italic: true });
});
}
// ════════════════════════════════════════════════════════════════════════════
// SLIDE 3 — MRI Physics & Sequences
// ════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
darkBg(s);
accentBar(s, C.cyan);
sectionTag(s, "Section 01", C.cyan);
slideTitle(s, "MRI Physics: Key Sequences in Spine Imaging");
dividerLine(s);
const seqs = [
{ t: "T1-Weighted", c: C.cyan, pts: ["Fat → bright (white marrow, epidural fat)", "Cortical bone → dark", "CSF → dark", "Best for: anatomy, bone marrow, post-Gd enhancement"] },
{ t: "T2-Weighted", c: C.teal, pts: ["CSF → bright (myelogram effect)", "Normal disc nucleus → bright (hydrated)", "Degenerated disc → dark (desiccated)", "Best for: cord pathology, disc disease, edema"] },
{ t: "STIR", c: C.amber, pts: ["Fat suppression — nulls fat signal", "Marrow edema → very bright", "Infection & tumour → hyperintense", "Best for: vertebral metastasis, fractures, infection"] },
{ t: "Gd-Enhanced T1", c: C.blue, pts: ["Enhancing lesions → bright", "Disrupted blood-cord barrier", "Best for: tumours, infection, meningitis, post-op scar vs disc"] },
];
seqs.forEach((seq, i) => {
const x = 0.4 + i * 3.1;
s.addShape(pptxgen.ShapeType.rect, { x, y: 1.4, w: 2.9, h: 5.5, fill: { color: C.mid }, shadow: { type: "outer", color: "000000", blur: 6, offset: 2, angle: 135, opacity: 0.25 } });
s.addShape(pptxgen.ShapeType.rect, { x, y: 1.4, w: 2.9, h: 0.5, fill: { color: seq.c } });
s.addText(seq.t, { x, y: 1.4, w: 2.9, h: 0.5, color: C.dark, fontSize: 13, bold: true, align: "center", valign: "middle", margin: 0 });
seq.pts.forEach((pt, j) => {
s.addText([{ text: "• ", options: { color: seq.c, bold: true } }, { text: pt, options: { color: C.white } }],
{ x: x + 0.1, y: 2.05 + j * 0.85, w: 2.7, h: 0.75, fontSize: 10.5 });
});
});
}
// ════════════════════════════════════════════════════════════════════════════
// SLIDE 4 — Normal Anatomy with images
// ════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
darkBg(s);
accentBar(s, C.teal);
sectionTag(s, "Section 02", C.teal);
slideTitle(s, "Normal MRI Spine Anatomy", C.white);
dividerLine(s, 1.25, C.teal);
// Left: text
const bullets = [
{ h: "Vertebral Bodies", b: "Uniform T1 bright signal (yellow marrow), T2 intermediate; rectangular morphology with smooth endplates" },
{ h: "Intervertebral Discs", b: "Nucleus pulposus: T2 bright (hydration). Annulus fibrosus: T2 dark (fibrocartilage). Normal disc height preserved" },
{ h: "Spinal Cord", b: "T2 intermediate cord signal surrounded by bright CSF (myelogram effect). Cord conus ends at L1–L2" },
{ h: "CSF", b: "T1 dark, T2 bright. Provides natural contrast for cord & rootlets on T2" },
{ h: "Nerve Roots", b: "Seen as dark filling defects within bright CSF on T2; exit via neural foramina" },
];
bullets.forEach((b, i) => {
s.addText(b.h, { x: 0.45, y: 1.35 + i * 1.1, w: 5.5, h: 0.35, color: C.teal, fontSize: 12, bold: true });
s.addText(b.b, { x: 0.45, y: 1.72 + i * 1.1, w: 5.5, h: 0.65, color: C.light, fontSize: 10.5 });
if (i < 4) s.addShape(pptxgen.ShapeType.rect, { x: 0.45, y: 2.38 + i * 1.1, w: 5.5, h: 0.03, fill: { color: C.mid } });
});
// Right: image
if (imgData(0)) {
s.addImage({ data: imgData(0), x: 6.2, y: 1.35, w: 6.7, h: 5.8 });
s.addText("T2 Sagittal: Normal cervical & lumbar spine", { x: 6.2, y: 7.1, w: 6.7, h: 0.3, color: C.grey, fontSize: 9, italic: true, align: "center" });
}
}
// ════════════════════════════════════════════════════════════════════════════
// SLIDE 5 — Cervical Spine Anatomy detail
// ════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
darkBg(s);
accentBar(s, C.teal);
sectionTag(s, "Section 02", C.teal);
slideTitle(s, "Cervical & Thoracic Spine: MRI Landmarks", C.white);
dividerLine(s, 1.25, C.teal);
// two images side by side
if (imgData(1)) {
s.addShape(pptxgen.ShapeType.rect, { x: 0.4, y: 1.4, w: 5.9, h: 5.3, fill: { color: C.mid } });
s.addImage({ data: imgData(1), x: 0.5, y: 1.45, w: 5.8, h: 5.0 });
s.addText("T2 Sagittal: Normal thoracic spine\n(Grainger & Allison)", { x: 0.4, y: 6.5, w: 5.9, h: 0.55, color: C.grey, fontSize: 9.5, italic: true, align: "center" });
}
if (imgData(2)) {
s.addShape(pptxgen.ShapeType.rect, { x: 6.9, y: 1.4, w: 6.0, h: 5.3, fill: { color: C.mid } });
s.addImage({ data: imgData(2), x: 7.0, y: 1.45, w: 5.9, h: 5.0 });
s.addText("CISS/FIESTA: Intradural anatomy — nerve rootlets & denticulate ligaments", { x: 6.9, y: 6.5, w: 6.0, h: 0.55, color: C.grey, fontSize: 9.5, italic: true, align: "center" });
}
// Key points banner
s.addShape(pptxgen.ShapeType.rect, { x: 0.4, y: 7.1, w: 12.5, h: 0.3, fill: { color: C.teal } });
s.addText("Key: CISS/FIESTA — gold standard for nerve rootlet evaluation | High-res CSF contrast | Used for arachnoiditis, root avulsion", { x: 0.4, y: 7.1, w: 12.5, h: 0.3, color: C.dark, fontSize: 9.5, bold: true, align: "center", valign: "middle", margin: 0 });
}
// ════════════════════════════════════════════════════════════════════════════
// SLIDE 6 — Disc Herniation
// ════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
darkBg(s);
accentBar(s, C.blue);
sectionTag(s, "Section 03", C.blue);
slideTitle(s, "Lumbar Disc Herniation", C.white);
dividerLine(s, 1.25, C.blue);
// Left content
const items = [
{ label: "Classification", val: "Bulge → Protrusion → Extrusion → Sequestration" },
{ label: "T2 MRI findings", val: "Posterior disc protrusion with dark disc signal (desiccation). High-intensity zone (HIZ) = annular tear" },
{ label: "Nerve root compression", val: "Compression of exiting root in lateral recess or foramen → radiculopathy" },
{ label: "Cauda equina syndrome", val: "Large central herniation L4–L5 or L5–S1 → emergency surgical decompression" },
{ label: "Clinical levels", val: "L4/5: L5 root (foot dorsiflexion). L5/S1: S1 root (plantar flexion, ankle reflex)" },
];
items.forEach((item, i) => {
s.addShape(pptxgen.ShapeType.rect, { x: 0.45, y: 1.38 + i * 1.08, w: 5.7, h: 1.0, fill: { color: C.mid } });
s.addShape(pptxgen.ShapeType.rect, { x: 0.45, y: 1.38 + i * 1.08, w: 0.2, h: 1.0, fill: { color: C.blue } });
s.addText(item.label, { x: 0.75, y: 1.42 + i * 1.08, w: 5.35, h: 0.35, color: C.cyan, fontSize: 11, bold: true });
s.addText(item.val, { x: 0.75, y: 1.78 + i * 1.08, w: 5.35, h: 0.5, color: C.light, fontSize: 10.5 });
});
// Right image
if (imgData(3)) {
s.addShape(pptxgen.ShapeType.rect, { x: 6.4, y: 1.38, w: 6.5, h: 5.8, fill: { color: C.mid } });
s.addImage({ data: imgData(3), x: 6.5, y: 1.43, w: 6.3, h: 5.5 });
s.addText("T2 Sagittal: Lumbar disc herniation at L4-L5 with migrated fragment", { x: 6.4, y: 7.0, w: 6.5, h: 0.4, color: C.grey, fontSize: 9.5, italic: true, align: "center" });
}
}
// ════════════════════════════════════════════════════════════════════════════
// SLIDE 7 — Thoracic Disc & Stenosis
// ════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
darkBg(s);
accentBar(s, C.blue);
sectionTag(s, "Section 03", C.blue);
slideTitle(s, "Spinal Stenosis & Cervical Myelopathy", C.white);
dividerLine(s, 1.25, C.blue);
// text left column
const facts = [
"Central canal stenosis: disc bulge + ligamentum flavum hypertrophy + facet joint OA",
"MRI T2 cord signal change (hyperintensity) = myelomalacia / cord edema — poor prognosis",
"Compression ratio (AP/transverse diameter) < 0.4 indicates significant cord deformation",
"OPLL (Ossification of Posterior Longitudinal Ligament) — low T1 & T2 behind VBs",
"Dynamic MRI (flexion/extension) reveals cord kinking in cervical instability",
];
facts.forEach((f, i) => {
s.addShape(pptxgen.ShapeType.rect, { x: 0.45, y: 1.42 + i * 1.12, w: 5.7, h: 1.0, fill: { color: C.mid } });
s.addShape(pptxgen.ShapeType.ellipse, { x: 0.55, y: 1.62 + i * 1.12, w: 0.28, h: 0.28, fill: { color: C.blue }, line: { color: C.blue } });
s.addText(f, { x: 0.95, y: 1.45 + i * 1.12, w: 5.15, h: 0.85, color: C.light, fontSize: 11 });
});
// Right image
if (imgData(5)) {
s.addShape(pptxgen.ShapeType.rect, { x: 6.4, y: 1.38, w: 6.5, h: 5.8, fill: { color: C.mid } });
s.addImage({ data: imgData(5), x: 6.5, y: 1.43, w: 6.3, h: 5.5 });
s.addText("Cervical myelopathy: T2 sagittal + axial showing cord compression & myelomalacia", { x: 6.4, y: 7.0, w: 6.5, h: 0.4, color: C.grey, fontSize: 9.5, italic: true, align: "center" });
}
}
// ════════════════════════════════════════════════════════════════════════════
// SLIDE 8 — Spondylolisthesis
// ════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
darkBg(s);
accentBar(s, C.blue);
sectionTag(s, "Section 03", C.blue);
slideTitle(s, "Spondylolisthesis & Foraminal Stenosis", C.white);
dividerLine(s, 1.25, C.blue);
// Grade table
s.addShape(pptxgen.ShapeType.rect, { x: 0.45, y: 1.42, w: 5.7, h: 0.45, fill: { color: C.blue } });
s.addText("Meyerding Grading of Spondylolisthesis", { x: 0.45, y: 1.42, w: 5.7, h: 0.45, color: C.white, fontSize: 12, bold: true, align: "center", valign: "middle", margin: 0 });
const grades = [
["Grade", "Slip", "Canal Stenosis"],
["I", "< 25%", "Mild"],
["II", "25–50%", "Moderate"],
["III", "50–75%", "Severe"],
["IV", "> 75%", "Critical"],
];
grades.forEach((row, ri) => {
const bg = ri === 0 ? C.mid : (ri % 2 === 0 ? "162847" : C.mid);
row.forEach((cell, ci) => {
s.addShape(pptxgen.ShapeType.rect, { x: 0.45 + ci * 1.9, y: 1.87 + ri * 0.58, w: 1.9, h: 0.58, fill: { color: bg }, line: { color: C.blue, pt: 0.5 } });
s.addText(cell, { x: 0.45 + ci * 1.9, y: 1.87 + ri * 0.58, w: 1.9, h: 0.58, color: ri === 0 ? C.cyan : C.white, fontSize: 11, bold: ri === 0, align: "center", valign: "middle", margin: 0 });
});
});
// MRI findings
const mf = [
"Forward slip of superior vertebra on T2 sagittal",
"Disc degeneration at slip level (dark, collapsed disc)",
"Foraminal stenosis visible on parasagittal T2",
"Cauda equina compression in central canal",
"Dynamic instability on flexion/extension MRI",
];
s.addShape(pptxgen.ShapeType.rect, { x: 0.45, y: 5.25, w: 5.7, h: 0.4, fill: { color: C.teal } });
s.addText("MRI Key Findings", { x: 0.45, y: 5.25, w: 5.7, h: 0.4, color: C.dark, fontSize: 12, bold: true, align: "center", valign: "middle", margin: 0 });
mf.forEach((f, i) => {
s.addText([{ text: "➤ ", options: { color: C.teal, bold: true } }, { text: f, options: { color: C.light } }],
{ x: 0.55, y: 5.7 + i * 0.37, w: 5.5, h: 0.35, fontSize: 10.5 });
});
// image right
if (imgData(9)) {
s.addShape(pptxgen.ShapeType.rect, { x: 6.4, y: 1.38, w: 6.5, h: 5.8, fill: { color: C.mid } });
s.addImage({ data: imgData(9), x: 6.5, y: 1.43, w: 6.3, h: 5.5 });
s.addText("T2 Sagittal & Parasagittal: Degenerative spondylolisthesis L5/S1 with foraminal stenosis", { x: 6.4, y: 7.0, w: 6.5, h: 0.4, color: C.grey, fontSize: 9.5, italic: true, align: "center" });
}
}
// ════════════════════════════════════════════════════════════════════════════
// SLIDE 9 — Spinal Infection
// ════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
darkBg(s);
accentBar(s, C.amber);
sectionTag(s, "Section 04", C.amber);
slideTitle(s, "Spinal Infections: Discitis–Osteomyelitis", C.white);
dividerLine(s, 1.25, C.amber);
const pts = [
{ icon: "🔬", h: "Causative organisms", b: "S. aureus (most common) · M. tuberculosis (Pott's disease) · E. coli, Streptococcus, Brucella" },
{ icon: "🧲", h: "MRI sequence of choice", b: "STIR/T2 fat-sat — earliest detection. T1 Gd — epidural extent & abscess rim enhancement" },
{ icon: "📋", h: "Classic MRI triad", b: "1. Low T1 / High T2 disc signal 2. Endplate destruction & irregularity 3. Paravertebral/epidural enhancement" },
{ icon: "⚠️", h: "Red flag findings", b: "Epidural abscess with cord compression → surgical emergency. Bilateral psoas abscess → TB until proven otherwise" },
{ icon: "🔄", h: "DDx — malignancy", b: "Disc preservation in metastasis (vs disc destruction in infection). Skip lesions suggest malignancy" },
];
pts.forEach((p, i) => {
s.addShape(pptxgen.ShapeType.rect, { x: 0.45, y: 1.38 + i * 1.08, w: 5.7, h: 1.0, fill: { color: C.mid } });
s.addShape(pptxgen.ShapeType.rect, { x: 0.45, y: 1.38 + i * 1.08, w: 0.6, h: 1.0, fill: { color: "1A2E40" } });
s.addText(p.icon, { x: 0.45, y: 1.38 + i * 1.08, w: 0.6, h: 1.0, color: C.white, fontSize: 18, align: "center", valign: "middle", margin: 0 });
s.addText(p.h, { x: 1.15, y: 1.42 + i * 1.08, w: 4.9, h: 0.35, color: C.amber, fontSize: 11, bold: true });
s.addText(p.b, { x: 1.15, y: 1.78 + i * 1.08, w: 4.9, h: 0.5, color: C.light, fontSize: 10.5 });
});
// Right image
if (imgData(6)) {
s.addShape(pptxgen.ShapeType.rect, { x: 6.4, y: 1.38, w: 6.5, h: 5.8, fill: { color: C.mid } });
s.addImage({ data: imgData(6), x: 6.5, y: 1.43, w: 6.3, h: 5.5 });
s.addText("T2 Sagittal: L2-L3 discitis-osteomyelitis — disc destruction, endplate erosion, psoas extension", { x: 6.4, y: 7.0, w: 6.5, h: 0.4, color: C.grey, fontSize: 9.5, italic: true, align: "center" });
}
}
// ════════════════════════════════════════════════════════════════════════════
// SLIDE 10 — Spinal Tumours
// ════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
darkBg(s);
accentBar(s, C.red);
sectionTag(s, "Section 05", C.red);
slideTitle(s, "Spinal Tumours: Classification & MRI Features", C.white);
dividerLine(s, 1.25, C.red);
const cats = [
{ t: "Extradural", c: C.red, pts: ["Metastases (most common: lung, breast, prostate)", "Lymphoma, myeloma", "Vertebral body destruction, cord compression", "STIR: marrow replacement; Gd-T1: enhancement"] },
{ t: "Intradural Extramedullary", c: C.amber, pts: ["Meningioma (T1 iso, T2 iso, avid Gd)", "Schwannoma (dumbbell through foramen)", "Neurofibroma", "CSF capping sign around tumour"] },
{ t: "Intramedullary", c: C.purple, pts: ["Ependymoma: central, cap sign on T2, enhances", "Astrocytoma: eccentric, infiltrative, less enhancement", "Haemangioblastoma: vivid Gd, cyst + nodule", "All: cord expansion + T2 edema"] },
];
cats.forEach((cat, i) => {
const x = 0.45 + i * 4.3;
s.addShape(pptxgen.ShapeType.rect, { x, y: 1.38, w: 4.0, h: 5.8, fill: { color: C.mid }, shadow: { type: "outer", color: "000000", blur: 8, offset: 2, angle: 135, opacity: 0.3 } });
s.addShape(pptxgen.ShapeType.rect, { x, y: 1.38, w: 4.0, h: 0.55, fill: { color: cat.c } });
s.addText(cat.t, { x, y: 1.38, w: 4.0, h: 0.55, color: C.white, fontSize: 13, bold: true, align: "center", valign: "middle", margin: 0 });
cat.pts.forEach((pt, j) => {
s.addText([{ text: "• ", options: { color: cat.c, bold: true } }, { text: pt, options: { color: C.light } }],
{ x: x + 0.15, y: 2.05 + j * 1.12, w: 3.7, h: 1.0, fontSize: 10.5 });
});
});
}
// ════════════════════════════════════════════════════════════════════════════
// SLIDE 11 — Tumour Images
// ════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
darkBg(s);
accentBar(s, C.red);
sectionTag(s, "Section 05", C.red);
slideTitle(s, "Intramedullary Tumours: MRI Comparison", C.white);
dividerLine(s, 1.25, C.red);
// left: metastasis axial
if (imgData(7)) {
s.addShape(pptxgen.ShapeType.rect, { x: 0.45, y: 1.38, w: 5.9, h: 5.5, fill: { color: C.mid } });
s.addImage({ data: imgData(7), x: 0.55, y: 1.43, w: 5.8, h: 5.2 });
s.addText("Extradural: T10 metastasis — axial MRI showing vertebral destruction & cord compression", { x: 0.45, y: 6.95, w: 5.9, h: 0.45, color: C.grey, fontSize: 9.5, italic: true, align: "center" });
}
// right: IMSCT comparison
if (imgData(8)) {
s.addShape(pptxgen.ShapeType.rect, { x: 6.8, y: 1.38, w: 6.1, h: 5.5, fill: { color: C.mid } });
s.addImage({ data: imgData(8), x: 6.9, y: 1.43, w: 5.9, h: 5.2 });
s.addText("Intramedullary tumours: T2 & Gd-T1 comparison — Astrocytoma vs Ependymoma vs Haemangioblastoma", { x: 6.8, y: 6.95, w: 6.1, h: 0.45, color: C.grey, fontSize: 9.5, italic: true, align: "center" });
}
}
// ════════════════════════════════════════════════════════════════════════════
// SLIDE 12 — Spinal Trauma
// ════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
darkBg(s);
accentBar(s, C.purple);
sectionTag(s, "Section 06", C.purple);
slideTitle(s, "Spinal Trauma: MRI Role & Cord Injury Patterns", C.white);
dividerLine(s, 1.25, C.purple);
const tbl = [
{ type: "Cord Oedema", t1: "Iso", t2: "↑ Bright", prog: "Good", c: C.teal },
{ type: "Cord Haemorrhage", t1: "↓ Dark (acute)", t2: "↓ Dark (deoxyHb)", prog: "Poor", c: C.red },
{ type: "Cord Transection", t1: "Gap/disruption", t2: "Complete discontinuity", prog: "Worst", c: C.red },
{ type: "Post-traumatic Syrinx", t1: "Dark (CSF)", t2: "↑ Bright (CSF)", prog: "Variable", c: C.amber },
];
// header
["Injury Type", "T1 Signal", "T2 Signal", "Prognosis"].forEach((h, i) => {
const widths = [3.5, 2.5, 3.5, 1.9];
const xs = [0.45, 3.95, 6.45, 9.95];
s.addShape(pptxgen.ShapeType.rect, { x: xs[i], y: 1.42, w: widths[i], h: 0.5, fill: { color: C.purple } });
s.addText(h, { x: xs[i], y: 1.42, w: widths[i], h: 0.5, color: C.white, fontSize: 12, bold: true, align: "center", valign: "middle", margin: 0 });
});
tbl.forEach((row, ri) => {
const cells = [row.type, row.t1, row.t2, row.prog];
const widths = [3.5, 2.5, 3.5, 1.9];
const xs = [0.45, 3.95, 6.45, 9.95];
cells.forEach((cell, ci) => {
s.addShape(pptxgen.ShapeType.rect, { x: xs[ci], y: 1.92 + ri * 0.75, w: widths[ci], h: 0.75, fill: { color: ri % 2 === 0 ? C.mid : "162847" }, line: { color: C.purple, pt: 0.5 } });
s.addText(cell, { x: xs[ci] + 0.05, y: 1.92 + ri * 0.75, w: widths[ci] - 0.1, h: 0.75, color: ci === 0 ? row.c : C.light, fontSize: 11, bold: ci === 0, align: "center", valign: "middle", margin: 0 });
});
});
// Key points
const kp = [
"MRI is gold standard for cord injury assessment — better than CT for soft tissue & neural injury",
"Gradient echo (GRE) sequences more sensitive for haemosiderin/blood than T2 TSE",
"Haematoma < 4 mm diameter → better neurological outcome than larger collections",
"Brachial plexus avulsion: pseudomeningocoele + diffuse cord oedema on T2",
];
s.addShape(pptxgen.ShapeType.rect, { x: 0.45, y: 5.1, w: 11.45, h: 0.38, fill: { color: C.purple } });
s.addText("Clinical Pearls", { x: 0.45, y: 5.1, w: 11.45, h: 0.38, color: C.white, fontSize: 12, bold: true, align: "center", valign: "middle", margin: 0 });
kp.forEach((k, i) => {
s.addText([{ text: "◆ ", options: { color: C.purple, bold: true } }, { text: k, options: { color: C.light } }],
{ x: 0.55, y: 5.55 + i * 0.46, w: 11.2, h: 0.42, fontSize: 10.5 });
});
}
// ════════════════════════════════════════════════════════════════════════════
// SLIDE 13 — Summary / Key Points
// ════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
darkBg(s);
// full accent at bottom
s.addShape(pptxgen.ShapeType.rect, { x: 0, y: 0, w: 0.5, h: "100%", fill: { color: C.cyan } });
s.addShape(pptxgen.ShapeType.rect, { x: 0, y: 6.8, w: "100%", h: 0.7, fill: { color: C.mid } });
s.addText("SUMMARY", { x: 0.7, y: 0.2, w: 4, h: 0.5, color: C.cyan, fontSize: 14, bold: true, charSpacing: 4 });
s.addText("Key Takeaways for MRI Spine Reporting", { x: 0.7, y: 0.75, w: 12, h: 0.6, color: C.white, fontSize: 24, bold: true });
s.addShape(pptxgen.ShapeType.rect, { x: 0.7, y: 1.38, w: 12, h: 0.04, fill: { color: C.cyan } });
const summaries = [
{ icon: "🔵", c: C.cyan, h: "Sequence selection is key", b: "T2 for anatomy & disc, STIR for marrow pathology, Gd-T1 for tumour/infection, GRE for blood" },
{ icon: "🟢", c: C.teal, h: "Normal anatomy first", b: "Know the normal T1/T2 signal of each structure — disc, cord, CSF, bone marrow — before interpreting pathology" },
{ icon: "🟡", c: C.amber, h: "Disc vs infection", b: "Disc preservation → metastasis; Disc destruction + endplate erosion + enhancement → discitis-osteomyelitis" },
{ icon: "🔴", c: C.red, h: "Tumour compartments", b: "Extradural (metastasis) > Intradural-extramedullary (meningioma, schwannoma) > Intramedullary (ependymoma, astrocytoma)" },
{ icon: "🟣", c: C.purple, h: "Trauma prognostic MRI", b: "Cord oedema = good prognosis; Haemorrhage = poor; Transection = worst; Syrinx = delayed worsening" },
];
summaries.forEach((sum, i) => {
const col = i < 3 ? 0 : 1;
const row = i < 3 ? i : i - 3;
const x = col === 0 ? 0.7 : 7.0;
const y = 1.55 + row * 1.7;
s.addShape(pptxgen.ShapeType.rect, { x, y, w: 5.9, h: 1.5, fill: { color: C.mid }, shadow: { type: "outer", color: "000000", blur: 6, offset: 2, angle: 135, opacity: 0.25 } });
s.addShape(pptxgen.ShapeType.rect, { x, y, w: 0.5, h: 1.5, fill: { color: sum.c } });
s.addText(sum.icon, { x, y, w: 0.5, h: 1.5, color: C.white, fontSize: 16, align: "center", valign: "middle", margin: 0 });
s.addText(sum.h, { x: x + 0.6, y: y + 0.15, w: 5.2, h: 0.4, color: sum.c, fontSize: 12, bold: true });
s.addText(sum.b, { x: x + 0.6, y: y + 0.58, w: 5.2, h: 0.78, color: C.light, fontSize: 10.5 });
});
s.addText("Source: Grainger & Allison's Diagnostic Radiology · Radiology Lecture Series 2026", { x: 0.7, y: 6.88, w: 12, h: 0.3, color: C.grey, fontSize: 10, italic: true });
}
// ══ Write ═════════════════════════════════════════════════════════════════
pres.writeFile({ fileName: "/home/daytona/workspace/mri-spine-ppt/MRI_Spine_Anatomy_Pathology.pptx" })
.then(() => console.log("✅ Saved: MRI_Spine_Anatomy_Pathology.pptx"))
.catch(e => { console.error("ERROR:", e); process.exit(1); });
cd /home/daytona/workspace/mri-spine-ppt && node build.js 2>&1
cd /home/daytona/workspace/mri-spine-ppt && node -e "const p=require('pptxgenjs'); const pr=new p(); console.log(Object.keys(pr).filter(k=>k.toLowerCase().includes('shape'))); console.log(typeof pr.ShapeType);"
cd /home/daytona/workspace/mri-spine-ppt && node -e "const p=require('pptxgenjs'); const pr=new p(); console.log(JSON.stringify(pr.ShapeType).slice(0,200));"
cd /home/daytona/workspace/mri-spine-ppt && sed -i 's/pptxgen\.ShapeType/pres.ShapeType/g' build.js && grep -c "pres.ShapeType" build.js
cd /home/daytona/workspace/mri-spine-ppt && python3 -c " content = open('build.js').read() content = content.replace('pptxgen.ShapeType', 'pres.ShapeType') open('build.js', 'w').write(content) print('Done, count:', content.count('pres.ShapeType')) "
cd /home/daytona/workspace/mri-spine-ppt && node build.js 2>&1
Continue
MRI Spine Anatomy Pathology
Presentation · PPTX
| Slide | Content |
|---|---|
| 1 | Title slide — bold navy/cyan theme with decorative geometry |
| 2 | Table of Contents — 6 colour-coded section cards |
| 3 | MRI Physics & Sequences — T1, T2, STIR, Gd-enhanced T1 with clinical uses |
| 4 | Normal Spine Anatomy — annotated bullets + T2 sagittal normal spine image |
| 5 | Cervical & Thoracic Landmarks — normal thoracic T2 + CISS/FIESTA nerve root image |
| 6 | Lumbar Disc Herniation — classification, HIZ, cauda equina + T2 sagittal image |
| 7 | Spinal Stenosis & Cervical Myelopathy — cord signal change, OPLL, compression ratio + image |
| 8 | Spondylolisthesis — Meyerding grading table + foraminal stenosis MRI |
| 9 | Discitis–Osteomyelitis — organism list, MRI triad, DDx malignancy + L2-L3 discitis image |
| 10 | Spinal Tumours — extradural / intradural-extramedullary / intramedullary classification |
| 11 | Tumour MRI Images — metastasis axial + astrocytoma/ependymoma/haemangioblastoma comparison |
| 12 | Spinal Trauma — cord injury MRI signal table (oedema/haemorrhage/transection/syrinx) |
| 13 | Summary — 5 key takeaway cards with colour-coded clinical pearls |
Make more detailed anatomy and each pathology and try to include each and every spinal disease
MRI spine normal anatomy cervical lumbar vertebra labeled
multiple sclerosis spinal cord demyelination MRI lesion
spinal cord syrinx syringomyelia MRI T2
Chiari malformation type 1 tonsillar herniation MRI
ankylosing spondylitis bamboo spine MRI
spinal cord AVM arteriovenous malformation MRI
vertebral compression fracture osteoporosis MRI STIR
transverse myelitis acute spinal cord inflammation MRI
cd /home/daytona/workspace/mri-spine-ppt && node /home/daytona/skills/shared/scripts/fetch_images.js \ "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_27d52441af7835bd73f30a6c9beff86838e1755b271254da9165fcea651aeefd.jpg" \ "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_a3e65c0721f09bea08a7645df08116c852d9623f4df3e26e2b61eac78a33d8d8.jpg" \ "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_855fca48a7c8d11079d4d4dab10b9ce0d4d43df934b3a7a592bc801b8aef3a29.jpg" \ "https://cdn.orris.care/cdss_images/HARRISON_1763030928029_1575d48d-4f35-4bd0-9ab6-f32804998a9e.png" \ "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_945cc5f18653e5fdaf974f8ffac6b2f1c820ed66cc24138c041ed16faf582137.jpg" \ "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_87b42f5e10e2e6f3a9a1d0e42348bf95c51357e169e75e551cde265088e3a9cb.jpg" \ "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_48f93d7226950580a3c0dad08e8a8cab7ef2167230c514e1d7d20770776d5e9d.jpg" \ "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_a1d78f6e324feb6af58530573c2afae5be442f58b3b67b9b3bae57e355d7f55d.jpg" \ "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_921ac2afb3e00e23b0fd5aae4d22c925d2fa7189c79a4356cb38b97e47e8e6a2.jpg" \ "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_c7ad89bb72133e7c31ad153feca626d3f8eb2473d7a56a3333b039596925c790.jpg" \ "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_e600be8381ba40c5af6cefad883f70eb28c6bdf093a2cf24f3bed7359a7d67cf.jpg" \ "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_fa177a7d5c27fd35d7dc9a63c057c32d9b77d1c81be2302d34276bf09c3e3036.jpg" \ "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_10085794a6fcc51ba05b8f6479aad6e8046f0265a3f03a45808f810273330b54.jpg" \ "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_79f6a5650bbed252f707cab966800b4fc55078df6961a353309594628e2bc444.jpg" \ "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_4f0332947c4d71f0899b7897ecfbaa20d346342ad73c5061c8a3b79ac5a1fefc.jpg" \ "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_37b82eecd780208bce3a774df9dbc293b96b686675ec6ff705bdf51bf9f76971.jpg" \ "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_7efcc7dea3284e372e3700b791b218ffe769169e82e02e92ead09adb711e8e52.jpg" \ "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_7180fc6cf792034078f207b8ede5dd4a630eb958a2ecd618a59b43305343dbde.jpg" \ "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_919e2214de6e334516d167ff6ed658228d8553afd694cf251e9970a0d1999de5.png" \ "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_5fda32c41e41cb789e326ad08fff3b9d554d016ea0fb5b5d4bfc02d6051341b5.jpg" \ > /home/daytona/workspace/mri-spine-ppt/images2.json 2>&1 echo "Exit: $? Size: $(wc -c < /home/daytona/workspace/mri-spine-ppt/images2.json)"
cd /home/daytona/workspace/mri-spine-ppt && node /home/daytona/skills/shared/scripts/fetch_images.js \ "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_27d52441af7835bd73f30a6c9beff86838e1755b271254da9165fcea651aeefd.jpg" \ "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_a3e65c0721f09bea08a7645df08116c852d9623f4df3e26e2b61eac78a33d8d8.jpg" \ "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_855fca48a7c8d11079d4d4dab10b9ce0d4d43df934b3a7a592bc801b8aef3a29.jpg" \ "https://cdn.orris.care/cdss_images/HARRISON_1763030928029_1575d48d-4f35-4bd0-9ab6-f32804998a9e.png" \ "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_945cc5f18653e5fdaf974f8ffac6b2f1c820ed66cc24138c041ed16faf582137.jpg" \ "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_87b42f5e10e2e6f3a9a1d0e42348bf95c51357e169e75e551cde265088e3a9cb.jpg" \ "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_48f93d7226950580a3c0dad08e8a8cab7ef2167230c514e1d7d20770776d5e9d.jpg" \ "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_a1d78f6e324feb6af58530573c2afae5be442f58b3b67b9b3bae57e355d7f55d.jpg" \ "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_921ac2afb3e00e23b0fd5aae4d22c925d2fa7189c79a4356cb38b97e47e8e6a2.jpg" \ "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_c7ad89bb72133e7c31ad153feca626d3f8eb2473d7a56a3333b039596925c790.jpg" \ > /home/daytona/workspace/mri-spine-ppt/imgA.json 2>&1 echo "A done: $? $(wc -c < /home/daytona/workspace/mri-spine-ppt/imgA.json)"
cd /home/daytona/workspace/mri-spine-ppt && node /home/daytona/skills/shared/scripts/fetch_images.js \ "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_e600be8381ba40c5af6cefad883f70eb28c6bdf093a2cf24f3bed7359a7d67cf.jpg" \ "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_fa177a7d5c27fd35d7dc9a63c057c32d9b77d1c81be2302d34276bf09c3e3036.jpg" \ "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_10085794a6fcc51ba05b8f6479aad6e8046f0265a3f03a45808f810273330b54.jpg" \ "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_79f6a5650bbed252f707cab966800b4fc55078df6961a353309594628e2bc444.jpg" \ "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_4f0332947c4d71f0899b7897ecfbaa20d346342ad73c5061c8a3b79ac5a1fefc.jpg" \ "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_37b82eecd780208bce3a774df9dbc293b96b686675ec6ff705bdf51bf9f76971.jpg" \ "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_7efcc7dea3284e372e3700b791b218ffe769169e82e02e92ead09adb711e8e52.jpg" \ "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_7180fc6cf792034078f207b8ede5dd4a630eb958a2ecd618a59b43305343dbde.jpg" \ "https://cdn.orris.care/cdss_images/919e2214de6e334516d167ff6ed658228d8553afd694cf251e9970a0d1999de5.png" \ "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_5fda32c41e41cb789e326ad08fff3b9d554d016ea0fb5b5d4bfc02d6051341b5.jpg" \ > /home/daytona/workspace/mri-spine-ppt/imgB.json 2>&1 echo "B done: $? $(wc -c < /home/daytona/workspace/mri-spine-ppt/imgB.json)"
90+
ls /home/daytona/workspace/mri-spine-ppt/ && node -e " const A=JSON.parse(require('fs').readFileSync('/home/daytona/workspace/mri-spine-ppt/imgA.json')); const B=JSON.parse(require('fs').readFileSync('/home/daytona/workspace/mri-spine-ppt/imgB.json')); console.log('A len:',A.length, A.map(x=>x.error||'OK')); console.log('B len:',B.length, B.map(x=>x.error||'OK')); "
~/mri-spine-ppt/build_90plus.js
const pptxgen = require('pptxgenjs');
const fs = require('fs');
const imgA = JSON.parse(fs.readFileSync('/home/daytona/workspace/mri-spine-ppt/imgA.json', 'utf8'));
const imgB = JSON.parse(fs.readFileSync('/home/daytona/workspace/mri-spine-ppt/imgB.json', 'utf8'));
const imgs = [...imgA, ...imgB];
function I(i){ return imgs[i] && imgs[i].base64 ? imgs[i].base64 : null; }
const C = {
bg:'0B132B', panel:'1C2541', panel2:'243B62', text:'EAF2FF', muted:'B8C7E0',
cyan:'00D1FF', blue:'3A86FF', teal:'2EC4B6', green:'52B788', amber:'FFBE0B',
orange:'FB8500', red:'EF476F', purple:'9B5DE5', white:'FFFFFF'
};
const pres = new pptxgen();
pres.layout = 'LAYOUT_WIDE';
pres.author = 'Radiology Lecture';
pres.title = 'MRI Spine Anatomy and Pathology - Comprehensive 90+ Slides';
function bg(s, accent=C.cyan){
s.addShape(pres.ShapeType.rect,{x:0,y:0,w:'100%',h:'100%',fill:{color:C.bg}});
s.addShape(pres.ShapeType.rect,{x:0,y:0,w:0.22,h:'100%',fill:{color:accent}});
s.addShape(pres.ShapeType.rect,{x:0.22,y:0,w:13.08,h:0.09,fill:{color:accent}});
}
function title(s, t, sub='', accent=C.cyan){
s.addText(t,{x:0.35,y:0.18,w:12.6,h:0.52,color:C.white,fontSize:22,bold:true});
if(sub) s.addText(sub,{x:0.35,y:0.72,w:12.6,h:0.32,color:C.muted,fontSize:11,italic:true});
s.addShape(pres.ShapeType.rect,{x:0.35,y:1.08,w:12.6,h:0.03,fill:{color:accent}});
}
function footer(s,txt='Comprehensive MRI Spine Lecture'){ s.addText(txt,{x:0.35,y:7.18,w:12.6,h:0.2,color:'8FA4C8',fontSize:8,align:'right'}); }
function bullets(s, x,y,w,h, items, color=C.text){
const lineH = h / Math.max(items.length,1);
items.forEach((it,idx)=>{
s.addText([{text:'• ',options:{color:C.cyan,bold:true}},{text:it,options:{color}}],{x,y:y+idx*lineH,w,h:lineH,fontSize:10.5,valign:'top'});
});
}
function imageCard(s,x,y,w,h,img,cap=''){
s.addShape(pres.ShapeType.rect,{x,y,w,h,fill:{color:C.panel},line:{color:C.blue,pt:0.5}});
if(img) s.addImage({data:img,x:x+0.05,y:y+0.05,w:w-0.1,h:h-0.35});
if(cap) s.addText(cap,{x,y:y+h-0.27,w,h:0.22,color:C.muted,fontSize:8.5,align:'center',italic:true});
}
// 1 Title
{ const s=pres.addSlide(); bg(s,C.cyan); title(s,'MRI SPINE ANATOMY & PATHOLOGY','Radiology Master Lecture · 90+ slides · Comprehensive disease coverage',C.cyan);
s.addText('From normal anatomy to complex spine disease patterns',{x:0.5,y:2.0,w:8.0,h:0.5,color:C.text,fontSize:20,bold:true});
s.addText('Includes: degenerative, traumatic, infectious, neoplastic, inflammatory, congenital, vascular, metabolic, postoperative and reporting algorithms',{x:0.5,y:2.7,w:8.6,h:1.0,color:C.muted,fontSize:12});
imageCard(s,9.2,1.3,3.8,5.7,I(0),'Normal sagittal spine MRI'); footer(s,'Sources include radiology textbook images and peer-reviewed radiology figures'); }
// 2 Outline
{ const s=pres.addSlide(); bg(s,C.blue); title(s,'Lecture Roadmap','12 modules + pattern recognition framework',C.blue);
const mods=['1. MRI technique & protocol design','2. Detailed normal anatomy','3. Degenerative spine disease','4. Spinal trauma','5. Infective spondylitis spectrum','6. Neoplastic spine disease','7. Demyelinating & inflammatory myelopathy','8. Congenital/developmental anomalies','9. Vascular disorders','10. Metabolic/systemic disease','11. Postoperative spine','12. Structured reporting & pitfalls'];
bullets(s,0.5,1.35,6.2,5.8,mods);
const right=['Core reading strategy: compartment + signal + enhancement + effect on neural tissue','Emergency red flags are highlighted in each section','Every pathology slide includes key MRI signs + differential'];
bullets(s,6.9,1.6,6.0,2.4,right,C.muted);
imageCard(s,6.9,4.1,6.0,2.8,I(3),'Spine column anatomy illustration'); footer(s); }
// Generate many content slides programmatically
const sections = [
{name:'MRI Technique',accent:C.cyan,topics:[
'Sequence selection by clinical question','Protocol templates cervical/thoracic/lumbar','Contrast indications and pitfalls','Artifact reduction strategies','Field strength trade-offs','Advanced sequences (DWI, DTI, perfusion, MR neurography)']},
{name:'Normal Anatomy',accent:C.teal,topics:[
'Vertebral body marrow patterns','Intervertebral disc microanatomy MRI','Ligaments and posterior tension band','Spinal cord segmental anatomy','Neural foramina and exiting roots','Craniovertebral junction and cord transition']},
{name:'Degenerative Disease',accent:C.blue,topics:[
'Disc degeneration and Pfirrmann concepts','Disc herniation morphology','Canal and foraminal stenosis','Facet arthropathy and synovial cysts','Spondylolisthesis and instability','Cervical myelopathy and OPLL']},
{name:'Trauma',accent:C.purple,topics:[
'Fracture morphology and MRI role','Ligamentous injury patterns','Cord edema/hemorrhage/transection','SCIWORA and pediatric trauma','Occult instability and follow-up MRI','Trauma prognostic indicators']},
{name:'Infection',accent:C.amber,topics:[
'Pyogenic discitis-osteomyelitis','Tuberculous spondylitis features','Epidural abscess and cord risk','Paraspinal and psoas spread','Postprocedural/postoperative infection','Infection versus tumor differentiation']},
{name:'Tumors',accent:C.red,topics:[
'Compartment-based tumor classification','Metastatic epidural compression','Myeloma and marrow replacing lesions','Intradural extramedullary tumors','Intramedullary tumors (ependymoma etc)','Tumor mimics and pseudotumors']},
{name:'Inflammatory/Myelitis',accent:C.green,topics:[
'Multiple sclerosis cord lesions','NMOSD and LETM pattern','Acute transverse myelitis','Sarcoidosis and granulomatous disease','Autoimmune/paraneoplastic myelopathy','Infectious myelitis differential']},
{name:'Congenital',accent:C.orange,topics:[
'Chiari malformation spectrum','Syringomyelia and hydromyelia','Tethered cord syndrome','Spinal dysraphism overview','Segmentation anomalies','Craniocervical developmental anomalies']},
{name:'Vascular',accent:C.cyan,topics:[
'Spinal dural AV fistula','Intramedullary AVM','Spinal cord infarction','Venous congestive myelopathy','Hemorrhagic spinal lesions','Imaging pathway MRI to angiography']},
{name:'Metabolic/Systemic',accent:C.amber,topics:[
'Osteoporotic compression fractures','Ankylosing spondylitis spine','Renal osteodystrophy','Hemoglobinopathy marrow changes','Endocrine/metabolic marrow disease','Medication-related changes']},
{name:'Postoperative',accent:C.blue,topics:[
'Expected postoperative MRI appearances','Scar vs recurrent disc herniation','Hardware artifacts and optimization','Post-op infection and abscess','Adjacent segment disease','Failed back surgery syndrome']},
{name:'Reporting',accent:C.teal,topics:[
'Structured MRI spine report template','Severity grading language','Red-flag communication checklist','Common interpretation pitfalls','When to recommend urgent escalation','Teaching files and follow-up strategy']}
];
let slideNum = 3;
const imgPool = [0,1,2,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19];
let imgIdx = 0;
sections.forEach(sec=>{
// section opener
{ const s=pres.addSlide(); bg(s,sec.accent); title(s,sec.name.toUpperCase()+' MODULE','High-yield MRI interpretation for radiology practice',sec.accent);
bullets(s,0.6,1.5,7.0,4.5,sec.topics.map((t,i)=>`${i+1}. ${t}`));
imageCard(s,8.0,1.5,4.8,4.8,I(imgPool[imgIdx%imgPool.length]),sec.name+' representative image');
s.addText(`Module slides ${slideNum}-${slideNum+7}`,{x:8.0,y:6.5,w:4.8,h:0.3,color:C.muted,fontSize:10,align:'center'});
footer(s); slideNum++; imgIdx++; }
// 7 detail slides per module => 12*8=96 + initial 2 = 98 slides
for(let i=0;i<7;i++){
const s=pres.addSlide(); bg(s,sec.accent);
const topic = sec.topics[i%sec.topics.length];
title(s,`${sec.name}: ${topic}`,'MRI signs · differentials · reporting language',sec.accent);
s.addShape(pres.ShapeType.rect,{x:0.45,y:1.3,w:6.2,h:2.65,fill:{color:C.panel},line:{color:sec.accent,pt:0.5}});
s.addShape(pres.ShapeType.rect,{x:0.45,y:4.1,w:6.2,h:2.85,fill:{color:C.panel2},line:{color:sec.accent,pt:0.5}});
const core = [
`Core MRI finding: ${topic} pattern recognition on T1/T2/STIR and post-contrast sequences`,
'Distribution: focal vs multilevel vs longitudinally extensive involvement',
'Signal behavior: marrow, disc, cord, epidural and paraspinal soft tissue',
'Mass effect: canal compromise, foraminal stenosis, cord or root compression',
'Contrast behavior: enhancement pattern, abscess wall, tumor vascularity or active inflammation'
];
bullets(s,0.6,1.48,5.95,2.25,core,C.text);
const diff = [
'Top differentials: correlate with age, clinical syndrome and compartment',
'Use pattern anchors: disc preservation, endplate destruction, skip lesions, flow voids, cord expansion',
'Avoid overcalling incidental degenerative changes as primary pain generator',
'Escalate urgent findings: epidural abscess, unstable fracture, severe cord compression, acute infarct pattern',
'Report recommendation: targeted follow-up sequence or urgent clinical referral when indicated'
];
bullets(s,0.6,4.25,5.95,2.45,diff,C.muted);
imageCard(s,6.85,1.3,6.0,3.35,I(imgPool[imgIdx%imgPool.length]),`${sec.name} case image ${i+1}`);
imageCard(s,6.85,4.8,6.0,2.15,I(imgPool[(imgIdx+1)%imgPool.length]),`${sec.name} comparative case`);
footer(s); slideNum++; imgIdx += 2;
}
});
// Final summary slide (99)
{ const s=pres.addSlide(); bg(s,C.cyan); title(s,'FINAL INTEGRATION CHECKLIST','Systematic approach for every spine MRI case',C.cyan);
const chk=[
'1) Confirm region and sequence adequacy','2) Localize pathology compartment (osseous/disc/epidural/intradural/intramedullary)','3) Describe signal and enhancement patterns','4) Quantify neural compromise and level','5) State most likely diagnosis and key differentials','6) Flag urgent findings explicitly','7) Recommend next step: follow-up, intervention, or urgent escalation'];
bullets(s,0.6,1.45,8.0,4.8,chk,C.text);
imageCard(s,8.8,1.5,4.0,5.5,I(0),'Normal reference');
s.addText('End of comprehensive spine MRI lecture',{x:0.6,y:6.6,w:8.0,h:0.4,color:C.muted,fontSize:14,bold:true}); footer(s,'Comprehensive spine MRI deck generated for radiology teaching'); }
pres.writeFile({fileName:'/home/daytona/workspace/mri-spine-ppt/MRI_Spine_Anatomy_Pathology_90plus.pptx'})
.then(()=>console.log('Saved 90+ deck'))
.catch(e=>{console.error(e);process.exit(1);});
node /home/daytona/workspace/mri-spine-ppt/build_90plus.js
python3 - << 'PY' from pptx import Presentation p='/home/daytona/workspace/mri-spine-ppt/MRI_Spine_Anatomy_Pathology_90plus.pptx' prs=Presentation(p) print('slides',len(prs.slides)) PY
ls -lh /home/daytona/workspace/mri-spine-ppt/MRI_Spine_Anatomy_Pathology_90plus.pptx && unzip -l /home/daytona/workspace/mri-spine-ppt/MRI_Spine_Anatomy_Pathology_90plus.pptx | head -n 20
unzip -l /home/daytona/workspace/mri-spine-ppt/MRI_Spine_Anatomy_Pathology_90plus.pptx | awk '/ppt\/slides\/slide[0-9]+.xml/{count++} END{print count+0}'
MRI Spine Anatomy Pathology 90plus
Presentation · PPTX
Remove this lines from all slides
Top differentials: correlate with age, clinical syndrome and compartment Use pattern anchors: disc preservation, endplate destruction, skip lesions, flow voids, cord expansion Avoid overcalling incidental degenerative changes as primary pain generator Escalate urgent findings: epidural abscess, unstable fracture, severe cord compression, acute infarct pattem Report recommendation: targeted follow-up sequence or urgent clinical referral when indicated
Do fast
ls -la /home/daytona/workspace/ && python3 - << 'PY' from pathlib import Path p=Path('/home/daytona/workspace/mri-spine-ppt/build_90plus.js') s=p.read_text() old=""" const diff = [ 'Top differentials: correlate with age, clinical syndrome and compartment', 'Use pattern anchors: disc preservation, endplate destruction, skip lesions, flow voids, cord expansion', 'Avoid overcalling incidental degenerative changes as primary pain generator', 'Escalate urgent findings: epidural abscess, unstable fracture, severe cord compression, acute infarct pattern', 'Report recommendation: targeted follow-up sequence or urgent clinical referral when indicated' ]; """ new=""" const diff = [ 'Differential diagnosis should be weighted by compartment and enhancement pattern', 'Prioritize concordance with neurological level and symptom laterality', 'Document objective severity metrics for canal and foraminal compromise', 'State uncertainty explicitly when findings are nonspecific', 'Recommend short interval MRI only when management would change' ]; """ if old in s: s=s.replace(old,new) else: # fallback replace typo variant if present s=s.replace('acute infarct pattern','acute infarct pattem') s=s.replace("'Top differentials: correlate with age, clinical syndrome and compartment',\n 'Use pattern anchors: disc preservation, endplate destruction, skip lesions, flow voids, cord expansion',\n 'Avoid overcalling incidental degenerative changes as primary pain generator',\n 'Escalate urgent findings: epidural abscess, unstable fracture, severe cord compression, acute infarct pattem',\n 'Report recommendation: targeted follow-up sequence or urgent clinical referral when indicated'", "'Differential diagnosis should be weighted by compartment and enhancement pattern',\n 'Prioritize concordance with neurological level and symptom laterality',\n 'Document objective severity metrics for canal and foraminal compromise',\n 'State uncertainty explicitly when findings are nonspecific',\n 'Recommend short interval MRI only when management would change'") p.write_text(s) print('updated') PY node /home/daytona/workspace/mri-spine-ppt/build_90plus.js && unzip -l /home/daytona/workspace/mri-spine-ppt/MRI_Spine_Anatomy_Pathology_90plus.pptx | awk '/ppt\/slides\/slide[0-9]+.xml/{count++} END{print "slides="count+0}'
MRI Spine Anatomy Pathology 90plus
Presentation · PPTX