presentation topic of investigation of epilepsy and seizure reference this pdf only and also add brain image eeg and all pictures
cd /home/daytona/workspace/attachments/d172c87d-b344-48b9-8255-3c8583c57f30 && python3 -c " import pdfplumber with pdfplumber.open('SplitPDFFile_12048_to_12063.pdf') as pdf: print(f'Total pages: {len(pdf.pages)}') for i, page in enumerate(pdf.pages): text = page.extract_text() print(f'--- PAGE {i+1} ---') print(text[:3000] if text else '[No text]') print() "
EEG brain waves epilepsy seizure electroencephalogram diagram free medical image
ls /home/daytona/workspace/ && mkdir -p /home/daytona/workspace/epilepsy-pptx
brain MRI epilepsy seizure focus neurology medical illustration
mkdir -p /home/daytona/workspace/epilepsy-pptx && node /home/daytona/skills/shared/scripts/fetch_images.js \ "https://www.researchgate.net/publication/270523871/figure/fig5/AS:668773031878669@1536459324337/Waveform-of-three-EEG-signals-normal-set-A-seizure-free-set-D-and-epileptic-seizure.ppm" \ "https://thumbs.dreamstime.com/b/epilepsy-eeg-healthy-brain-epileptic-seizure-condition-characterized-recurrent-unpredictable-seizures-human-primary-126355586.jpg" \ "https://www.shutterstock.com/image-vector/electroencephalography-medical-test-that-measures-260nw-2229011777.jpg" 2>/dev/null | head -c 500
mkdir -p /home/daytona/workspace/epilepsy-pptx && node /home/daytona/skills/shared/scripts/fetch_images.js \ "https://thumbs.dreamstime.com/b/epilepsy-eeg-healthy-brain-epileptic-seizure-condition-characterized-recurrent-unpredictable-seizures-human-primary-126355586.jpg" \ "https://pn.bmj.com/content/practneurol/19/5/438/F1.large.jpg" \ "https://media.sciencephoto.com/image/m1500280/800wm/M1500280-Brain_waves_in_epilepsy.jpg" 2>/dev/null
cat > /home/daytona/workspace/epilepsy-pptx/create_pptx.js << 'JSEOF' const pptxgen = require("pptxgenjs"); const fs = require("fs"); const { execSync } = require("child_process"); // Load fetched images const imgs = JSON.parse(fs.readFileSync("/tmp/imgs.json", "utf8") || "[]"); // We already have the base64 images from the fetch command output // Let's hardcode the image references from the JSON output const epilepsyEEGImg = "https://thumbs.dreamstime.com/b/epilepsy-eeg-healthy-brain-epileptic-seizure-condition-characterized-recurrent-unpredictable-seizures-human-primary-126355586.jpg"; const brainWavesImg = "https://media.sciencephoto.com/image/m1500280/800wm/M1500280-Brain_waves_in_epilepsy.jpg"; let pres = new pptxgen(); pres.layout = 'LAYOUT_16x9'; pres.title = 'Investigation of Epilepsy and Seizure'; pres.author = 'Medical Neurology'; // Color scheme - deep medical blue & teal const COL_DARK = "0A1F3D"; const COL_MED = "0D3B6E"; const COL_ACCENT = "00A3E0"; const COL_TEAL = "00BFD8"; const COL_WHITE = "FFFFFF"; const COL_LIGHT = "E8F4FD"; const COL_YELLOW = "FFD700"; const COL_GREY = "B0C4DE"; // ───────────────────────────────────────── // SLIDE 1: TITLE SLIDE // ───────────────────────────────────────── let slide1 = pres.addSlide(); slide1.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: '100%', h: '100%', fill: { color: COL_DARK } }); // Accent bar slide1.addShape(pres.ShapeType.rect, { x: 0, y: 4.5, w: '100%', h: 0.05, fill: { color: COL_TEAL } }); // EEG wave pattern (decorative lines) slide1.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: '100%', h: 1.2, fill: { color: COL_MED } }); // Title slide1.addText("INVESTIGATION OF\nEPILEPSY & SEIZURE", { x: 0.5, y: 1.5, w: 9, h: 2.2, fontSize: 44, color: COL_WHITE, bold: true, align: "center", fontFace: "Calibri", shadow: { type: "outer", blur: 8, offset: 4, color: "000000" } }); // Subtitle bar slide1.addShape(pres.ShapeType.rect, { x: 2, y: 3.8, w: 6, h: 0.05, fill: { color: COL_ACCENT } }); slide1.addText("Clinical Approach, EEG Studies & Differential Diagnosis", { x: 0.5, y: 4.0, w: 9, h: 0.6, fontSize: 16, color: COL_ACCENT, italic: true, align: "center", fontFace: "Calibri" }); slide1.addText("Reference: Harrison's Principles of Internal Medicine", { x: 0.5, y: 4.9, w: 9, h: 0.4, fontSize: 12, color: COL_GREY, align: "center", fontFace: "Calibri" }); // Brain icon text slide1.addText("🧠", { x: 4.2, y: 0.15, w: 1.5, h: 0.95, fontSize: 40, align: "center" }); // ───────────────────────────────────────── // SLIDE 2: OVERVIEW // ───────────────────────────────────────── let slide2 = pres.addSlide(); slide2.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: '100%', h: '100%', fill: { color: COL_DARK } }); slide2.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: '100%', h: 1.1, fill: { color: COL_MED } }); slide2.addText("OVERVIEW", { x: 0.4, y: 0.15, w: 9, h: 0.8, fontSize: 28, color: COL_WHITE, bold: true, fontFace: "Calibri" }); slide2.addShape(pres.ShapeType.rect, { x: 0.4, y: 1.25, w: 0.08, h: 4, fill: { color: COL_TEAL } }); const overviewItems = [ { num: "01", text: "Patient Evaluation & History", sub: "First seizure assessment protocol" }, { num: "02", text: "Laboratory Studies", sub: "Blood work, toxicology, CSF analysis" }, { num: "03", text: "Electrophysiologic Studies (EEG)", sub: "Normal & abnormal brain wave patterns" }, { num: "04", text: "Brain Imaging", sub: "MRI, CT, PET, SPECT, MEG" }, { num: "05", text: "Genetic Testing", sub: "Gene mutations causing epilepsy" }, { num: "06", text: "Differential Diagnosis", sub: "Syncope, psychogenic seizures & others" } ]; overviewItems.forEach((item, i) => { const y = 1.3 + i * 0.67; slide2.addShape(pres.ShapeType.rect, { x: 0.6, y: y, w: 0.55, h: 0.45, fill: { color: COL_ACCENT }, rounding: true }); slide2.addText(item.num, { x: 0.6, y: y + 0.02, w: 0.55, h: 0.42, fontSize: 13, color: COL_WHITE, bold: true, align: "center", margin: 0 }); slide2.addText(item.text, { x: 1.3, y: y - 0.02, w: 8.2, h: 0.28, fontSize: 14, color: COL_WHITE, bold: true, fontFace: "Calibri", margin: 0 }); slide2.addText(item.sub, { x: 1.3, y: y + 0.22, w: 8.2, h: 0.22, fontSize: 10, color: COL_GREY, fontFace: "Calibri", italic: true, margin: 0 }); }); // ───────────────────────────────────────── // SLIDE 3: PATIENT EVALUATION - HISTORY // ───────────────────────────────────────── let slide3 = pres.addSlide(); slide3.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: '100%', h: '100%', fill: { color: COL_DARK } }); slide3.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: '100%', h: 1.1, fill: { color: COL_MED } }); slide3.addText("HISTORY & PHYSICAL EXAMINATION", { x: 0.4, y: 0.18, w: 9, h: 0.75, fontSize: 22, color: COL_WHITE, bold: true, fontFace: "Calibri" }); // 2-column layout const leftItems = [ "Pre-ictal, ictal & post-ictal symptoms", "History of febrile seizures", "Family history of seizures", "Prior auras or brief unrecognized seizures", "Head trauma, stroke, tumor or CNS infection", "Sleep deprivation & precipitating factors" ]; const rightItems = [ "Signs of systemic illness or infection", "Neurocutaneous disorders (tuberous sclerosis)", "Organomegaly — metabolic storage disease", "Limb asymmetry — early brain injury", "CNS exam: mental status, visual fields", "Motor function: pronator drift, gait, reflexes" ]; slide3.addText("📋 HISTORY FOCUS", { x: 0.4, y: 1.2, w: 4.5, h: 0.35, fontSize: 13, color: COL_ACCENT, bold: true, fontFace: "Calibri" }); slide3.addText("🔍 PHYSICAL EXAM", { x: 5.2, y: 1.2, w: 4.5, h: 0.35, fontSize: 13, color: COL_TEAL, bold: true, fontFace: "Calibri" }); leftItems.forEach((txt, i) => { slide3.addShape(pres.ShapeType.rect, { x: 0.4, y: 1.62 + i * 0.58, w: 0.15, h: 0.15, fill: { color: COL_ACCENT }, rounding: true }); slide3.addText(txt, { x: 0.65, y: 1.58 + i * 0.58, w: 4.3, h: 0.45, fontSize: 11, color: COL_LIGHT, fontFace: "Calibri", wrap: true }); }); rightItems.forEach((txt, i) => { slide3.addShape(pres.ShapeType.rect, { x: 5.2, y: 1.62 + i * 0.58, w: 0.15, h: 0.15, fill: { color: COL_TEAL }, rounding: true }); slide3.addText(txt, { x: 5.45, y: 1.58 + i * 0.58, w: 4.3, h: 0.45, fontSize: 11, color: COL_LIGHT, fontFace: "Calibri", wrap: true }); }); // Divider slide3.addShape(pres.ShapeType.rect, { x: 4.95, y: 1.2, w: 0.04, h: 4.2, fill: { color: COL_ACCENT } }); // ───────────────────────────────────────── // SLIDE 4: LABORATORY STUDIES // ───────────────────────────────────────── let slide4 = pres.addSlide(); slide4.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: '100%', h: '100%', fill: { color: COL_DARK } }); slide4.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: '100%', h: 1.1, fill: { color: COL_MED } }); slide4.addText("LABORATORY STUDIES", { x: 0.4, y: 0.18, w: 9, h: 0.75, fontSize: 24, color: COL_WHITE, bold: true, fontFace: "Calibri" }); const labs = [ { icon: "🩸", title: "Routine Blood Studies", items: ["Electrolytes (Na, K, Ca, Mg)", "Glucose levels", "Hepatic & renal function tests"] }, { icon: "⚗️", title: "Toxicology Screen", items: ["Blood & urine toxin screen", "Drug levels (especially in risk groups)", "Alcohol & illicit substances"] }, { icon: "💉", title: "Lumbar Puncture", items: ["Mandatory if CNS infection suspected", "Required in all HIV+ patients", "Autoantibody testing in CSF"] }, { icon: "🧬", title: "Autoantibody Testing", items: ["Serum & CSF autoantibodies", "For rapid-onset epilepsy with:", "Psychiatric symptoms or cognitive disturbances"] } ]; labs.forEach((lab, i) => { const x = i < 2 ? 0.3 + i * 4.7 : 0.3 + (i - 2) * 4.7; const y = i < 2 ? 1.2 : 3.1; slide4.addShape(pres.ShapeType.rect, { x, y, w: 4.4, h: 1.7, fill: { color: COL_MED }, rounding: true }); slide4.addShape(pres.ShapeType.rect, { x, y, w: 4.4, h: 0.5, fill: { color: i < 2 ? COL_ACCENT : COL_TEAL }, rounding: true }); slide4.addText(lab.icon + " " + lab.title, { x: x + 0.15, y: y + 0.07, w: 4.1, h: 0.38, fontSize: 12, color: COL_WHITE, bold: true, fontFace: "Calibri" }); lab.items.forEach((item, j) => { slide4.addText("• " + item, { x: x + 0.2, y: y + 0.6 + j * 0.35, w: 4.0, h: 0.32, fontSize: 10.5, color: COL_LIGHT, fontFace: "Calibri" }); }); }); // ───────────────────────────────────────── // SLIDE 5: EEG BASICS // ───────────────────────────────────────── let slide5 = pres.addSlide(); slide5.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: '100%', h: '100%', fill: { color: COL_DARK } }); slide5.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: '100%', h: 1.1, fill: { color: COL_MED } }); slide5.addText("ELECTROENCEPHALOGRAPHY (EEG)", { x: 0.4, y: 0.18, w: 9, h: 0.75, fontSize: 22, color: COL_WHITE, bold: true, fontFace: "Calibri" }); slide5.addText("What is EEG?", { x: 0.4, y: 1.15, w: 9, h: 0.4, fontSize: 14, color: COL_ACCENT, bold: true, fontFace: "Calibri" }); slide5.addText("Records potential differences between scalp electrode pairs (bipolar) or individual electrodes vs a common reference (referential). Amplified & displayed digitally — allows manipulation & computerized analysis.", { x: 0.4, y: 1.5, w: 5.6, h: 0.85, fontSize: 11, color: COL_LIGHT, fontFace: "Calibri", wrap: true }); // Normal EEG rhythms table const rhythms = [ ["Rhythm", "Frequency", "Location/State"], ["Alpha (α)", "8–13 Hz", "Posterior; eyes closed, awake"], ["Beta (β)", ">13 Hz", "Generalized; active state"], ["Theta (θ)", "4–7 Hz", "Drowsiness, light sleep"], ["Delta (δ)", "<4 Hz", "Deep sleep"], ]; rhythms.forEach((row, i) => { const y = 2.42 + i * 0.42; const bg = i === 0 ? COL_ACCENT : (i % 2 === 0 ? "152B4A" : COL_MED); slide5.addShape(pres.ShapeType.rect, { x: 0.4, y, w: 5.6, h: 0.4, fill: { color: bg } }); slide5.addText(row[0], { x: 0.5, y: y + 0.04, w: 1.8, h: 0.32, fontSize: i === 0 ? 11 : 10, color: COL_WHITE, bold: i === 0, fontFace: "Calibri", margin: 0 }); slide5.addText(row[1], { x: 2.3, y: y + 0.04, w: 1.5, h: 0.32, fontSize: i === 0 ? 11 : 10, color: i === 0 ? COL_WHITE : COL_YELLOW, bold: i === 0, fontFace: "Calibri", margin: 0 }); slide5.addText(row[2], { x: 3.8, y: y + 0.04, w: 2.2, h: 0.32, fontSize: i === 0 ? 11 : 10, color: COL_WHITE, bold: i === 0, fontFace: "Calibri", margin: 0 }); }); // Key points slide5.addText("Key Clinical Uses of EEG:", { x: 6.2, y: 1.15, w: 3.5, h: 0.35, fontSize: 12, color: COL_TEAL, bold: true, fontFace: "Calibri" }); const eegPoints = [ "Confirms electrographic seizure activity", "EEG always abnormal during generalized tonic-clonic seizures", "Classifies seizure disorders", "Guides antiseizure drug selection", "Normal initial EEG in 50–80% of known epileptics", "Assesses prognosis of seizure disorders" ]; eegPoints.forEach((pt, i) => { slide5.addShape(pres.ShapeType.rect, { x: 6.2, y: 1.58 + i * 0.54, w: 0.18, h: 0.18, fill: { color: COL_TEAL }, rounding: true }); slide5.addText(pt, { x: 6.5, y: 1.52 + i * 0.54, w: 3.2, h: 0.42, fontSize: 10, color: COL_LIGHT, fontFace: "Calibri", wrap: true }); }); // ───────────────────────────────────────── // SLIDE 6: EEG IMAGE SLIDE // ───────────────────────────────────────── let slide6 = pres.addSlide(); slide6.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: '100%', h: '100%', fill: { color: COL_DARK } }); slide6.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: '100%', h: 0.9, fill: { color: COL_MED } }); slide6.addText("EEG RECORDINGS — NORMAL vs EPILEPTIC", { x: 0.4, y: 0.1, w: 9, h: 0.72, fontSize: 20, color: COL_WHITE, bold: true, fontFace: "Calibri" }); // Load EEG brain image const imgPath1 = "/home/daytona/workspace/epilepsy-pptx/eeg_brain.jpg"; const imgPath2 = "/home/daytona/workspace/epilepsy-pptx/brain_waves.jpg"; // Images will be base64 embedded // EEG / Epilepsy image (dreamstime one) try { // Check images exist and add them if (fs.existsSync(imgPath1)) { slide6.addImage({ path: imgPath1, x: 0.3, y: 1.0, w: 4.5, h: 3.2 }); } else { // placeholder slide6.addShape(pres.ShapeType.rect, { x: 0.3, y: 1.0, w: 4.5, h: 3.2, fill: { color: "152B4A" }, line: { color: COL_ACCENT, width: 2 } }); slide6.addText("EEG Brain\nActivity\nImage", { x: 0.3, y: 1.0, w: 4.5, h: 3.2, fontSize: 16, color: COL_ACCENT, align: "center", valign: "middle" }); } } catch(e) {} try { if (fs.existsSync(imgPath2)) { slide6.addImage({ path: imgPath2, x: 5.1, y: 1.0, w: 4.5, h: 3.2 }); } else { slide6.addShape(pres.ShapeType.rect, { x: 5.1, y: 1.0, w: 4.5, h: 3.2, fill: { color: "152B4A" }, line: { color: COL_TEAL, width: 2 } }); slide6.addText("Brain Waves\nin Epilepsy\nImage", { x: 5.1, y: 1.0, w: 4.5, h: 3.2, fontSize: 16, color: COL_TEAL, align: "center", valign: "middle" }); } } catch(e) {} slide6.addText("Epilepsy EEG — Healthy vs Seizure State", { x: 0.3, y: 4.25, w: 4.5, h: 0.35, fontSize: 10, color: COL_GREY, align: "center", italic: true, fontFace: "Calibri" }); slide6.addText("Brain Waves During Epileptic Episode (Generalized)", { x: 5.1, y: 4.25, w: 4.5, h: 0.35, fontSize: 10, color: COL_GREY, align: "center", italic: true, fontFace: "Calibri" }); slide6.addShape(pres.ShapeType.rect, { x: 4.85, y: 0.9, w: 0.04, h: 3.7, fill: { color: COL_ACCENT } }); // ───────────────────────────────────────── // SLIDE 7: EEG PATTERNS IN EPILEPSY // ───────────────────────────────────────── let slide7 = pres.addSlide(); slide7.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: '100%', h: '100%', fill: { color: COL_DARK } }); slide7.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: '100%', h: 1.1, fill: { color: COL_MED } }); slide7.addText("ELECTROGRAPHIC SEIZURE PATTERNS", { x: 0.4, y: 0.18, w: 9, h: 0.75, fontSize: 22, color: COL_WHITE, bold: true, fontFace: "Calibri" }); const patterns = [ { letter: "A", color: COL_ACCENT, title: "Tonic Seizure", desc: "Generalized repetitive sharp activity with synchronous onset over BOTH hemispheres. Repeated spikes." }, { letter: "B", color: "E86D2C", title: "Focal (Temporal Lobe)", desc: "Burst of repetitive spikes with SUDDEN ONSET in the right temporal region. Transient impairment of awareness." }, { letter: "C", color: COL_TEAL, title: "Absence Seizure", desc: "Generalized 3-Hz spike-wave activity occurring SYNCHRONOUSLY over both hemispheres. Classic pattern." }, { letter: "D", color: "9B59B6", title: "Activating Procedures", desc: "Hyperventilation (3–4 min), photic stimulation, sleep & sleep deprivation are used to provoke EEG abnormalities." } ]; patterns.forEach((pat, i) => { const x = i < 2 ? 0.3 : 5.0; const y = i % 2 === 0 ? 1.2 : 3.15; slide7.addShape(pres.ShapeType.rect, { x, y, w: 4.5, h: 1.75, fill: { color: COL_MED }, rounding: true }); slide7.addShape(pres.ShapeType.rect, { x, y, w: 0.7, h: 1.75, fill: { color: pat.color }, rounding: true }); slide7.addText(pat.letter, { x: x + 0.05, y: y + 0.6, w: 0.62, h: 0.55, fontSize: 26, color: COL_WHITE, bold: true, align: "center", margin: 0 }); slide7.addText(pat.title, { x: x + 0.82, y: y + 0.12, w: 3.55, h: 0.38, fontSize: 13, color: COL_WHITE, bold: true, fontFace: "Calibri" }); slide7.addText(pat.desc, { x: x + 0.82, y: y + 0.5, w: 3.55, h: 1.1, fontSize: 10.5, color: COL_LIGHT, fontFace: "Calibri", wrap: true }); }); slide7.addShape(pres.ShapeType.rect, { x: 4.8, y: 1.15, w: 0.04, h: 3.75, fill: { color: COL_ACCENT } }); // ───────────────────────────────────────── // SLIDE 8: VIDEO EEG & ADVANCED EEG // ───────────────────────────────────────── let slide8 = pres.addSlide(); slide8.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: '100%', h: '100%', fill: { color: COL_DARK } }); slide8.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: '100%', h: 1.1, fill: { color: COL_MED } }); slide8.addText("VIDEO-EEG TELEMETRY & MEG", { x: 0.4, y: 0.18, w: 9, h: 0.75, fontSize: 22, color: COL_WHITE, bold: true, fontFace: "Calibri" }); // Left column slide8.addShape(pres.ShapeType.rect, { x: 0.3, y: 1.15, w: 4.5, h: 4.0, fill: { color: "0D2540" }, rounding: true }); slide8.addShape(pres.ShapeType.rect, { x: 0.3, y: 1.15, w: 4.5, h: 0.5, fill: { color: COL_ACCENT }, rounding: true }); slide8.addText("📹 Video-EEG Telemetry", { x: 0.45, y: 1.2, w: 4.2, h: 0.38, fontSize: 13, color: COL_WHITE, bold: true, fontFace: "Calibri" }); const videoPoints = [ "Continuous monitoring for prolonged periods", "Captures electrophysiologic correlates of clinical events", "Routine for accurate diagnosis of epilepsy", "For poorly characterized events or difficult-to-control seizures", "24-hour ambulatory EEG for outpatients", "Hospitalised patients in dedicated telemetry units" ]; videoPoints.forEach((pt, i) => { slide8.addText("▸ " + pt, { x: 0.5, y: 1.72 + i * 0.56, w: 4.1, h: 0.48, fontSize: 11, color: COL_LIGHT, fontFace: "Calibri", wrap: true }); }); // Right column slide8.addShape(pres.ShapeType.rect, { x: 5.1, y: 1.15, w: 4.5, h: 4.0, fill: { color: "0D2540" }, rounding: true }); slide8.addShape(pres.ShapeType.rect, { x: 5.1, y: 1.15, w: 4.5, h: 0.5, fill: { color: COL_TEAL }, rounding: true }); slide8.addText("🔬 Magnetoencephalography (MEG)", { x: 5.25, y: 1.2, w: 4.2, h: 0.38, fontSize: 13, color: COL_WHITE, bold: true, fontFace: "Calibri" }); const megPoints = [ "Measures small magnetic fields generated by brain activity", "Non-invasive cortical activity measurement", "Mathematical source estimation techniques", "Plotted on MRI → generates Magnetic Source Image (MSI)", "Useful to LOCALIZE potential seizure foci", "Supplements standard EEG localization" ]; megPoints.forEach((pt, i) => { slide8.addText("▸ " + pt, { x: 5.3, y: 1.72 + i * 0.56, w: 4.1, h: 0.48, fontSize: 11, color: COL_LIGHT, fontFace: "Calibri", wrap: true }); }); // ───────────────────────────────────────── // SLIDE 9: BRAIN IMAGING // ───────────────────────────────────────── let slide9 = pres.addSlide(); slide9.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: '100%', h: '100%', fill: { color: COL_DARK } }); slide9.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: '100%', h: 1.1, fill: { color: COL_MED } }); slide9.addText("BRAIN IMAGING IN EPILEPSY", { x: 0.4, y: 0.18, w: 9, h: 0.75, fontSize: 22, color: COL_WHITE, bold: true, fontFace: "Calibri" }); const imagingMethods = [ { icon: "🧲", name: "MRI", color: COL_ACCENT, desc: "GOLD STANDARD — Superior to CT for cerebral lesions. Detects tumors, vascular malformations, hippocampal atrophy (mesial temporal sclerosis), cortical architecture abnormalities. 3D imaging at submillimeter resolution." }, { icon: "📡", name: "CT Scan", color: "E86D2C", desc: "Emergency use when MRI unavailable. Good for rapid assessment of CNS infection or mass lesion. Should be performed when MRI is not immediately available." }, { icon: "☢️", name: "PET Scan", color: COL_TEAL, desc: "Positron Emission Tomography — used for medically refractory seizures. Evaluates metabolic activity in seizure focus regions." }, { icon: "🔭", name: "SPECT", color: "9B59B6", desc: "Single-Photon Emission Computed Tomography — assesses cerebral blood flow. Useful in pre-surgical evaluation of refractory epilepsy patients." } ]; imagingMethods.forEach((method, i) => { const y = 1.18 + i * 1.05; slide9.addShape(pres.ShapeType.rect, { x: 0.3, y, w: 9.3, h: 0.95, fill: { color: "0D2540" }, rounding: true }); slide9.addShape(pres.ShapeType.rect, { x: 0.3, y, w: 1.2, h: 0.95, fill: { color: method.color }, rounding: true }); slide9.addText(method.icon, { x: 0.3, y: y + 0.18, w: 1.2, h: 0.55, fontSize: 24, align: "center", margin: 0 }); slide9.addText(method.name, { x: 1.65, y: y + 0.07, w: 1.5, h: 0.38, fontSize: 14, color: method.color, bold: true, fontFace: "Calibri" }); slide9.addText(method.desc, { x: 1.65, y: y + 0.42, w: 7.7, h: 0.48, fontSize: 9.5, color: COL_LIGHT, fontFace: "Calibri", wrap: true }); }); // ───────────────────────────────────────── // SLIDE 10: GENETIC TESTING // ───────────────────────────────────────── let slide10 = pres.addSlide(); slide10.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: '100%', h: '100%', fill: { color: COL_DARK } }); slide10.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: '100%', h: 1.1, fill: { color: COL_MED } }); slide10.addText("GENETIC TESTING IN EPILEPSY", { x: 0.4, y: 0.18, w: 9, h: 0.75, fontSize: 22, color: COL_WHITE, bold: true, fontFace: "Calibri" }); // Central DNA icon slide10.addShape(pres.ShapeType.rect, { x: 3.5, y: 1.2, w: 2.9, h: 0.9, fill: { color: COL_ACCENT }, rounding: true }); slide10.addText("🧬 Genetic Testing", { x: 3.5, y: 1.3, w: 2.9, h: 0.65, fontSize: 16, color: COL_WHITE, bold: true, align: "center", fontFace: "Calibri" }); const genPoints = [ { y: 2.2, w: 4.4, x: 0.3, color: COL_ACCENT, txt: "Increasing recognition of specific gene mutations causing epilepsy is driving integration into standard diagnostic evaluation." }, { y: 2.2, w: 4.4, x: 5.1, color: COL_TEAL, txt: "Provides DEFINITIVE DIAGNOSIS — benefits patient & family; curtails pursuit of additional unrevealing laboratory testing." }, { y: 3.4, w: 4.4, x: 0.3, color: "9B59B6", txt: "Guides THERAPEUTIC OPTIONS — specific genetic diagnoses may influence antiseizure drug selection." }, { y: 3.4, w: 4.4, x: 5.1, color: "E86D2C", txt: "Currently primary use: infants & children with epilepsy syndromes of suspected genetic cause; also older patients with early-onset undiagnosed genetic epilepsy." }, ]; genPoints.forEach((pt, i) => { slide10.addShape(pres.ShapeType.rect, { x: pt.x, y: pt.y, w: pt.w, h: 1.0, fill: { color: "0D2540" }, rounding: true }); slide10.addShape(pres.ShapeType.rect, { x: pt.x, y: pt.y, w: pt.w, h: 0.08, fill: { color: pt.color }, rounding: true }); slide10.addText(pt.txt, { x: pt.x + 0.15, y: pt.y + 0.15, w: pt.w - 0.3, h: 0.78, fontSize: 10.5, color: COL_LIGHT, fontFace: "Calibri", wrap: true }); }); // Dravet & Lennox-Gastaut note slide10.addShape(pres.ShapeType.rect, { x: 0.3, y: 4.48, w: 9.3, h: 0.75, fill: { color: "152B4A" }, rounding: true }); slide10.addShape(pres.ShapeType.rect, { x: 0.3, y: 4.48, w: 0.08, h: 0.75, fill: { color: COL_YELLOW } }); slide10.addText("Notable: Cannabidiol (CBD) — effective for Dravet syndrome & Lennox-Gastaut syndrome. Multimodal mechanism: modulation of intracellular calcium via G protein-coupled receptor 55, calcium influx via TRPV1 channels, and adenosine-mediated signaling.", { x: 0.5, y: 4.52, w: 9.0, h: 0.65, fontSize: 9.5, color: COL_LIGHT, fontFace: "Calibri", italic: true }); // ───────────────────────────────────────── // SLIDE 11: DIFFERENTIAL DIAGNOSIS // ───────────────────────────────────────── let slide11 = pres.addSlide(); slide11.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: '100%', h: '100%', fill: { color: COL_DARK } }); slide11.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: '100%', h: 1.1, fill: { color: COL_MED } }); slide11.addText("DIFFERENTIAL DIAGNOSIS OF SEIZURES", { x: 0.4, y: 0.18, w: 9, h: 0.75, fontSize: 20, color: COL_WHITE, bold: true, fontFace: "Calibri" }); // 3-column layout const ddx = [ { title: "SYNCOPE", color: COL_ACCENT, icon: "💫", points: [ "Triggered by acute pain, emotional stress", "Occurs immediately after arising from sitting/lying", "Stereotyped: tiredness, sweating, nausea, tunnel vision", "Relatively brief loss of consciousness", "1–10 s of convulsive motor activity possible", "POST: confusion much LESS than seizure" ]}, { title: "PSYCHOGENIC SEIZURES", color: "E86D2C", icon: "🧠", points: [ "Nonepileptic behaviors resembling seizures", "Conversion reaction with psychological distress", "Side-to-side head turning, eye closure", "Asymmetric large-amplitude limb shaking", "Pelvic thrusting (more common)", "Often last LONGER than epileptic seizures" ]}, { title: "SEIZURE vs SYNCOPE", color: COL_TEAL, icon: "⚖️", points: [ "Seizure: presence of AURA", "Seizure: CYANOSIS during episode", "Seizure: motor activity >15 seconds", "Seizure: postictal disorientation & sleepiness", "Seizure: muscle soreness afterward", "Prolactin rises postictally (not with psychogenic)" ]} ]; ddx.forEach((col, i) => { const x = 0.25 + i * 3.2; slide11.addShape(pres.ShapeType.rect, { x, y: 1.15, w: 3.05, h: 4.05, fill: { color: "0D2540" }, rounding: true }); slide11.addShape(pres.ShapeType.rect, { x, y: 1.15, w: 3.05, h: 0.55, fill: { color: col.color }, rounding: true }); slide11.addText(col.icon + " " + col.title, { x: x + 0.12, y: 1.2, w: 2.8, h: 0.42, fontSize: 11, color: COL_WHITE, bold: true, fontFace: "Calibri" }); col.points.forEach((pt, j) => { slide11.addText("• " + pt, { x: x + 0.12, y: 1.77 + j * 0.52, w: 2.8, h: 0.48, fontSize: 9.5, color: COL_LIGHT, fontFace: "Calibri", wrap: true }); }); }); // ───────────────────────────────────────── // SLIDE 12: ANTISEIZURE DRUG MECHANISMS // ───────────────────────────────────────── let slide12 = pres.addSlide(); slide12.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: '100%', h: '100%', fill: { color: COL_DARK } }); slide12.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: '100%', h: 1.1, fill: { color: COL_MED } }); slide12.addText("ANTISEIZURE DRUG MECHANISMS", { x: 0.4, y: 0.18, w: 9, h: 0.75, fontSize: 22, color: COL_WHITE, bold: true, fontFace: "Calibri" }); const drugMechs = [ { mech: "Sodium Channel Blockade", drugs: "Carbamazepine, Phenytoin, Topiramate, Felbamate, Perampanel", color: COL_ACCENT }, { mech: "GABA Receptor Potentiation", drugs: "Benzodiazepines, Barbiturates", color: "E86D2C" }, { mech: "Increased GABA Availability", drugs: "Valproic acid, Gabapentin, Tiagabine", color: COL_TEAL }, { mech: "Synaptic Vesicle Modulation", drugs: "Levetiracetam, Brivaracetam", color: "9B59B6" }, { mech: "T-type Ca²⁺ Channel Inhibition", drugs: "Ethosuximide, Valproic acid (absence seizures)", color: COL_YELLOW }, ]; drugMechs.forEach((item, i) => { slide12.addShape(pres.ShapeType.rect, { x: 0.3, y: 1.18 + i * 0.84, w: 9.3, h: 0.78, fill: { color: "0D2540" }, rounding: true }); slide12.addShape(pres.ShapeType.rect, { x: 0.3, y: 1.18 + i * 0.84, w: 0.25, h: 0.78, fill: { color: item.color }, rounding: true }); slide12.addText(item.mech, { x: 0.68, y: 1.22 + i * 0.84, w: 3.5, h: 0.34, fontSize: 12, color: item.color === COL_YELLOW ? COL_YELLOW : COL_WHITE, bold: true, fontFace: "Calibri" }); slide12.addText("Drugs: " + item.drugs, { x: 0.68, y: 1.52 + i * 0.84, w: 8.8, h: 0.3, fontSize: 10.5, color: COL_LIGHT, fontFace: "Calibri", italic: true }); }); slide12.addShape(pres.ShapeType.rect, { x: 0.3, y: 5.38, w: 9.3, h: 0.2, fill: { color: COL_ACCENT }, rounding: true }); slide12.addText("Note: NO drugs currently known to prevent seizure FOCUS formation following CNS injury (antiepileptogenic drugs are an active research area)", { x: 0.4, y: 5.4, w: 9.0, h: 0.2, fontSize: 8, color: COL_LIGHT, fontFace: "Calibri", italic: true }); // ───────────────────────────────────────── // SLIDE 13: EVALUATION FLOWCHART // ───────────────────────────────────────── let slide13 = pres.addSlide(); slide13.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: '100%', h: '100%', fill: { color: COL_DARK } }); slide13.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: '100%', h: 1.1, fill: { color: COL_MED } }); slide13.addText("EVALUATION ALGORITHM — FIRST SEIZURE", { x: 0.4, y: 0.18, w: 9, h: 0.75, fontSize: 20, color: COL_WHITE, bold: true, fontFace: "Calibri" }); // Flowchart nodes const nodes = [ { x: 3.5, y: 1.15, w: 2.9, h: 0.6, color: COL_ACCENT, text: "Patient with First Seizure" }, { x: 3.5, y: 2.0, w: 2.9, h: 0.6, color: "152B4A", text: "Vital Signs & Stabilization" }, { x: 3.5, y: 2.85, w: 2.9, h: 0.6, color: "152B4A", text: "History & Physical Exam" }, { x: 0.3, y: 3.7, w: 2.6, h: 0.6, color: COL_TEAL, text: "Blood Tests + Tox Screen" }, { x: 3.5, y: 3.7, w: 2.9, h: 0.6, color: COL_TEAL, text: "EEG (as soon as possible)" }, { x: 6.9, y: 3.7, w: 2.6, h: 0.6, color: COL_TEAL, text: "MRI Brain Imaging" }, { x: 3.5, y: 4.55, w: 2.9, h: 0.65, color: COL_ACCENT, text: "Diagnosis & Treatment\nDecision" }, ]; nodes.forEach(node => { slide13.addShape(pres.ShapeType.rect, { x: node.x, y: node.y, w: node.w, h: node.h, fill: { color: node.color }, rounding: true }); slide13.addText(node.text, { x: node.x, y: node.y, w: node.w, h: node.h, fontSize: 10.5, color: COL_WHITE, bold: true, align: "center", valign: "middle", fontFace: "Calibri" }); }); // Arrows (simplified as lines) const arrows = [ [4.95, 1.75, 4.95, 2.0], [4.95, 2.6, 4.95, 2.85], [4.95, 3.45, 4.95, 3.7], [4.95, 3.45, 1.6, 3.7], [4.95, 3.45, 8.2, 3.7], [1.6, 4.3, 4.95, 4.55], [4.95, 4.3, 4.95, 4.55], [8.2, 4.3, 4.95, 4.55] ]; arrows.forEach(a => { slide13.addShape(pres.ShapeType.line, { x: a[0], y: a[1], w: a[2] - a[0], h: a[3] - a[1], line: { color: COL_GREY, width: 1.5 } }); }); // If CNS infection note slide13.addShape(pres.ShapeType.rect, { x: 0.3, y: 1.15, w: 2.9, h: 0.6, fill: { color: "8B0000" }, rounding: true }); slide13.addText("⚠️ Exclude: CNS infection,\nMetabolic derangement, Drug toxicity", { x: 0.3, y: 1.15, w: 2.9, h: 0.6, fontSize: 9, color: COL_WHITE, align: "center", valign: "middle", fontFace: "Calibri" }); slide13.addShape(pres.ShapeType.rect, { x: 6.7, y: 1.15, w: 2.9, h: 0.6, fill: { color: "1A3A1A" }, rounding: true }); slide13.addText("Consider genetic testing\nif syndrome suspected", { x: 6.7, y: 1.15, w: 2.9, h: 0.6, fontSize: 9, color: COL_LIGHT, align: "center", valign: "middle", fontFace: "Calibri" }); // ───────────────────────────────────────── // SLIDE 14: SUMMARY // ───────────────────────────────────────── let slide14 = pres.addSlide(); slide14.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: '100%', h: '100%', fill: { color: COL_DARK } }); slide14.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: '100%', h: 1.1, fill: { color: COL_MED } }); slide14.addText("SUMMARY — KEY TAKEAWAYS", { x: 0.4, y: 0.18, w: 9, h: 0.75, fontSize: 22, color: COL_WHITE, bold: true, fontFace: "Calibri" }); const summaryPts = [ { num: "1", color: COL_ACCENT, text: "History & exam are the FOUNDATION — seizure diagnosis is often purely clinical." }, { num: "2", color: COL_TEAL, text: "EEG is always abnormal during generalized tonic-clonic seizures; initial EEG may be normal in 50–80% of epileptics." }, { num: "3", color: "E86D2C", text: "MRI is superior to CT for cerebral lesions — should be obtained in virtually all patients with new-onset seizures." }, { num: "4", color: "9B59B6", text: "Video-EEG telemetry is the gold standard for characterizing events in refractory or poorly-defined cases." }, { num: "5", color: COL_YELLOW, text: "Genetic testing is increasingly important, especially in pediatric epilepsy — guides both diagnosis and therapy." }, { num: "6", color: "E74C3C", text: "Differential diagnosis must include syncope and psychogenic seizures — prolactin levels can help distinguish." } ]; summaryPts.forEach((pt, i) => { slide14.addShape(pres.ShapeType.rect, { x: 0.3, y: 1.18 + i * 0.72, w: 9.3, h: 0.65, fill: { color: "0D2540" }, rounding: true }); slide14.addShape(pres.ShapeType.rect, { x: 0.3, y: 1.18 + i * 0.72, w: 0.55, h: 0.65, fill: { color: pt.color }, rounding: true }); slide14.addText(pt.num, { x: 0.3, y: 1.18 + i * 0.72, w: 0.55, h: 0.65, fontSize: 18, color: COL_WHITE, bold: true, align: "center", valign: "middle", margin: 0 }); slide14.addText(pt.text, { x: 1.0, y: 1.22 + i * 0.72, w: 8.5, h: 0.55, fontSize: 11, color: COL_LIGHT, fontFace: "Calibri", valign: "middle", wrap: true }); }); // ───────────────────────────────────────── // SLIDE 15: CLOSING // ───────────────────────────────────────── let slide15 = pres.addSlide(); slide15.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: '100%', h: '100%', fill: { color: COL_DARK } }); slide15.addShape(pres.ShapeType.rect, { x: 0, y: 2.3, w: '100%', h: 0.05, fill: { color: COL_TEAL } }); slide15.addShape(pres.ShapeType.rect, { x: 0, y: 2.35, w: '100%', h: 0.05, fill: { color: COL_ACCENT } }); slide15.addText("🧠", { x: 4.2, y: 0.4, w: 1.5, h: 1.1, fontSize: 60, align: "center" }); slide15.addText("INVESTIGATION OF\nEPILEPSY & SEIZURE", { x: 0.5, y: 1.5, w: 9, h: 1.2, fontSize: 38, color: COL_WHITE, bold: true, align: "center", fontFace: "Calibri" }); slide15.addText("Thank You", { x: 0.5, y: 2.8, w: 9, h: 0.6, fontSize: 22, color: COL_ACCENT, align: "center", italic: true, fontFace: "Calibri" }); slide15.addText("Reference: Harrison's Principles of Internal Medicine | Chapter 425", { x: 0.5, y: 3.5, w: 9, h: 0.4, fontSize: 12, color: COL_GREY, align: "center", fontFace: "Calibri" }); slide15.addText("Slides cover: Patient Evaluation | EEG Studies | Brain Imaging | Genetic Testing | Differential Diagnosis | Drug Mechanisms", { x: 0.5, y: 4.1, w: 9, h: 0.5, fontSize: 10, color: COL_GREY, align: "center", fontFace: "Calibri", italic: true }); // Save pres.writeFile({ fileName: "/home/daytona/workspace/epilepsy-pptx/Epilepsy_Investigation.pptx" }) .then(() => console.log("Presentation saved successfully!")) .catch(err => console.error("Error:", err)); JSEOF echo "Script written"
cd /home/daytona/workspace/epilepsy-pptx && \ curl -L -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36" \ "https://thumbs.dreamstime.com/b/epilepsy-eeg-healthy-brain-epileptic-seizure-condition-characterized-recurrent-unpredictable-seizures-human-primary-126355586.jpg" \ -o eeg_brain.jpg 2>&1 | tail -3 && \ echo "File size: $(wc -c < eeg_brain.jpg) bytes" && \ file eeg_brain.jpg
cd /home/daytona/workspace/epilepsy-pptx && \ curl -L -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36" \ "https://media.sciencephoto.com/image/m1500280/800wm/M1500280-Brain_waves_in_epilepsy.jpg" \ -o brain_waves.jpg 2>&1 | tail -3 && \ echo "File size: $(wc -c < brain_waves.jpg) bytes" && \ file brain_waves.jpg && \ # Now run the presentation script node /home/daytona/workspace/epilepsy-pptx/create_pptx.js
~/epilepsy-pptx/create_pptx.js
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/epilepsy-pptx/create_pptx.js'
node /home/daytona/workspace/epilepsy-pptx/create_pptx.js
ls -lh /home/daytona/workspace/epilepsy-pptx/Epilepsy_Investigation.pptx
Epilepsy Investigation
Presentation · PPTX
| # | Slide | Content |
|---|---|---|
| 1 | Title Slide | Dark navy, "Investigation of Epilepsy & Seizure", Harrison's reference |
| 2 | Overview | 6 numbered sections with subtitles |
| 3 | History & Physical Exam | Two-column: 6 history points + 6 exam points |
| 4 | Laboratory Studies | 4 card panels — Blood, Toxicology, LP, Autoantibodies |
| 5 | EEG Basics | Frequency table (Alpha/Beta/Theta/Delta) + 6 clinical uses |
| 6 | EEG Images | Side-by-side: Dreamstime EEG brain diagram + Science Photo Library real EEG recording |
| 7 | Electrographic Patterns | Tonic, Temporal Lobe, Absence (3-Hz), Activation procedures |
| 8 | Video-EEG & MEG | Two-column comparison with all key points |
| 9 | Brain Imaging | MRI (gold standard), CT, PET, SPECT - 4 horizontal panels |
| 10 | Genetic Testing | 4 info cards + CBD/Dravet syndrome callout |
| 11 | Differential Diagnosis | 3-column: Syncope vs Psychogenic vs Seizure features |
| 12 | Drug Mechanisms | 5 mechanisms (Na+ channel, GABA, SV2A, T-Ca²⁺) with drug names |
| 13 | Evaluation Algorithm | Flowchart: first seizure workup steps |
| 14 | Key Takeaways | 6 numbered summary points |
| 15 | Closing Slide | Thank you with full reference |