Can you make ppt?
Brain and its parts anatomy. What's stroke Why does it happens Major causes of stroke Regions of brain where stroke happens and reason for it. Treatment and diagnosis
mkdir -p /home/daytona/workspace/brain-stroke-ppt
~/brain-stroke-ppt/create_ppt.js
const pptxgen = require("pptxgenjs");
const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Brain Anatomy & Stroke";
pres.author = "Medical Education";
// ─── COLOR PALETTE ───────────────────────────────────────────────────────────
const C = {
navyDark: "0A1628", // dominant dark bg
navy: "0D2147", // section headers
blue: "1A3A6E", // accent boxes
lightBlue: "2A6496", // sub-headers
teal: "1F7A8C", // highlights
red: "C0392B", // danger / alert
orange: "E67E22", // warning / cause
white: "FFFFFF",
offWhite: "F0F4F8",
lightGray: "D0D8E4",
textGray: "8899AA",
};
// ─── HELPERS ─────────────────────────────────────────────────────────────────
function addSlideBg(slide, color) {
slide.addShape(pres.ShapeType.rect, {
x: 0, y: 0, w: "100%", h: "100%",
fill: { color },
line: { type: "none" },
});
}
function addAccentBar(slide, color, x, y, w, h) {
slide.addShape(pres.ShapeType.rect, {
x, y, w, h,
fill: { color },
line: { type: "none" },
});
}
function addCard(slide, x, y, w, h, fillColor) {
slide.addShape(pres.ShapeType.rect, {
x, y, w, h,
fill: { color: fillColor },
line: { color: C.lightBlue, width: 1 },
rectRadius: 0.08,
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 1 – TITLE SLIDE
// ═══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
addSlideBg(s, C.navyDark);
// Left accent bar
addAccentBar(s, C.teal, 0, 0, 0.18, 5.625);
// Brain icon area (top right gradient box)
addAccentBar(s, C.blue, 7.2, 0, 2.8, 5.625);
s.addText("🧠", { x: 7.8, y: 1.5, w: 1.6, h: 1.6, fontSize: 72, align: "center" });
// Main title
s.addText("BRAIN ANATOMY", {
x: 0.4, y: 0.8, w: 6.6, h: 0.9,
fontSize: 40, bold: true, color: C.white,
fontFace: "Calibri", charSpacing: 4,
});
s.addText("& STROKE", {
x: 0.4, y: 1.65, w: 6.6, h: 0.9,
fontSize: 40, bold: true, color: C.teal,
fontFace: "Calibri", charSpacing: 4,
});
// Subtitle
s.addText("Understanding Brain Structure, Stroke Mechanisms,\nCauses, Regional Effects & Treatment", {
x: 0.4, y: 2.7, w: 6.6, h: 1.0,
fontSize: 16, color: C.lightGray, fontFace: "Calibri", lineSpacingMultiple: 1.3,
});
// Bottom bar
addAccentBar(s, C.blue, 0, 5.1, 10, 0.525);
s.addText("Academic Medical Presentation | Neurology & Neuroanatomy", {
x: 0.4, y: 5.15, w: 9.2, h: 0.4,
fontSize: 11, color: C.lightGray, fontFace: "Calibri", align: "center",
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 2 – TABLE OF CONTENTS
// ═══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
addSlideBg(s, C.offWhite);
addAccentBar(s, C.navy, 0, 0, 10, 1.1);
s.addText("TABLE OF CONTENTS", {
x: 0.4, y: 0.2, w: 9.2, h: 0.7,
fontSize: 28, bold: true, color: C.white, fontFace: "Calibri", charSpacing: 3,
});
const items = [
["01", "Brain Overview & Major Parts"],
["02", "Cerebral Lobes & Functions"],
["03", "Deep Brain Structures"],
["04", "What Is a Stroke?"],
["05", "Types of Stroke"],
["06", "Why Does Stroke Happen?"],
["07", "Major Causes & Risk Factors"],
["08", "Brain Regions & Stroke Effects"],
["09", "Stroke Syndromes by Region"],
["10", "Diagnosis of Stroke"],
["11", "Treatment of Stroke"],
["12", "Prevention & Conclusion"],
];
const col1 = items.slice(0, 6);
const col2 = items.slice(6);
col1.forEach(([num, text], i) => {
addCard(s, 0.3, 1.25 + i * 0.68, 4.5, 0.58, C.navy);
s.addText(num, { x: 0.35, y: 1.28 + i * 0.68, w: 0.5, h: 0.5, fontSize: 13, bold: true, color: C.teal });
s.addText(text, { x: 0.9, y: 1.28 + i * 0.68, w: 3.8, h: 0.5, fontSize: 13, color: C.white, fontFace: "Calibri" });
});
col2.forEach(([num, text], i) => {
addCard(s, 5.1, 1.25 + i * 0.68, 4.5, 0.58, C.navy);
s.addText(num, { x: 5.15, y: 1.28 + i * 0.68, w: 0.5, h: 0.5, fontSize: 13, bold: true, color: C.teal });
s.addText(text, { x: 5.7, y: 1.28 + i * 0.68, w: 3.8, h: 0.5, fontSize: 13, color: C.white, fontFace: "Calibri" });
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 3 – BRAIN OVERVIEW
// ═══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
addSlideBg(s, C.navyDark);
addAccentBar(s, C.blue, 0, 0, 10, 1.0);
s.addText("BRAIN OVERVIEW & MAJOR PARTS", {
x: 0.4, y: 0.15, w: 9.2, h: 0.7,
fontSize: 26, bold: true, color: C.white, fontFace: "Calibri", charSpacing: 2,
});
addAccentBar(s, C.teal, 0.4, 1.05, 0.06, 4.2);
const parts = [
{ name: "Cerebrum", desc: "Largest part (~85% of brain weight). Divided into two hemispheres. Controls thought, memory, senses, voluntary movement." },
{ name: "Cerebellum", desc: "Located at the back. Coordinates balance, fine motor control, and precise movements." },
{ name: "Brainstem", desc: "Connects brain to spinal cord. Controls breathing, heart rate, blood pressure, and consciousness." },
{ name: "Diencephalon", desc: "Includes thalamus and hypothalamus. Relays sensory info and regulates homeostasis." },
];
parts.forEach((p, i) => {
addCard(s, 0.6, 1.1 + i * 1.05, 8.8, 0.9, C.blue);
s.addText(p.name, { x: 0.75, y: 1.15 + i * 1.05, w: 1.8, h: 0.7, fontSize: 15, bold: true, color: C.teal, fontFace: "Calibri", valign: "middle" });
s.addText(p.desc, { x: 2.6, y: 1.15 + i * 1.05, w: 6.6, h: 0.7, fontSize: 13, color: C.offWhite, fontFace: "Calibri", valign: "middle" });
addAccentBar(s, C.teal, 2.55, 1.18 + i * 1.05, 0.04, 0.64);
});
s.addText("The adult human brain weighs approximately 1.3–1.4 kg and contains ~86 billion neurons.", {
x: 0.4, y: 5.2, w: 9.2, h: 0.3,
fontSize: 11, color: C.textGray, italic: true, fontFace: "Calibri",
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 4 – CEREBRAL LOBES
// ═══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
addSlideBg(s, C.offWhite);
addAccentBar(s, C.navy, 0, 0, 10, 1.0);
s.addText("CEREBRAL LOBES & THEIR FUNCTIONS", {
x: 0.4, y: 0.15, w: 9.2, h: 0.7,
fontSize: 26, bold: true, color: C.white, fontFace: "Calibri",
});
const lobes = [
{ name: "FRONTAL LOBE", color: "1A5276", icon: "🧩", funcs: ["Voluntary movement (motor cortex)", "Executive functions & planning", "Speech production (Broca's area)", "Personality & decision-making"] },
{ name: "PARIETAL LOBE", color: "1F618D", icon: "🤲", funcs: ["Somatosensory processing", "Spatial orientation", "Integration of sensory info", "Reading & mathematics"] },
{ name: "TEMPORAL LOBE", color: "117A65", icon: "👂", funcs: ["Auditory processing", "Language comprehension (Wernicke's)", "Memory formation (hippocampus)", "Emotional responses"] },
{ name: "OCCIPITAL LOBE", color: "6E2F9E", icon: "👁️", funcs: ["Visual processing", "Color & motion perception", "Object & face recognition", "Visual-spatial processing"] },
];
lobes.forEach((l, i) => {
const col = i % 2;
const row = Math.floor(i / 2);
const x = 0.3 + col * 4.85;
const y = 1.15 + row * 2.1;
addCard(s, x, y, 4.6, 1.95, l.color);
s.addText(l.icon + " " + l.name, {
x: x + 0.15, y: y + 0.1, w: 4.3, h: 0.45,
fontSize: 14, bold: true, color: C.white, fontFace: "Calibri",
});
addAccentBar(s, C.teal, x + 0.15, y + 0.55, 4.0, 0.03);
l.funcs.forEach((f, fi) => {
s.addText("• " + f, {
x: x + 0.2, y: y + 0.63 + fi * 0.3, w: 4.2, h: 0.28,
fontSize: 11.5, color: C.offWhite, fontFace: "Calibri",
});
});
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 5 – DEEP BRAIN STRUCTURES
// ═══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
addSlideBg(s, C.navyDark);
addAccentBar(s, C.lightBlue, 0, 0, 10, 1.0);
s.addText("DEEP BRAIN STRUCTURES", {
x: 0.4, y: 0.15, w: 9.2, h: 0.7,
fontSize: 26, bold: true, color: C.white, fontFace: "Calibri",
});
const structs = [
{ name: "Thalamus", desc: "Sensory relay station. Routes signals from all senses (except smell) to the appropriate cortical areas." },
{ name: "Hypothalamus", desc: "Regulates body temperature, hunger, thirst, hormones, and the autonomic nervous system." },
{ name: "Hippocampus", desc: "Critical for formation of new memories. Located in the medial temporal lobe." },
{ name: "Amygdala", desc: "Processes emotions, especially fear. Involved in emotional memory and the fight-or-flight response." },
{ name: "Basal Ganglia", desc: "Cluster of nuclei (caudate, putamen, globus pallidus). Regulate voluntary movement, learning, and habit formation." },
{ name: "Corpus Callosum", desc: "Large white matter bundle connecting left and right cerebral hemispheres for inter-hemispheric communication." },
];
structs.forEach((st, i) => {
const col = i % 2;
const row = Math.floor(i / 2);
const x = 0.3 + col * 5.0;
const y = 1.15 + row * 1.42;
addCard(s, x, y, 4.6, 1.28, C.blue);
addAccentBar(s, C.teal, x, y, 0.12, 1.28);
s.addText(st.name, { x: x + 0.22, y: y + 0.08, w: 4.2, h: 0.35, fontSize: 14, bold: true, color: C.teal, fontFace: "Calibri" });
s.addText(st.desc, { x: x + 0.22, y: y + 0.44, w: 4.2, h: 0.78, fontSize: 11.5, color: C.offWhite, fontFace: "Calibri", lineSpacingMultiple: 1.2 });
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 6 – WHAT IS A STROKE?
// ═══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
addSlideBg(s, C.navyDark);
addAccentBar(s, C.red, 0, 0, 10, 1.0);
s.addText("WHAT IS A STROKE?", {
x: 0.4, y: 0.15, w: 9.2, h: 0.7,
fontSize: 26, bold: true, color: C.white, fontFace: "Calibri", charSpacing: 3,
});
// Definition box
addCard(s, 0.4, 1.1, 9.2, 1.2, "7B241C");
s.addText("⚠ A stroke (cerebrovascular accident – CVA) occurs when blood supply to part of the brain is suddenly interrupted or a blood vessel ruptures, causing brain cells to die within minutes due to lack of oxygen and nutrients.", {
x: 0.55, y: 1.18, w: 8.9, h: 1.05,
fontSize: 14, color: C.white, fontFace: "Calibri", lineSpacingMultiple: 1.4, bold: false,
});
s.addText("KEY FACTS", { x: 0.4, y: 2.45, w: 9.2, h: 0.4, fontSize: 15, bold: true, color: C.teal, fontFace: "Calibri" });
const facts = [
{ icon: "🕐", text: "Time-critical emergency — neurons die at ~1.9 million per minute" },
{ icon: "🌍", text: "2nd leading cause of death and major cause of disability worldwide" },
{ icon: "🔁", text: "\"FAST\" — Face drooping, Arm weakness, Speech difficulty, Time to call emergency" },
{ icon: "♻️", text: "Up to 80% of strokes are preventable through lifestyle modification" },
];
facts.forEach((f, i) => {
addCard(s, 0.4 + (i % 2) * 4.85, 2.9 + Math.floor(i / 2) * 1.2, 4.6, 1.05, C.blue);
s.addText(f.icon, { x: 0.55 + (i % 2) * 4.85, y: 2.95 + Math.floor(i / 2) * 1.2, w: 0.6, h: 0.85, fontSize: 24, align: "center", valign: "middle" });
s.addText(f.text, { x: 1.2 + (i % 2) * 4.85, y: 2.95 + Math.floor(i / 2) * 1.2, w: 3.9, h: 0.85, fontSize: 12.5, color: C.offWhite, fontFace: "Calibri", valign: "middle", lineSpacingMultiple: 1.2 });
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 7 – TYPES OF STROKE
// ═══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
addSlideBg(s, C.offWhite);
addAccentBar(s, C.navy, 0, 0, 10, 1.0);
s.addText("TYPES OF STROKE", {
x: 0.4, y: 0.15, w: 9.2, h: 0.7,
fontSize: 26, bold: true, color: C.white, fontFace: "Calibri",
});
// Ischemic Stroke
addCard(s, 0.3, 1.1, 4.5, 4.1, "1A3A6E");
addAccentBar(s, C.teal, 0.3, 1.1, 4.5, 0.45);
s.addText("🔵 ISCHEMIC STROKE", { x: 0.45, y: 1.13, w: 4.2, h: 0.38, fontSize: 14, bold: true, color: C.navyDark, fontFace: "Calibri" });
s.addText("~87% of all strokes", { x: 0.45, y: 1.6, w: 4.2, h: 0.3, fontSize: 12, color: C.teal, bold: true, fontFace: "Calibri" });
const ischemicPoints = [
"Caused by a blood clot blocking an artery",
"Thrombotic: clot forms in cerebral artery",
"Embolic: clot travels from heart or aorta",
"Lacunar: small vessel occlusion in deep brain",
"Symptoms appear suddenly",
"Treated with tPA (clot-busting drug)",
];
ischemicPoints.forEach((p, i) => {
s.addText("• " + p, { x: 0.5, y: 2.0 + i * 0.5, w: 4.1, h: 0.45, fontSize: 12, color: C.offWhite, fontFace: "Calibri" });
});
// Hemorrhagic Stroke
addCard(s, 5.1, 1.1, 4.5, 4.1, "7B241C");
addAccentBar(s, C.orange, 5.1, 1.1, 4.5, 0.45);
s.addText("🔴 HEMORRHAGIC STROKE", { x: 5.25, y: 1.13, w: 4.2, h: 0.38, fontSize: 14, bold: true, color: C.navyDark, fontFace: "Calibri" });
s.addText("~13% of all strokes — more deadly", { x: 5.25, y: 1.6, w: 4.2, h: 0.3, fontSize: 12, color: C.orange, bold: true, fontFace: "Calibri" });
const hemorrhagicPoints = [
"Caused by rupture of a blood vessel",
"Intracerebral: bleeding within brain tissue",
"Subarachnoid: bleeding in space around brain",
"Often due to hypertension or aneurysm",
"Higher mortality rate than ischemic",
"Surgery/clipping may be required",
];
hemorrhagicPoints.forEach((p, i) => {
s.addText("• " + p, { x: 5.3, y: 2.0 + i * 0.5, w: 4.1, h: 0.45, fontSize: 12, color: C.offWhite, fontFace: "Calibri" });
});
// TIA note
addCard(s, 0.3, 5.25, 9.3, 0.3, C.teal);
s.addText("⚡ TIA (Transient Ischemic Attack) = 'Mini-stroke' — temporary blockage, same symptoms but resolves within 24 hours. Strong predictor of future stroke.", {
x: 0.45, y: 5.27, w: 9.1, h: 0.28, fontSize: 11, color: C.white, fontFace: "Calibri",
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 8 – WHY DOES STROKE HAPPEN?
// ═══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
addSlideBg(s, C.navyDark);
addAccentBar(s, C.orange, 0, 0, 10, 1.0);
s.addText("WHY DOES STROKE HAPPEN? — PATHOPHYSIOLOGY", {
x: 0.4, y: 0.15, w: 9.2, h: 0.7,
fontSize: 22, bold: true, color: C.white, fontFace: "Calibri",
});
// Cascade steps
const steps = [
{ num: "1", title: "Blood Flow Interruption", detail: "An artery to the brain is either blocked (ischemic) or ruptured (hemorrhagic), stopping oxygen delivery." },
{ num: "2", title: "Energy Failure", detail: "Without oxygen, neurons can't produce ATP. Ion pumps fail within seconds — Na⁺ and Ca²⁺ flood into cells." },
{ num: "3", title: "Ischemic Cascade", detail: "Glutamate excitotoxicity, free radical production, and mitochondrial failure trigger cell death pathways." },
{ num: "4", title: "Infarct Core vs. Penumbra", detail: "Core: irreversibly dead cells. Penumbra: surrounding at-risk tissue that can be SAVED if reperfusion occurs quickly." },
{ num: "5", title: "Cerebral Edema", detail: "Cell swelling and brain edema develop hours later, worsening damage and raising intracranial pressure." },
];
steps.forEach((step, i) => {
addAccentBar(s, i === 3 ? C.teal : C.orange, 0.4, 1.1 + i * 0.88, 0.5, 0.7);
s.addText(step.num, { x: 0.4, y: 1.1 + i * 0.88, w: 0.5, h: 0.7, fontSize: 18, bold: true, color: C.navyDark, align: "center", valign: "middle" });
addCard(s, 0.96, 1.1 + i * 0.88, 8.7, 0.7, C.blue);
s.addText(step.title + ": ", { x: 1.1, y: 1.14 + i * 0.88, w: 2.0, h: 0.55, fontSize: 12.5, bold: true, color: C.teal, fontFace: "Calibri", valign: "middle" });
s.addText(step.detail, { x: 3.1, y: 1.14 + i * 0.88, w: 6.4, h: 0.55, fontSize: 12, color: C.offWhite, fontFace: "Calibri", valign: "middle" });
});
s.addText("\"Time is Brain\" — Every second of delayed treatment results in irreversible neuron loss", {
x: 0.4, y: 5.35, w: 9.2, h: 0.25,
fontSize: 11.5, color: C.orange, italic: true, bold: true, fontFace: "Calibri", align: "center",
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 9 – MAJOR CAUSES & RISK FACTORS
// ═══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
addSlideBg(s, C.offWhite);
addAccentBar(s, C.red, 0, 0, 10, 1.0);
s.addText("MAJOR CAUSES & RISK FACTORS", {
x: 0.4, y: 0.15, w: 9.2, h: 0.7,
fontSize: 26, bold: true, color: C.white, fontFace: "Calibri",
});
// Modifiable
addCard(s, 0.3, 1.15, 4.5, 4.15, C.navy);
addAccentBar(s, C.red, 0.3, 1.15, 4.5, 0.4);
s.addText("⚠ MODIFIABLE RISK FACTORS", { x: 0.4, y: 1.18, w: 4.3, h: 0.35, fontSize: 13, bold: true, color: C.navyDark, fontFace: "Calibri" });
const modifiable = [
"🔴 Hypertension (single biggest risk factor)",
"🍬 Diabetes mellitus",
"🚬 Cigarette smoking",
"💊 Atrial fibrillation / heart disease",
"🍔 High cholesterol (atherosclerosis)",
"🍷 Excessive alcohol consumption",
"🪑 Physical inactivity & obesity",
"💊 Oral contraceptives (in young women)",
];
modifiable.forEach((m, i) => {
s.addText(m, { x: 0.45, y: 1.65 + i * 0.45, w: 4.25, h: 0.4, fontSize: 12, color: C.offWhite, fontFace: "Calibri" });
});
// Non-modifiable
addCard(s, 5.1, 1.15, 4.5, 4.15, C.navy);
addAccentBar(s, C.orange, 5.1, 1.15, 4.5, 0.4);
s.addText("🔒 NON-MODIFIABLE FACTORS", { x: 5.25, y: 1.18, w: 4.2, h: 0.35, fontSize: 13, bold: true, color: C.navyDark, fontFace: "Calibri" });
const nonModifiable = [
"👴 Age (risk doubles every 10 yrs after 55)",
"♂ Sex (men have higher risk)",
"🧬 Family history / genetics",
"🌍 Race (African Americans: 2× higher risk)",
"📜 Prior stroke or TIA history",
];
nonModifiable.forEach((n, i) => {
s.addText(n, { x: 5.3, y: 1.65 + i * 0.6, w: 4.2, h: 0.55, fontSize: 12, color: C.offWhite, fontFace: "Calibri" });
});
s.addText("Hypertension is responsible for ~54% of all strokes globally (WHO, 2023)", {
x: 0.3, y: 5.35, w: 9.4, h: 0.25,
fontSize: 11, color: C.textGray, italic: true, align: "center",
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 10 – BRAIN REGIONS & STROKE EFFECTS
// ═══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
addSlideBg(s, C.navyDark);
addAccentBar(s, C.lightBlue, 0, 0, 10, 1.0);
s.addText("BRAIN REGIONS WHERE STROKE OCCURS & EFFECTS", {
x: 0.4, y: 0.15, w: 9.2, h: 0.7,
fontSize: 22, bold: true, color: C.white, fontFace: "Calibri",
});
const regions = [
{ region: "Middle Cerebral Artery (MCA)", pct: "Most common (40–50%)", effects: "Contralateral hemiplegia, hemisensory loss (face & arm > leg), aphasia (if dominant hemisphere), neglect." },
{ region: "Anterior Cerebral Artery (ACA)", pct: "~5% of strokes", effects: "Contralateral leg weakness > arm, urinary incontinence, personality changes, abulia." },
{ region: "Posterior Cerebral Artery (PCA)", pct: "~10% of strokes", effects: "Contralateral homonymous hemianopia, thalamic pain syndrome, memory impairment, visual agnosia." },
{ region: "Vertebrobasilar / Brainstem", pct: "~20% of strokes", effects: "Diplopia, dysphagia, ataxia, 'crossed' deficits (ipsilateral face + contralateral limb). Can be fatal." },
{ region: "Lacunar (Small Vessel)", pct: "~25% of strokes", effects: "Pure motor or sensory stroke, ataxic hemiparesis, dysarthria. Usually internal capsule, pons, or thalamus." },
];
regions.forEach((r, i) => {
addCard(s, 0.35, 1.1 + i * 0.9, 9.3, 0.82, C.blue);
addAccentBar(s, C.teal, 0.35, 1.1 + i * 0.9, 0.1, 0.82);
s.addText(r.region, { x: 0.55, y: 1.12 + i * 0.9, w: 2.8, h: 0.38, fontSize: 13, bold: true, color: C.teal, fontFace: "Calibri" });
s.addText(r.pct, { x: 0.55, y: 1.5 + i * 0.9, w: 2.8, h: 0.28, fontSize: 11, color: C.orange, fontFace: "Calibri", italic: true });
addAccentBar(s, C.lightBlue, 3.4, 1.18 + i * 0.9, 0.03, 0.6);
s.addText(r.effects, { x: 3.5, y: 1.12 + i * 0.9, w: 6.0, h: 0.72, fontSize: 11.5, color: C.offWhite, fontFace: "Calibri", valign: "middle", lineSpacingMultiple: 1.2 });
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 11 – STROKE SYNDROMES BY REGION
// ═══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
addSlideBg(s, C.offWhite);
addAccentBar(s, C.navy, 0, 0, 10, 1.0);
s.addText("NOTABLE STROKE SYNDROMES", {
x: 0.4, y: 0.15, w: 9.2, h: 0.7,
fontSize: 26, bold: true, color: C.white, fontFace: "Calibri",
});
const syndromes = [
{ name: "Wallenberg Syndrome", artery: "PICA (posterior inferior cerebellar)", features: "Ipsilateral: facial numbness, Horner's, ataxia, dysphagia. Contralateral: pain/temp loss in limbs." },
{ name: "Weber Syndrome", artery: "PCA / midbrain perforators", features: "Ipsilateral CN III palsy (ptosis, mydriasis). Contralateral hemiplegia. Midbrain lesion." },
{ name: "Locked-in Syndrome", artery: "Basilar artery (ventral pons)", features: "Complete paralysis except vertical eye movements. Consciousness preserved. Devastating outcome." },
{ name: "Broca's Aphasia Stroke", artery: "MCA superior division (dominant)", features: "Non-fluent speech, poor articulation, comprehension intact. Patient is aware and frustrated." },
{ name: "Wernicke's Aphasia Stroke", artery: "MCA inferior division (dominant)", features: "Fluent but meaningless speech ('word salad'). Poor comprehension. Patient unaware of deficit." },
];
syndromes.forEach((syn, i) => {
addCard(s, 0.3, 1.15 + i * 0.87, 9.4, 0.79, i % 2 === 0 ? C.navy : "0F2A50");
s.addText(syn.name, { x: 0.45, y: 1.18 + i * 0.87, w: 2.4, h: 0.35, fontSize: 13, bold: true, color: C.teal, fontFace: "Calibri" });
s.addText("(" + syn.artery + ")", { x: 0.45, y: 1.53 + i * 0.87, w: 2.4, h: 0.25, fontSize: 10, color: C.textGray, italic: true, fontFace: "Calibri" });
addAccentBar(s, C.teal, 2.92, 1.22 + i * 0.87, 0.04, 0.6);
s.addText(syn.features, { x: 3.05, y: 1.18 + i * 0.87, w: 6.5, h: 0.72, fontSize: 12, color: C.offWhite, fontFace: "Calibri", valign: "middle", lineSpacingMultiple: 1.2 });
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 12 – DIAGNOSIS
// ═══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
addSlideBg(s, C.navyDark);
addAccentBar(s, C.teal, 0, 0, 10, 1.0);
s.addText("DIAGNOSIS OF STROKE", {
x: 0.4, y: 0.15, w: 9.2, h: 0.7,
fontSize: 26, bold: true, color: C.white, fontFace: "Calibri",
});
const diagnoses = [
{ tool: "Non-contrast CT Scan", time: "First-line | ≤25 min", detail: "Rapidly rules out hemorrhage. May appear normal in early ischemic stroke (<6 hrs). Fast, widely available." },
{ tool: "MRI / DWI", time: "Gold standard for ischemia", detail: "Diffusion-weighted imaging detects ischemic stroke within minutes. Shows infarct size and penumbra. Better sensitivity than CT." },
{ tool: "CT Angiography (CTA)", time: "Immediate vascular imaging", detail: "Identifies site of arterial occlusion. Essential for planning mechanical thrombectomy. Also detects aneurysms." },
{ tool: "ECG / Holter Monitor", time: "Cardiac evaluation", detail: "Detects atrial fibrillation — major cardioembolic source. Must be done in all ischemic stroke patients." },
{ tool: "Blood Tests", time: "Baseline labs", detail: "CBC, coagulation (PT/INR/aPTT), glucose, lipid panel, troponin, renal function. Rules out mimics (hypoglycemia)." },
{ tool: "NIH Stroke Scale (NIHSS)", time: "Clinical severity score", detail: "0–42 point neurological assessment. Guides treatment decisions and predicts outcomes." },
];
diagnoses.forEach((d, i) => {
const col = i % 2;
const row = Math.floor(i / 2);
const x = 0.3 + col * 5.0;
const y = 1.12 + row * 1.45;
addCard(s, x, y, 4.6, 1.3, C.blue);
addAccentBar(s, C.teal, x, y, 0.12, 1.3);
s.addText(d.tool, { x: x + 0.22, y: y + 0.08, w: 3.5, h: 0.35, fontSize: 13, bold: true, color: C.white, fontFace: "Calibri" });
s.addText(d.time, { x: x + 0.22, y: y + 0.42, w: 3.8, h: 0.25, fontSize: 11, color: C.teal, italic: true, fontFace: "Calibri" });
s.addText(d.detail, { x: x + 0.22, y: y + 0.66, w: 4.2, h: 0.6, fontSize: 11, color: C.offWhite, fontFace: "Calibri", lineSpacingMultiple: 1.15 });
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 13 – TREATMENT
// ═══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
addSlideBg(s, C.offWhite);
addAccentBar(s, C.red, 0, 0, 10, 1.0);
s.addText("TREATMENT OF STROKE", {
x: 0.4, y: 0.15, w: 9.2, h: 0.7,
fontSize: 26, bold: true, color: C.white, fontFace: "Calibri",
});
// Ischemic treatments
addCard(s, 0.3, 1.1, 4.5, 2.15, C.navy);
addAccentBar(s, C.teal, 0.3, 1.1, 4.5, 0.38);
s.addText("🔵 ISCHEMIC STROKE", { x: 0.45, y: 1.13, w: 4.2, h: 0.32, fontSize: 13, bold: true, color: C.navyDark, fontFace: "Calibri" });
const ischemicTx = [
"IV tPA (alteplase): within 4.5 hours of onset",
"Mechanical thrombectomy: up to 24 hrs (large vessel)",
"Aspirin: given within 24–48 hrs",
"Anticoagulation for AF-related embolism",
"Stroke unit admission with monitoring",
];
ischemicTx.forEach((t, i) => {
s.addText("• " + t, { x: 0.45, y: 1.55 + i * 0.33, w: 4.25, h: 0.3, fontSize: 11.5, color: C.offWhite, fontFace: "Calibri" });
});
// Hemorrhagic
addCard(s, 5.1, 1.1, 4.5, 2.15, C.navy);
addAccentBar(s, C.red, 5.1, 1.1, 4.5, 0.38);
s.addText("🔴 HEMORRHAGIC STROKE", { x: 5.25, y: 1.13, w: 4.2, h: 0.32, fontSize: 13, bold: true, color: C.navyDark, fontFace: "Calibri" });
const hemTx = [
"Reverse anticoagulation immediately",
"Control BP aggressively (target <140 mmHg)",
"Surgical evacuation of hematoma (selected)",
"Coil embolization / surgical clipping for aneurysm",
"ICP monitoring and management",
];
hemTx.forEach((t, i) => {
s.addText("• " + t, { x: 5.3, y: 1.55 + i * 0.33, w: 4.25, h: 0.3, fontSize: 11.5, color: C.offWhite, fontFace: "Calibri" });
});
// General & Rehab
addCard(s, 0.3, 3.38, 9.3, 1.65, C.blue);
addAccentBar(s, C.orange, 0.3, 3.38, 9.3, 0.38);
s.addText("🔶 GENERAL MANAGEMENT & REHABILITATION", { x: 0.45, y: 3.41, w: 9.0, h: 0.32, fontSize: 13, bold: true, color: C.navyDark, fontFace: "Calibri" });
const generalTx = [
["Airway & O₂", "Maintain O₂ sat >94%, intubation if needed"],
["Glucose control", "Target 140–180 mg/dL; avoid hypo/hyperglycemia"],
["Physiotherapy", "Early mobilization within 24–48 hrs post-stroke"],
["Speech therapy", "For aphasia and dysphagia rehabilitation"],
];
generalTx.forEach((gt, i) => {
const col = i % 2;
const row = Math.floor(i / 2);
s.addText("• " + gt[0] + ": ", { x: 0.5 + col * 4.65, y: 3.84 + row * 0.55, w: 1.5, h: 0.5, fontSize: 12, bold: true, color: C.teal, fontFace: "Calibri" });
s.addText(gt[1], { x: 1.85 + col * 4.65, y: 3.84 + row * 0.55, w: 3.0, h: 0.5, fontSize: 12, color: C.offWhite, fontFace: "Calibri" });
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 14 – PREVENTION
// ═══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
addSlideBg(s, C.navyDark);
addAccentBar(s, C.teal, 0, 0, 10, 1.0);
s.addText("STROKE PREVENTION", {
x: 0.4, y: 0.15, w: 9.2, h: 0.7,
fontSize: 26, bold: true, color: C.white, fontFace: "Calibri",
});
const prevention = [
{ icon: "💊", title: "Antihypertensives", detail: "Control BP below 130/80 mmHg. The single most effective stroke prevention strategy." },
{ icon: "🩸", title: "Anticoagulants/Antiplatelets", detail: "Warfarin or DOACs for AF. Aspirin/clopidogrel after TIA or minor ischemic stroke." },
{ icon: "🥗", title: "Diet & Lifestyle", detail: "DASH/Mediterranean diet. Reduce sodium, saturated fat. Regular aerobic exercise ≥150 min/week." },
{ icon: "🚭", title: "Smoking Cessation", detail: "Smoking doubles stroke risk. Cessation reduces risk to near-baseline within 5 years." },
{ icon: "🏋️", title: "Weight Management", detail: "Obesity raises BP, diabetes, and lipid levels. BMI target: 18.5–24.9 kg/m²." },
{ icon: "❤️", title: "Treat Underlying Disease", detail: "Manage diabetes (HbA1c <7%), dyslipidemia (statin therapy), and cardiac arrhythmias promptly." },
];
prevention.forEach((p, i) => {
const col = i % 3;
const row = Math.floor(i / 3);
const x = 0.3 + col * 3.25;
const y = 1.15 + row * 2.1;
addCard(s, x, y, 3.1, 1.95, C.blue);
s.addText(p.icon, { x: x + 0.1, y: y + 0.12, w: 0.7, h: 0.7, fontSize: 28, align: "center" });
s.addText(p.title, { x: x + 0.85, y: y + 0.15, w: 2.15, h: 0.45, fontSize: 13, bold: true, color: C.teal, fontFace: "Calibri" });
addAccentBar(s, C.teal, x + 0.1, y + 0.85, 2.85, 0.03);
s.addText(p.detail, { x: x + 0.1, y: y + 0.95, w: 2.9, h: 0.9, fontSize: 11, color: C.offWhite, fontFace: "Calibri", lineSpacingMultiple: 1.2 });
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 15 – CONCLUSION / SUMMARY
// ═══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
addSlideBg(s, C.navyDark);
addAccentBar(s, C.blue, 0, 0, 10, 5.625);
// Diagonal accent
addAccentBar(s, C.navy, 0, 0, 10, 5.625);
addAccentBar(s, C.teal, 0, 0, 0.22, 5.625);
addAccentBar(s, C.blue, 9.78, 0, 0.22, 5.625);
s.addText("KEY TAKEAWAYS", {
x: 0.5, y: 0.2, w: 9.0, h: 0.65,
fontSize: 30, bold: true, color: C.white, fontFace: "Calibri",
charSpacing: 5, align: "center",
});
addAccentBar(s, C.teal, 3.5, 0.88, 3.0, 0.05);
const takeaways = [
"The brain has four lobes, deep structures, and a brainstem — each with unique functions vulnerable to stroke.",
"Stroke = blocked or burst blood vessel → rapid neuron death. 87% ischemic, 13% hemorrhagic.",
"Hypertension, AF, diabetes, and smoking are the leading modifiable causes of stroke worldwide.",
"Stroke location determines deficits: MCA = arm/face weakness; PCA = vision; brainstem = vital functions.",
"Diagnosis requires urgent CT/MRI and NIHSS scoring within minutes of hospital arrival.",
"IV tPA (≤4.5 h) and mechanical thrombectomy (≤24 h) are life-saving for ischemic stroke.",
"Up to 80% of strokes are preventable — lifestyle and medication adherence are paramount.",
];
takeaways.forEach((t, i) => {
addCard(s, 0.4, 1.0 + i * 0.63, 9.2, 0.56, i % 2 === 0 ? C.blue : "0F2A50");
addAccentBar(s, C.teal, 0.4, 1.0 + i * 0.63, 0.12, 0.56);
s.addText(t, { x: 0.65, y: 1.04 + i * 0.63, w: 8.8, h: 0.5, fontSize: 12.5, color: C.offWhite, fontFace: "Calibri", valign: "middle" });
});
addAccentBar(s, C.teal, 0, 5.3, 10, 0.325);
s.addText('"Time is Brain — Act FAST, Save Lives"', {
x: 0, y: 5.3, w: 10, h: 0.325,
fontSize: 13, bold: true, color: C.navyDark, fontFace: "Calibri",
align: "center", valign: "middle",
});
}
// ─── WRITE OUTPUT ─────────────────────────────────────────────────────────────
pres.writeFile({ fileName: "/home/daytona/workspace/brain-stroke-ppt/Brain_Anatomy_and_Stroke.pptx" })
.then(() => console.log("SUCCESS: Presentation saved."))
.catch(err => { console.error("ERROR:", err); process.exit(1); });
cd /home/daytona/workspace/brain-stroke-ppt && node create_ppt.js 2>&1
ls -lh /home/daytona/workspace/brain-stroke-ppt/Brain_Anatomy_and_Stroke.pptx
Brain Anatomy and Stroke
Presentation · PPTX
| # | Slide |
|---|---|
| 1 | Title Slide - Brain Anatomy & Stroke |
| 2 | Table of Contents |
| 3 | Brain Overview & Major Parts - Cerebrum, Cerebellum, Brainstem, Diencephalon |
| 4 | Cerebral Lobes & Functions - Frontal, Parietal, Temporal, Occipital |
| 5 | Deep Brain Structures - Thalamus, Hypothalamus, Hippocampus, Amygdala, Basal Ganglia, Corpus Callosum |
| 6 | What Is a Stroke? - Definition, key facts, FAST acronym |
| 7 | Types of Stroke - Ischemic (87%) vs Hemorrhagic (13%) + TIA |
| 8 | Why Does Stroke Happen? - Ischemic cascade pathophysiology, 5-step process |
| 9 | Major Causes & Risk Factors - Modifiable vs Non-modifiable |
| 10 | Brain Regions & Stroke Effects - MCA, ACA, PCA, Brainstem, Lacunar |
| 11 | Notable Stroke Syndromes - Wallenberg, Weber, Locked-in, Broca's, Wernicke's |
| 12 | Diagnosis - CT, MRI/DWI, CTA, ECG, Labs, NIHSS score |
| 13 | Treatment - tPA, thrombectomy, hemorrhagic management, rehab |
| 14 | Prevention - 6 key strategies |
| 15 | Key Takeaways / Conclusion |
Can you add relevant images to the ppt?
brain anatomy diagram labeled parts wikimedia commons free
ischemic hemorrhagic stroke brain diagram wikimedia commons free use
cerebral arteries MCA ACA PCA brain diagram wikimedia free
brain CT scan stroke MRI diffusion weighted ischemia wikimedia commons
node /home/daytona/skills/shared/scripts/fetch_images.js \ "https://upload.wik…
mkdir -p /home/daytona/workspace/brain-stroke-ppt/images && cd /home/daytona/wor…
cd /home/daytona/workspace/brain-stroke-ppt/images && curl -s -L --max-time 15 -…
ls -lh /home/daytona/workspace/brain-stroke-ppt/images/
cd /home/daytona/workspace/brain-stroke-ppt/images && curl -s -L --max-time 15 -…
cd /home/daytona/workspace/brain-stroke-ppt/images && curl -s -L --max-time 20 -…
~/brain-stroke-ppt/create_ppt_images.js
const pptxgen = require("pptxgenjs");
const path = require("path");
const fs = require("fs");
const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Brain Anatomy & Stroke";
pres.author = "Medical Education";
const IMG = "/home/daytona/workspace/brain-stroke-ppt/images/";
// ─── COLOR PALETTE ───────────────────────────────────────────────────────────
const C = {
navyDark: "0A1628",
navy: "0D2147",
blue: "1A3A6E",
lightBlue: "2A6496",
teal: "1F7A8C",
red: "C0392B",
orange: "E67E22",
white: "FFFFFF",
offWhite: "F0F4F8",
lightGray: "D0D8E4",
textGray: "8899AA",
};
function addSlideBg(slide, color) {
slide.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:"100%", fill:{color}, line:{type:"none"} });
}
function addBar(slide, color, x, y, w, h) {
slide.addShape(pres.ShapeType.rect, { x, y, w, h, fill:{color}, line:{type:"none"} });
}
function addCard(slide, x, y, w, h, fillColor, radius) {
slide.addShape(pres.ShapeType.rect, { x, y, w, h, fill:{color:fillColor}, line:{color:C.lightBlue,width:1}, rectRadius: radius||0.08 });
}
function imgExists(name) {
return fs.existsSync(IMG + name) && fs.statSync(IMG + name).size > 5000;
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 1 – TITLE SLIDE
// ═══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
addSlideBg(s, C.navyDark);
addBar(s, C.teal, 0, 0, 0.18, 5.625);
addBar(s, C.blue, 7.2, 0, 2.8, 5.625);
// Brain anatomy image on right panel
if (imgExists("brain_anatomy.png")) {
s.addImage({ path: IMG+"brain_anatomy.png", x:7.25, y:0.25, w:2.7, h:2.7, sizing:{type:"contain", w:2.7, h:2.7} });
} else {
s.addText("🧠", { x:7.8, y:1.5, w:1.6, h:1.6, fontSize:72, align:"center" });
}
s.addText("BRAIN ANATOMY", { x:0.4, y:0.8, w:6.6, h:0.9, fontSize:40, bold:true, color:C.white, fontFace:"Calibri", charSpacing:4 });
s.addText("& STROKE", { x:0.4, y:1.65, w:6.6, h:0.9, fontSize:40, bold:true, color:C.teal, fontFace:"Calibri", charSpacing:4 });
s.addText("Understanding Brain Structure, Stroke Mechanisms,\nCauses, Regional Effects & Treatment", {
x:0.4, y:2.7, w:6.6, h:1.0, fontSize:16, color:C.lightGray, fontFace:"Calibri", lineSpacingMultiple:1.3,
});
s.addText("Sources: NIH, Wikimedia Commons (Public Domain) | Academic Medical Presentation", {
x:0.4, y:3.85, w:6.6, h:0.35, fontSize:10, color:C.textGray, italic:true, fontFace:"Calibri",
});
addBar(s, C.blue, 0, 5.1, 10, 0.525);
s.addText("Academic Medical Presentation | Neurology & Neuroanatomy", {
x:0.4, y:5.15, w:9.2, h:0.4, fontSize:11, color:C.lightGray, fontFace:"Calibri", align:"center",
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 2 – TABLE OF CONTENTS
// ═══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
addSlideBg(s, C.offWhite);
addBar(s, C.navy, 0, 0, 10, 1.1);
s.addText("TABLE OF CONTENTS", { x:0.4, y:0.2, w:9.2, h:0.7, fontSize:28, bold:true, color:C.white, fontFace:"Calibri", charSpacing:3 });
const items = [
["01","Brain Overview & Major Parts"],["02","Cerebral Lobes & Functions"],
["03","Deep Brain Structures"],["04","What Is a Stroke?"],
["05","Types of Stroke"],["06","Why Does Stroke Happen?"],
["07","Major Causes & Risk Factors"],["08","Brain Regions & Stroke Effects"],
["09","Stroke Syndromes by Region"],["10","Diagnosis of Stroke"],
["11","Treatment of Stroke"],["12","Prevention & Conclusion"],
];
const col1=items.slice(0,6), col2=items.slice(6);
col1.forEach(([num,text],i) => {
addCard(s, 0.3, 1.25+i*0.68, 4.5, 0.58, C.navy);
s.addText(num, { x:0.35, y:1.28+i*0.68, w:0.5, h:0.5, fontSize:13, bold:true, color:C.teal });
s.addText(text, { x:0.9, y:1.28+i*0.68, w:3.8, h:0.5, fontSize:13, color:C.white, fontFace:"Calibri" });
});
col2.forEach(([num,text],i) => {
addCard(s, 5.1, 1.25+i*0.68, 4.5, 0.58, C.navy);
s.addText(num, { x:5.15, y:1.28+i*0.68, w:0.5, h:0.5, fontSize:13, bold:true, color:C.teal });
s.addText(text, { x:5.7, y:1.28+i*0.68, w:3.8, h:0.5, fontSize:13, color:C.white, fontFace:"Calibri" });
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 3 – BRAIN OVERVIEW (with brain anatomy image)
// ═══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
addSlideBg(s, C.navyDark);
addBar(s, C.blue, 0, 0, 10, 1.0);
s.addText("BRAIN OVERVIEW & MAJOR PARTS", { x:0.4, y:0.15, w:9.2, h:0.7, fontSize:26, bold:true, color:C.white, fontFace:"Calibri", charSpacing:2 });
// Image right side
if (imgExists("brain_parts.png")) {
addCard(s, 6.1, 1.1, 3.7, 4.2, C.blue);
s.addImage({ path: IMG+"brain_parts.png", x:6.15, y:1.15, w:3.6, h:4.1, sizing:{type:"contain", w:3.6, h:4.1} });
s.addText("Major Parts of the Brain\n(NIH Public Domain)", { x:6.1, y:5.1, w:3.7, h:0.3, fontSize:9, color:C.textGray, italic:true, align:"center" });
}
addBar(s, C.teal, 0.4, 1.05, 0.06, 4.2);
const parts = [
{ name:"Cerebrum", desc:"Largest part (~85% of brain weight). Divided into two hemispheres. Controls thought, memory, senses, voluntary movement." },
{ name:"Cerebellum", desc:"Located at the back. Coordinates balance, fine motor control, and precise movements." },
{ name:"Brainstem", desc:"Connects brain to spinal cord. Controls breathing, heart rate, blood pressure, and consciousness." },
{ name:"Diencephalon", desc:"Includes thalamus and hypothalamus. Relays sensory info and regulates homeostasis." },
];
parts.forEach((p,i) => {
addCard(s, 0.6, 1.1+i*1.05, 5.3, 0.9, C.blue);
s.addText(p.name, { x:0.75, y:1.15+i*1.05, w:1.6, h:0.7, fontSize:15, bold:true, color:C.teal, fontFace:"Calibri", valign:"middle" });
s.addText(p.desc, { x:2.4, y:1.15+i*1.05, w:3.4, h:0.7, fontSize:12, color:C.offWhite, fontFace:"Calibri", valign:"middle" });
addBar(s, C.teal, 2.35, 1.18+i*1.05, 0.04, 0.64);
});
s.addText("The adult human brain weighs ~1.3–1.4 kg and contains ~86 billion neurons.", {
x:0.4, y:5.32, w:9.2, h:0.25, fontSize:10, color:C.textGray, italic:true, fontFace:"Calibri",
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 4 – CEREBRAL LOBES (with brain anatomy image)
// ═══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
addSlideBg(s, C.offWhite);
addBar(s, C.navy, 0, 0, 10, 1.0);
s.addText("CEREBRAL LOBES & THEIR FUNCTIONS", { x:0.4, y:0.15, w:9.2, h:0.7, fontSize:26, bold:true, color:C.white, fontFace:"Calibri" });
// Brain anatomy image top right
if (imgExists("brain_anatomy.png")) {
addCard(s, 6.8, 1.1, 3.0, 2.5, C.navy);
s.addImage({ path: IMG+"brain_anatomy.png", x:6.85, y:1.15, w:2.9, h:2.4, sizing:{type:"contain", w:2.9, h:2.4} });
s.addText("Brain Lobes (NIH / Public Domain)", { x:6.8, y:3.55, w:3.0, h:0.2, fontSize:8.5, color:C.textGray, italic:true, align:"center" });
}
const lobes = [
{ name:"FRONTAL LOBE", color:"1A5276", icon:"🧩", funcs:["Voluntary movement (motor cortex)","Executive functions & planning","Speech production (Broca's area)","Personality & decision-making"] },
{ name:"PARIETAL LOBE", color:"1F618D", icon:"🤲", funcs:["Somatosensory processing","Spatial orientation","Integration of sensory info","Reading & mathematics"] },
{ name:"TEMPORAL LOBE", color:"117A65", icon:"👂", funcs:["Auditory processing","Language comprehension (Wernicke's)","Memory formation (hippocampus)","Emotional responses"] },
{ name:"OCCIPITAL LOBE", color:"6E2F9E", icon:"👁️", funcs:["Visual processing","Color & motion perception","Object & face recognition","Visual-spatial processing"] },
];
// 2x2 grid left side
const positions = [[0.3,1.1],[3.45,1.1],[0.3,3.35],[3.45,3.35]];
lobes.forEach((l,i) => {
const [x,y] = positions[i];
addCard(s, x, y, 3.0, 2.1, l.color);
s.addText(l.icon+" "+l.name, { x:x+0.12, y:y+0.1, w:2.8, h:0.42, fontSize:12, bold:true, color:C.white, fontFace:"Calibri" });
addBar(s, C.teal, x+0.12, y+0.52, 2.7, 0.03);
l.funcs.forEach((f,fi) => {
s.addText("• "+f, { x:x+0.15, y:y+0.6+fi*0.35, w:2.8, h:0.32, fontSize:10.5, color:C.offWhite, fontFace:"Calibri" });
});
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 5 – DEEP BRAIN STRUCTURES
// ═══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
addSlideBg(s, C.navyDark);
addBar(s, C.lightBlue, 0, 0, 10, 1.0);
s.addText("DEEP BRAIN STRUCTURES", { x:0.4, y:0.15, w:9.2, h:0.7, fontSize:26, bold:true, color:C.white, fontFace:"Calibri" });
const structs = [
{ name:"Thalamus", desc:"Sensory relay station. Routes signals from all senses (except smell) to the appropriate cortical areas." },
{ name:"Hypothalamus", desc:"Regulates body temperature, hunger, thirst, hormones, and the autonomic nervous system." },
{ name:"Hippocampus", desc:"Critical for formation of new memories. Located in the medial temporal lobe." },
{ name:"Amygdala", desc:"Processes emotions, especially fear. Involved in emotional memory and fight-or-flight response." },
{ name:"Basal Ganglia", desc:"Cluster of nuclei (caudate, putamen, globus pallidus). Regulate voluntary movement and habit formation." },
{ name:"Corpus Callosum", desc:"Large white matter bundle connecting left and right cerebral hemispheres for inter-hemispheric communication." },
];
structs.forEach((st,i) => {
const col=i%2, row=Math.floor(i/2);
const x=0.3+col*5.0, y=1.15+row*1.42;
addCard(s, x, y, 4.6, 1.28, C.blue);
addBar(s, C.teal, x, y, 0.12, 1.28);
s.addText(st.name, { x:x+0.22, y:y+0.08, w:4.2, h:0.35, fontSize:14, bold:true, color:C.teal, fontFace:"Calibri" });
s.addText(st.desc, { x:x+0.22, y:y+0.44, w:4.2, h:0.78, fontSize:11.5, color:C.offWhite, fontFace:"Calibri", lineSpacingMultiple:1.2 });
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 6 – WHAT IS A STROKE?
// ═══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
addSlideBg(s, C.navyDark);
addBar(s, C.red, 0, 0, 10, 1.0);
s.addText("WHAT IS A STROKE?", { x:0.4, y:0.15, w:9.2, h:0.7, fontSize:26, bold:true, color:C.white, fontFace:"Calibri", charSpacing:3 });
addCard(s, 0.4, 1.1, 9.2, 1.2, "7B241C");
s.addText("⚠ A stroke (cerebrovascular accident – CVA) occurs when blood supply to part of the brain is suddenly interrupted or a blood vessel ruptures, causing brain cells to die within minutes due to lack of oxygen and nutrients.", {
x:0.55, y:1.18, w:8.9, h:1.05, fontSize:14, color:C.white, fontFace:"Calibri", lineSpacingMultiple:1.4,
});
// Ischemic illustration on right
if (imgExists("stroke_ischemic.jpg")) {
addCard(s, 6.3, 2.4, 3.5, 2.85, C.blue);
s.addImage({ path: IMG+"stroke_ischemic.jpg", x:6.35, y:2.45, w:3.4, h:2.6, sizing:{type:"contain", w:3.4, h:2.6} });
s.addText("Ischemic Stroke (NIH / Public Domain)", { x:6.3, y:5.08, w:3.5, h:0.25, fontSize:8.5, color:C.textGray, italic:true, align:"center" });
}
s.addText("KEY FACTS", { x:0.4, y:2.45, w:5.7, h:0.4, fontSize:15, bold:true, color:C.teal, fontFace:"Calibri" });
const facts = [
{ icon:"🕐", text:"Time-critical — neurons die at ~1.9 million per minute" },
{ icon:"🌍", text:"2nd leading cause of death and disability worldwide" },
{ icon:"🔁", text:"FAST: Face, Arm, Speech, Time to call emergency" },
{ icon:"♻️", text:"Up to 80% of strokes are preventable" },
];
facts.forEach((f,i) => {
addCard(s, 0.4+(i%2)*2.9, 2.9+Math.floor(i/2)*1.15, 2.75, 1.0, C.blue);
s.addText(f.icon, { x:0.5+(i%2)*2.9, y:2.95+Math.floor(i/2)*1.15, w:0.5, h:0.8, fontSize:22, align:"center", valign:"middle" });
s.addText(f.text, { x:1.05+(i%2)*2.9, y:2.95+Math.floor(i/2)*1.15, w:2.0, h:0.8, fontSize:11, color:C.offWhite, fontFace:"Calibri", valign:"middle", lineSpacingMultiple:1.2 });
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 7 – TYPES OF STROKE (with types image)
// ═══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
addSlideBg(s, C.offWhite);
addBar(s, C.navy, 0, 0, 10, 1.0);
s.addText("TYPES OF STROKE", { x:0.4, y:0.15, w:9.2, h:0.7, fontSize:26, bold:true, color:C.white, fontFace:"Calibri" });
// Types of Stroke image centered top
if (imgExists("stroke_types.jpg")) {
addCard(s, 2.5, 1.08, 5.0, 2.0, C.navy);
s.addImage({ path: IMG+"stroke_types.jpg", x:2.55, y:1.1, w:4.9, h:1.9, sizing:{type:"contain", w:4.9, h:1.9} });
s.addText("Ischemic vs Hemorrhagic Stroke (Wikimedia Commons)", { x:2.5, y:3.02, w:5.0, h:0.2, fontSize:8.5, color:C.textGray, italic:true, align:"center" });
}
// Ischemic box
addCard(s, 0.3, 3.3, 4.5, 2.0, "1A3A6E");
addBar(s, C.teal, 0.3, 3.3, 4.5, 0.42);
s.addText("🔵 ISCHEMIC (~87%)", { x:0.45, y:3.33, w:4.2, h:0.35, fontSize:13, bold:true, color:C.navyDark, fontFace:"Calibri" });
["Clot blocks a cerebral artery","Thrombotic / Embolic / Lacunar","Treated with tPA or thrombectomy","Onset: sudden, focal deficit"].forEach((p,i) => {
s.addText("• "+p, { x:0.5, y:3.78+i*0.37, w:4.1, h:0.33, fontSize:12, color:C.offWhite, fontFace:"Calibri" });
});
// Hemorrhagic box
addCard(s, 5.1, 3.3, 4.5, 2.0, "7B241C");
addBar(s, C.orange, 5.1, 3.3, 4.5, 0.42);
s.addText("🔴 HEMORRHAGIC (~13%)", { x:5.25, y:3.33, w:4.2, h:0.35, fontSize:13, bold:true, color:C.navyDark, fontFace:"Calibri" });
["Ruptured blood vessel in/around brain","Intracerebral or subarachnoid","Often due to HTN or aneurysm","Higher mortality rate"].forEach((p,i) => {
s.addText("• "+p, { x:5.3, y:3.78+i*0.37, w:4.1, h:0.33, fontSize:12, color:C.offWhite, fontFace:"Calibri" });
});
addCard(s, 0.3, 5.35, 9.4, 0.25, C.teal);
s.addText("⚡ TIA = 'Mini-stroke' — same symptoms, resolves within 24 hours. Strong predictor of future stroke.", {
x:0.45, y:5.37, w:9.1, h:0.23, fontSize:10.5, color:C.white, fontFace:"Calibri",
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 8 – WHY DOES STROKE HAPPEN?
// ═══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
addSlideBg(s, C.navyDark);
addBar(s, C.orange, 0, 0, 10, 1.0);
s.addText("WHY DOES STROKE HAPPEN? — PATHOPHYSIOLOGY", { x:0.4, y:0.15, w:9.2, h:0.7, fontSize:22, bold:true, color:C.white, fontFace:"Calibri" });
// Ischemic diagram right
if (imgExists("stroke_ischemic.jpg")) {
addCard(s, 6.6, 1.1, 3.2, 3.8, C.blue);
s.addImage({ path: IMG+"stroke_ischemic.jpg", x:6.65, y:1.15, w:3.1, h:3.5, sizing:{type:"contain", w:3.1, h:3.5} });
s.addText("Ischemic Cascade (NIH)", { x:6.6, y:4.68, w:3.2, h:0.22, fontSize:8.5, color:C.textGray, italic:true, align:"center" });
}
const steps = [
{ num:"1", title:"Blood Flow Interruption", detail:"Artery blocked (ischemic) or ruptured (hemorrhagic) → oxygen delivery stops." },
{ num:"2", title:"Energy Failure", detail:"No ATP → ion pumps fail → Na⁺ & Ca²⁺ flood into neurons within seconds." },
{ num:"3", title:"Ischemic Cascade", detail:"Glutamate excitotoxicity, free radical production, mitochondrial failure." },
{ num:"4", title:"Infarct Core vs. Penumbra", detail:"Core = dead cells. Penumbra = at-risk tissue SAVEABLE with rapid reperfusion." },
{ num:"5", title:"Cerebral Edema", detail:"Cell swelling raises intracranial pressure, worsening damage hours later." },
];
steps.forEach((step,i) => {
addBar(s, i===3 ? C.teal : C.orange, 0.4, 1.1+i*0.88, 0.5, 0.7);
s.addText(step.num, { x:0.4, y:1.1+i*0.88, w:0.5, h:0.7, fontSize:18, bold:true, color:C.navyDark, align:"center", valign:"middle" });
addCard(s, 0.96, 1.1+i*0.88, 5.5, 0.7, C.blue);
s.addText(step.title+": ", { x:1.1, y:1.14+i*0.88, w:1.85, h:0.55, fontSize:12, bold:true, color:C.teal, fontFace:"Calibri", valign:"middle" });
s.addText(step.detail, { x:2.95, y:1.14+i*0.88, w:3.4, h:0.55, fontSize:11.5, color:C.offWhite, fontFace:"Calibri", valign:"middle" });
});
s.addText("\"Time is Brain\" — every second of delayed treatment results in irreversible neuron loss", {
x:0.4, y:5.38, w:9.2, h:0.22, fontSize:11, color:C.orange, italic:true, bold:true, fontFace:"Calibri", align:"center",
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 9 – MAJOR CAUSES & RISK FACTORS
// ═══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
addSlideBg(s, C.offWhite);
addBar(s, C.red, 0, 0, 10, 1.0);
s.addText("MAJOR CAUSES & RISK FACTORS", { x:0.4, y:0.15, w:9.2, h:0.7, fontSize:26, bold:true, color:C.white, fontFace:"Calibri" });
addCard(s, 0.3, 1.15, 4.5, 4.15, C.navy);
addBar(s, C.red, 0.3, 1.15, 4.5, 0.4);
s.addText("⚠ MODIFIABLE RISK FACTORS", { x:0.4, y:1.18, w:4.3, h:0.35, fontSize:13, bold:true, color:C.navyDark });
["🔴 Hypertension (single biggest risk factor)","🍬 Diabetes mellitus","🚬 Cigarette smoking","💊 Atrial fibrillation / heart disease","🍔 High cholesterol (atherosclerosis)","🍷 Excessive alcohol consumption","🪑 Physical inactivity & obesity","💊 Oral contraceptives (young women)"].forEach((m,i) => {
s.addText(m, { x:0.45, y:1.65+i*0.45, w:4.25, h:0.4, fontSize:12, color:C.offWhite, fontFace:"Calibri" });
});
addCard(s, 5.1, 1.15, 4.5, 4.15, C.navy);
addBar(s, C.orange, 5.1, 1.15, 4.5, 0.4);
s.addText("🔒 NON-MODIFIABLE FACTORS", { x:5.25, y:1.18, w:4.2, h:0.35, fontSize:13, bold:true, color:C.navyDark });
["👴 Age (risk doubles every 10 yrs after 55)","♂ Sex (men have higher baseline risk)","🧬 Family history / genetics","🌍 Race (African Americans: 2× higher risk)","📜 Prior stroke or TIA history"].forEach((n,i) => {
s.addText(n, { x:5.3, y:1.65+i*0.6, w:4.2, h:0.55, fontSize:12, color:C.offWhite, fontFace:"Calibri" });
});
s.addText("Hypertension is responsible for ~54% of all strokes globally (WHO, 2023)", {
x:0.3, y:5.36, w:9.4, h:0.25, fontSize:11, color:C.textGray, italic:true, align:"center",
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 10 – BRAIN REGIONS & STROKE EFFECTS (with cerebral territories image)
// ═══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
addSlideBg(s, C.navyDark);
addBar(s, C.lightBlue, 0, 0, 10, 1.0);
s.addText("BRAIN REGIONS WHERE STROKE OCCURS & EFFECTS", { x:0.4, y:0.15, w:9.2, h:0.7, fontSize:22, bold:true, color:C.white, fontFace:"Calibri" });
// Cerebral vascular territories image on right
if (imgExists("cerebral_territories.jpg")) {
addCard(s, 6.7, 1.1, 3.1, 3.2, C.blue);
s.addImage({ path: IMG+"cerebral_territories.jpg", x:6.75, y:1.15, w:3.0, h:3.1, sizing:{type:"contain", w:3.0, h:3.1} });
s.addText("Cerebral Vascular Territories\n(Wikimedia Commons)", { x:6.7, y:4.28, w:3.1, h:0.35, fontSize:8.5, color:C.textGray, italic:true, align:"center" });
}
const regions = [
{ region:"Middle Cerebral Artery (MCA)", pct:"Most common (40–50%)", effects:"Contralateral hemiplegia (face+arm>leg), aphasia (dominant hemisphere), neglect." },
{ region:"Anterior Cerebral Artery (ACA)", pct:"~5% of strokes", effects:"Contralateral leg weakness > arm, urinary incontinence, abulia, personality changes." },
{ region:"Posterior Cerebral Artery (PCA)", pct:"~10% of strokes", effects:"Contralateral homonymous hemianopia, thalamic pain, memory loss, visual agnosia." },
{ region:"Vertebrobasilar / Brainstem", pct:"~20% of strokes", effects:"Diplopia, dysphagia, ataxia, crossed deficits (ipsilateral face + contralateral limb)." },
{ region:"Lacunar (Small Vessel)", pct:"~25% of strokes", effects:"Pure motor or sensory stroke, ataxic hemiparesis, dysarthria. Internal capsule/pons." },
];
regions.forEach((r,i) => {
addCard(s, 0.35, 1.1+i*0.9, 6.2, 0.82, C.blue);
addBar(s, C.teal, 0.35, 1.1+i*0.9, 0.1, 0.82);
s.addText(r.region, { x:0.55, y:1.12+i*0.9, w:2.5, h:0.38, fontSize:12.5, bold:true, color:C.teal, fontFace:"Calibri" });
s.addText(r.pct, { x:0.55, y:1.5+i*0.9, w:2.5, h:0.28, fontSize:10.5, color:C.orange, fontFace:"Calibri", italic:true });
addBar(s, C.lightBlue, 3.1, 1.18+i*0.9, 0.03, 0.6);
s.addText(r.effects, { x:3.2, y:1.12+i*0.9, w:3.2, h:0.72, fontSize:11, color:C.offWhite, fontFace:"Calibri", valign:"middle", lineSpacingMultiple:1.2 });
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 11 – STROKE SYNDROMES
// ═══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
addSlideBg(s, C.offWhite);
addBar(s, C.navy, 0, 0, 10, 1.0);
s.addText("NOTABLE STROKE SYNDROMES", { x:0.4, y:0.15, w:9.2, h:0.7, fontSize:26, bold:true, color:C.white, fontFace:"Calibri" });
const syndromes = [
{ name:"Wallenberg Syndrome", artery:"PICA (posterior inferior cerebellar)", features:"Ipsilateral: facial numbness, Horner's, ataxia, dysphagia. Contralateral: pain/temp loss in limbs." },
{ name:"Weber Syndrome", artery:"PCA / midbrain perforators", features:"Ipsilateral CN III palsy (ptosis, mydriasis). Contralateral hemiplegia. Midbrain lesion." },
{ name:"Locked-in Syndrome", artery:"Basilar artery (ventral pons)", features:"Complete paralysis except vertical eye movements. Consciousness preserved. Devastating." },
{ name:"Broca's Aphasia Stroke", artery:"MCA superior division (dominant)", features:"Non-fluent speech, poor articulation, comprehension intact. Patient frustrated." },
{ name:"Wernicke's Aphasia Stroke", artery:"MCA inferior division (dominant)", features:"Fluent but meaningless speech ('word salad'). Poor comprehension. Unaware of deficit." },
];
syndromes.forEach((syn,i) => {
addCard(s, 0.3, 1.15+i*0.87, 9.4, 0.79, i%2===0 ? C.navy : "0F2A50");
s.addText(syn.name, { x:0.45, y:1.18+i*0.87, w:2.4, h:0.35, fontSize:13, bold:true, color:C.teal, fontFace:"Calibri" });
s.addText("("+syn.artery+")", { x:0.45, y:1.53+i*0.87, w:2.4, h:0.25, fontSize:10, color:C.textGray, italic:true, fontFace:"Calibri" });
addBar(s, C.teal, 2.92, 1.22+i*0.87, 0.04, 0.6);
s.addText(syn.features, { x:3.05, y:1.18+i*0.87, w:6.5, h:0.72, fontSize:12, color:C.offWhite, fontFace:"Calibri", valign:"middle", lineSpacingMultiple:1.2 });
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 12 – DIAGNOSIS (with DWI MRI image)
// ═══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
addSlideBg(s, C.navyDark);
addBar(s, C.teal, 0, 0, 10, 1.0);
s.addText("DIAGNOSIS OF STROKE", { x:0.4, y:0.15, w:9.2, h:0.7, fontSize:26, bold:true, color:C.white, fontFace:"Calibri" });
// MRI DWI image right side
if (imgExists("dwi_mri.png")) {
addCard(s, 6.8, 1.1, 3.0, 3.6, C.blue);
s.addImage({ path: IMG+"dwi_mri.png", x:6.85, y:1.15, w:2.9, h:3.5, sizing:{type:"contain", w:2.9, h:3.5} });
s.addText("DWI MRI — Cerebral Infarction\n(Wikimedia Commons)", { x:6.8, y:4.7, w:3.0, h:0.35, fontSize:8.5, color:C.textGray, italic:true, align:"center" });
}
const diagnoses = [
{ tool:"Non-contrast CT Scan", time:"First-line | ≤25 min", detail:"Rules out hemorrhage. May be normal in early ischemic stroke. Fast, widely available." },
{ tool:"MRI / DWI", time:"Gold standard for ischemia", detail:"Diffusion-weighted imaging detects stroke within minutes. Shows infarct and penumbra." },
{ tool:"CT Angiography (CTA)", time:"Immediate vascular imaging", detail:"Identifies arterial occlusion site. Essential for planning mechanical thrombectomy." },
{ tool:"ECG / Holter Monitor", time:"Cardiac evaluation", detail:"Detects atrial fibrillation — major cardioembolic source. Must be done in all ischemic stroke patients." },
{ tool:"Blood Tests", time:"Baseline labs", detail:"CBC, coag, glucose, lipids, troponin. Rules out mimics (hypoglycemia, coagulopathy)." },
{ tool:"NIH Stroke Scale (NIHSS)", time:"Clinical severity 0–42", detail:"Guides treatment decisions and predicts outcomes. Done at bedside within minutes." },
];
const positions = [[0.3,1.1],[0.3,2.55],[0.3,4.0],[3.45,1.1],[3.45,2.55],[3.45,4.0]];
const firstCol=diagnoses.slice(0,3), secCol=diagnoses.slice(3);
[...firstCol,...secCol].forEach((d,i) => {
const [x,y] = positions[i];
addCard(s, x, y, 3.0, 1.3, C.blue);
addBar(s, C.teal, x, y, 0.12, 1.3);
s.addText(d.tool, { x:x+0.22, y:y+0.08, w:2.65, h:0.35, fontSize:12.5, bold:true, color:C.white, fontFace:"Calibri" });
s.addText(d.time, { x:x+0.22, y:y+0.43, w:2.65, h:0.25, fontSize:10.5, color:C.teal, italic:true, fontFace:"Calibri" });
s.addText(d.detail, { x:x+0.22, y:y+0.66, w:2.7, h:0.58, fontSize:10.5, color:C.offWhite, fontFace:"Calibri", lineSpacingMultiple:1.15 });
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 13 – TREATMENT (with hemorrhagic image)
// ═══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
addSlideBg(s, C.offWhite);
addBar(s, C.red, 0, 0, 10, 1.0);
s.addText("TREATMENT OF STROKE", { x:0.4, y:0.15, w:9.2, h:0.7, fontSize:26, bold:true, color:C.white, fontFace:"Calibri" });
// Hemorrhagic image
if (imgExists("stroke_hemorrhagic.jpg")) {
addCard(s, 7.0, 1.1, 2.8, 2.2, C.navy);
s.addImage({ path: IMG+"stroke_hemorrhagic.jpg", x:7.05, y:1.15, w:2.7, h:2.1, sizing:{type:"contain", w:2.7, h:2.1} });
s.addText("Hemorrhagic Stroke (NIH)", { x:7.0, y:3.3, w:2.8, h:0.2, fontSize:8.5, color:C.textGray, italic:true, align:"center" });
}
// Ischemic
addCard(s, 0.3, 1.1, 3.3, 2.28, C.navy);
addBar(s, C.teal, 0.3, 1.1, 3.3, 0.38);
s.addText("🔵 ISCHEMIC STROKE", { x:0.45, y:1.13, w:3.1, h:0.32, fontSize:12.5, bold:true, color:C.navyDark });
["IV tPA (alteplase): within 4.5 hours","Mechanical thrombectomy: up to 24 hrs","Aspirin: within 24–48 hrs of onset","Anticoag for AF-related embolism","Stroke unit with monitoring"].forEach((t,i) => {
s.addText("• "+t, { x:0.45, y:1.55+i*0.33, w:3.1, h:0.3, fontSize:11, color:C.offWhite, fontFace:"Calibri" });
});
// Hemorrhagic
addCard(s, 3.75, 1.1, 3.1, 2.28, C.navy);
addBar(s, C.red, 3.75, 1.1, 3.1, 0.38);
s.addText("🔴 HEMORRHAGIC STROKE", { x:3.9, y:1.13, w:2.9, h:0.32, fontSize:12.5, bold:true, color:C.navyDark });
["Reverse anticoagulation immediately","Control BP aggressively (<140 mmHg)","Surgical evacuation (selected cases)","Coil/clip for aneurysm","ICP monitoring"].forEach((t,i) => {
s.addText("• "+t, { x:3.9, y:1.55+i*0.33, w:2.9, h:0.3, fontSize:11, color:C.offWhite, fontFace:"Calibri" });
});
// Rehab
addCard(s, 0.3, 3.5, 9.5, 1.82, C.blue);
addBar(s, C.orange, 0.3, 3.5, 9.5, 0.38);
s.addText("🔶 GENERAL MANAGEMENT & REHABILITATION", { x:0.45, y:3.53, w:9.2, h:0.32, fontSize:13, bold:true, color:C.navyDark });
const rehab = [
["Airway & O₂","Maintain sat >94%; intubate if needed"],
["Glucose control","Target 140–180 mg/dL"],
["Physiotherapy","Early mobilization within 24–48 hrs"],
["Speech therapy","For aphasia & dysphagia rehab"],
];
rehab.forEach((r,i) => {
const col=i%2, row=Math.floor(i/2);
s.addText("• "+r[0]+": ", { x:0.5+col*4.75, y:3.97+row*0.58, w:1.4, h:0.52, fontSize:11.5, bold:true, color:C.teal, fontFace:"Calibri" });
s.addText(r[1], { x:1.8+col*4.75, y:3.97+row*0.58, w:3.1, h:0.52, fontSize:11.5, color:C.offWhite, fontFace:"Calibri" });
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 14 – PREVENTION
// ═══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
addSlideBg(s, C.navyDark);
addBar(s, C.teal, 0, 0, 10, 1.0);
s.addText("STROKE PREVENTION", { x:0.4, y:0.15, w:9.2, h:0.7, fontSize:26, bold:true, color:C.white, fontFace:"Calibri" });
const prevention = [
{ icon:"💊", title:"Antihypertensives", detail:"Control BP below 130/80 mmHg. The single most effective stroke prevention strategy." },
{ icon:"🩸", title:"Anticoagulants", detail:"Warfarin or DOACs for AF. Aspirin/clopidogrel after TIA or minor ischemic stroke." },
{ icon:"🥗", title:"Diet & Lifestyle", detail:"DASH/Mediterranean diet. Reduce sodium, saturated fat. Aerobic exercise ≥150 min/week." },
{ icon:"🚭", title:"Smoking Cessation", detail:"Smoking doubles stroke risk. Cessation reduces risk to near-baseline within 5 years." },
{ icon:"🏋️", title:"Weight Management", detail:"Obesity raises BP, diabetes, and lipid levels. BMI target: 18.5–24.9 kg/m²." },
{ icon:"❤️", title:"Treat Underlying Disease", detail:"Manage diabetes (HbA1c <7%), dyslipidemia (statin therapy), and arrhythmias." },
];
prevention.forEach((p,i) => {
const col=i%3, row=Math.floor(i/3);
const x=0.3+col*3.25, y=1.15+row*2.1;
addCard(s, x, y, 3.1, 1.95, C.blue);
s.addText(p.icon, { x:x+0.1, y:y+0.12, w:0.7, h:0.7, fontSize:28, align:"center" });
s.addText(p.title, { x:x+0.85, y:y+0.15, w:2.15, h:0.45, fontSize:13, bold:true, color:C.teal, fontFace:"Calibri" });
addBar(s, C.teal, x+0.1, y+0.85, 2.85, 0.03);
s.addText(p.detail, { x:x+0.1, y:y+0.95, w:2.9, h:0.9, fontSize:10.5, color:C.offWhite, fontFace:"Calibri", lineSpacingMultiple:1.2 });
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 15 – CONCLUSION
// ═══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
addSlideBg(s, C.navyDark);
addBar(s, C.navy, 0, 0, 10, 5.625);
addBar(s, C.teal, 0, 0, 0.22, 5.625);
addBar(s, C.blue, 9.78, 0, 0.22, 5.625);
s.addText("KEY TAKEAWAYS", { x:0.5, y:0.2, w:9.0, h:0.65, fontSize:30, bold:true, color:C.white, fontFace:"Calibri", charSpacing:5, align:"center" });
addBar(s, C.teal, 3.5, 0.88, 3.0, 0.05);
const takeaways = [
"The brain has four lobes, deep structures, and a brainstem — each with unique functions vulnerable to stroke.",
"Stroke = blocked or burst blood vessel → rapid neuron death. 87% ischemic, 13% hemorrhagic.",
"Hypertension, AF, diabetes, and smoking are the leading modifiable causes of stroke worldwide.",
"Stroke location determines deficits: MCA = arm/face weakness; PCA = vision; brainstem = vital functions.",
"Diagnosis requires urgent CT/MRI and NIHSS scoring within minutes of hospital arrival.",
"IV tPA (≤4.5 h) and mechanical thrombectomy (≤24 h) are life-saving for ischemic stroke.",
"Up to 80% of strokes are preventable — lifestyle changes and medication adherence are paramount.",
];
takeaways.forEach((t,i) => {
addCard(s, 0.4, 1.0+i*0.63, 9.2, 0.56, i%2===0 ? C.blue : "0F2A50");
addBar(s, C.teal, 0.4, 1.0+i*0.63, 0.12, 0.56);
s.addText(t, { x:0.65, y:1.04+i*0.63, w:8.8, h:0.5, fontSize:12.5, color:C.offWhite, fontFace:"Calibri", valign:"middle" });
});
addBar(s, C.teal, 0, 5.3, 10, 0.325);
s.addText('"Time is Brain — Act FAST, Save Lives"', {
x:0, y:5.3, w:10, h:0.325, fontSize:13, bold:true, color:C.navyDark, fontFace:"Calibri", align:"center", valign:"middle",
});
}
// ─── WRITE OUTPUT ─────────────────────────────────────────────────────────────
pres.writeFile({ fileName: "/home/daytona/workspace/brain-stroke-ppt/Brain_Anatomy_and_Stroke_with_Images.pptx" })
.then(() => console.log("SUCCESS"))
.catch(err => { console.error("ERROR:", err); process.exit(1); });
cd /home/daytona/workspace/brain-stroke-ppt && node create_ppt_images.js 2>&1
ls -lh /home/daytona/workspace/brain-stroke-ppt/Brain_Anatomy_and_Stroke_with_Im…
Brain Anatomy and Stroke with Images
Presentation · PPTX
| Slide | Image Added |
|---|---|
| Slide 1 - Title | Brain anatomy diagram (NIH) on the right panel |
| Slide 3 - Brain Overview | 3 major parts of brain diagram (NIH) alongside the text |
| Slide 4 - Cerebral Lobes | Brain lobes color-coded diagram top-right |
| Slide 6 - What Is a Stroke? | Ischemic stroke illustration (NIH) on right |
| Slide 7 - Types of Stroke | Ischemic vs Hemorrhagic comparison image centered at top |
| Slide 8 - Pathophysiology | Ischemic stroke diagram alongside the cascade steps |
| Slide 10 - Brain Regions | Cerebral vascular territories map (Wikimedia) on right |
| Slide 12 - Diagnosis | DWI MRI cerebral infarction scan (Wikimedia) on right |
| Slide 13 - Treatment | Hemorrhagic stroke illustration (NIH) on right |