Sub CreateNeuroimagingBrainSlides() Dim ppt As Presentation Dim sld As Slide Dim i As Integer Set ppt = ActivePresentation ' Arrays for slide content Dim Diagnosis As Variant Dim Findings As Variant Dim Buzzword As Variant Dim Diff As Variant Diagnosis = Array( _ "Agenesis of Corpus Callosum", "Chiari I Malformation", "Dandy-Walker Malformation", "Holoprosencephaly", "Lissencephaly", _ "Polymicrogyria", "Schizencephaly", "Tuberous Sclerosis", "Sturge-Weber Syndrome", "Neurofibromatosis Type 1", _ "Neurofibromatosis Type 2", "Vein of Galen Malformation", "Cavernous Malformation", "Arteriovenous Malformation", _ "Hypertensive Hemorrhage", "Subarachnoid Hemorrhage", "Ischemic Stroke (Acute)", "Posterior Reversible Encephalopathy Syndrome", _ "Cerebral Venous Thrombosis", "Moyamoya Disease", "Glioblastoma Multiforme", "Astrocytoma (Low Grade)", _ "Anaplastic Astrocytoma", "Oligodendroglioma", "Ependymoma", "Medulloblastoma", "Meningioma", "Primary CNS Lymphoma", _ "Metastasis", "Craniopharyngioma", "Pituitary Macroadenoma", "Hemangioblastoma", "Central Neurocytoma", _ "Dysembryoplastic Neuroepithelial Tumor", "Brain Abscess", "Tuberculoma", "Neurocysticercosis", "Herpes Encephalitis", _ "Japanese Encephalitis", "Progressive Multifocal Leukoencephalopathy", "HIV Encephalopathy", "Multiple Sclerosis", _ "Acute Disseminated Encephalomyelitis", "Neuromyelitis Optica", "Leukodystrophy (Metachromatic)", _ "Adrenoleukodystrophy", "Canavan Disease", "Alexander Disease", "Marchiafava-Bignami Disease", _ "Wernicke Encephalopathy", "Osmotic Demyelination Syndrome", "Diffuse Axonal Injury", _ "Hypoxic Ischemic Encephalopathy", "Rasmussen Encephalitis", "Autoimmune Limbic Encephalitis", _ "Creutzfeldt-Jakob Disease", "Subacute Sclerosing Panencephalitis", "CADASIL" _ ) Findings = Array( _ "Absent corpus callosum; colpocephaly; high riding 3rd ventricle", _ "Cerebellar tonsillar herniation >5mm below foramen magnum", _ "Cystic dilatation of 4th ventricle; enlarged posterior fossa", _ "Single ventricle; fused thalami; absent midline structures", _ "Smooth brain; thick cortex; absent sulci", _ "Irregular cortical thickening; multiple small gyri", _ "CSF cleft lined by gray matter", _ "Subependymal nodules; cortical tubers; radial bands", _ "Leptomeningeal enhancement; tram-track calcifications", _ "T2 hyperintense unidentified bright objects (UBOs)", _ "Bilateral vestibular schwannomas", _ "Midline vascular mass with flow voids", _ "Popcorn lesion with hemosiderin rim on GRE", _ "Serpiginous flow voids; nidus", _ "Deep hemorrhage in basal ganglia; blooming on SWI", _ "Hyperintense sulci on FLAIR; blooming on SWI", _ "DWI restriction; low ADC", _ "Posterior white matter edema; T2/FLAIR hyperintensity", _ "Absent flow in venous sinus; blooming on SWI", _ "Multiple collaterals; ivy sign", _ "Ring enhancing lesion; necrosis; crossing corpus callosum", _ "T2 hyperintense; minimal enhancement", _ "Heterogeneous enhancement; necrosis", _ "Calcification; cortical-subcortical location", _ "4th ventricle mass; heterogeneous enhancement", _ "Midline posterior fossa tumor; restricted diffusion", _ "Extra-axial enhancing mass; dural tail", _ "Homogeneous enhancement; diffusion restriction", _ "Multiple ring enhancing lesions", _ "Suprasellar cystic lesion; calcifications", _ "Sellar mass with suprasellar extension", _ "Cystic lesion with mural nodule", _ "Intraventricular mass near foramen of Monro", _ "Cortical lesion; bubbly appearance", _ "Ring enhancement; central diffusion restriction", _ "T2 hypointense rim; caseating granuloma", _ "Cyst with scolex; ring enhancement", _ "Temporal lobe hyperintensity; hemorrhage", _ "Thalamic involvement; hemorrhagic lesions", _ "Asymmetric white matter lesions; no enhancement", _ "Diffuse atrophy; white matter hyperintensity", _ "Periventricular plaques; Dawson fingers", _ "Diffuse bilateral white matter lesions", _ "Optic nerve and spinal cord involvement", _ "Symmetric periventricular changes", _ "Posterior white matter involvement", _ "Diffuse white matter involvement", _ "Frontal white matter changes; enhancement", _ "Corpus callosum necrosis", _ "Mammillary body enhancement", _ "Central pontine T2 hyperintensity", _ "Multiple punctate hemorrhages on SWI", _ "Diffuse cortical and deep gray injury", _ "Hemisphere atrophy; T2 hyperintensity", _ "Mesial temporal hyperintensity", _ "Cortical ribboning; DWI restriction", _ "Diffuse white matter degeneration", _ "Anterior temporal lobe involvement" _ ) Buzzword = Array( _ "Racing car ventricles", "Peg-like tonsils", "Bat-wing 4th ventricle", "Monoventricle", "Smooth brain", _ "Too many gyri", "Gray matter lined cleft", "Candle guttering", "Tram-track calcification", "UBOs", _ "Bilateral vestibular schwannomas", "Median prosencephalic fistula", "Popcorn lesion", "Bag of worms", _ "Charcot-Bouchard aneurysm", "Berry aneurysm rupture", "Bright on DWI", "Posterior edema", _ "Empty delta sign", "Puff of smoke", "Butterfly glioma", "Low grade glioma", _ "High grade glioma", "Fried egg cells", "4th ventricle tumor", "Blue cell tumor", _ "Dural tail sign", "Hyperdense lymphoma", "Multiple mets", "Adamantinomatous tumor", _ "Snowman sign", "Cyst with nodule", "Foramen of Monro tumor", "Bubbly tumor", _ "Ring lesion with restriction", "Caseating granuloma", "Scolex sign", "Temporal lobe encephalitis", _ "Thalamic JE", "JC virus infection", "HIV dementia", "Dawson fingers", _ "Post-infectious demyelination", "Longitudinal cord lesion", "Tiger stripe pattern", _ "Posterior predominant", "Spongy degeneration", "Frontal leukodystrophy", _ "Alcohol related necrosis", "Confusion + ataxia", "Locked-in risk", _ "Shear injury", "Watershed injury", "Hemisphere atrophy", _ "Limbic encephalitis", "Rapid dementia", "Measles complication", "Migraine strokes" _ ) Diff = Array( _ "Septo-optic dysplasia", "Chiari II", "Arachnoid cyst", "Hydranencephaly", "Pachygyria", _ "Focal cortical dysplasia", "Porencephaly", "Subependymal giant cell astrocytoma", "Meningioma", "Low grade glioma", _ "Meningioma", "AVM", "Hemorrhagic metastasis", "Dural AV fistula", _ "AVM rupture", "Meningitis", "Seizure", "Ischemia", _ "Tumor thrombus", "Atherosclerosis", "Abscess", "Demyelination", _ "GBM", "Metastasis", "Medulloblastoma", "Ependymoma", _ "Schwannoma", "Toxoplasmosis", "Abscess", "Rathke cleft cyst", _ "Craniopharyngioma", "Metastasis", "Ependymoma", "Ganglioglioma", _ "Necrotic tumor", "Metastasis", "Tuberculoma", "Tumor", _ "Dengue encephalitis", "MS", "Age related changes", "ADEM", _ "MS", "MS", "Krabbe disease", _ "MS", "Leukodystrophy", "Tumor", _ "Infarct", "Alcohol withdrawal", "Pontine infarct", _ "Contusion", "Infection", "Tumor", _ "Herpes encephalitis", "Alzheimer disease", "ADEM", "Small vessel disease" _ ) ' Loop to create slides For i = LBound(Diagnosis) To UBound(Diagnosis) Set sld = ppt.Slides.Add(ppt.Slides.Count + 1, ppLayoutText) sld.Shapes.Title.TextFrame.TextRange.Text = Diagnosis(i) sld.Shapes.Placeholders(2).TextFrame.TextRange.Text = _ "Key MRI Findings:" & vbCrLf & Findings(i) & vbCrLf & vbCrLf & _ "Classic Exam Buzzword/Sign:" & vbCrLf & Buzzword(i) & vbCrLf & vbCrLf & _ "Top Differential Diagnosis:" & vbCrLf & Diff(i) ' Formatting With sld.Shapes.Title.TextFrame.TextRange.Font .Size = 32 .Bold = True End With With sld.Shapes.Placeholders(2).TextFrame.TextRange.Font .Size = 20 End With Next i MsgBox "Neuroimaging Brain Slides Created Successfully!" End Sub ADD IMAGES FROM RADIOLOGY TEXTBOOK AND COVER ALL PATHOLOGIES OF BRAIN CNS SYSTEM

Checking Date & Time
Reading File
Reading File
Reading File
Finding Sources
Finding Sources
Searching Images

agenesis corpus callosum MRI brain

Searching Images

Chiari malformation cerebellar tonsillar herniation MRI

Searching Images

Dandy-Walker malformation posterior fossa cyst MRI

Searching Images

holoprosencephaly single ventricle MRI brain

Searching Images

lissencephaly smooth brain MRI

Searching Images

tuberous sclerosis subependymal nodules cortical tubers MRI brain

Searching Images

glioblastoma multiforme ring enhancing butterfly glioma MRI

Searching Images

acute ischemic stroke DWI diffusion restriction MRI brain

Searching Images

multiple sclerosis Dawson fingers periventricular plaques MRI

Searching Images

medulloblastoma posterior fossa pediatric brain MRI

Running Command

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

Running Command

mkdir -p /home/daytona/workspace/neuroimaging-brain-ppt

Writing File

~/neuroimaging-brain-ppt/generate.js

const pptxgen = require("pptxgenjs");
const { execSync } = require("child_process");

// ─── colour palette ──────────────────────────────────────────────────────────
const BG       = "0A0E1A";   // near-black navy
const ACCENT   = "00C2E0";   // cyan accent
const GOLD     = "FFD166";   // gold
const WHITE    = "FFFFFF";
const DIM      = "B0C4D8";   // soft blue-grey
const PANEL_BG = "111827";   // slightly lighter panel

// ─── helper: fetch images via the shared script ──────────────────────────────
function fetchImages(urls) {
  if (!urls || urls.length === 0) return [];
  const arg = urls.map(u => `"${u}"`).join(" ");
  try {
    const raw = execSync(
      `node /home/daytona/skills/shared/scripts/fetch_images.js ${arg}`,
      { maxBuffer: 50 * 1024 * 1024 }
    ).toString();
    return JSON.parse(raw);
  } catch (e) {
    console.error("fetch_images error:", e.message);
    return urls.map(() => ({ base64: null, error: e.message }));
  }
}

// ─── slide data ──────────────────────────────────────────────────────────────
// Format: [Diagnosis, Findings, Buzzword/Sign, Differential, imageUrl]
const slides = [
  [
    "Agenesis of Corpus Callosum",
    "Absent corpus callosum; colpocephaly;\nhigh riding 3rd ventricle; parallel lateral ventricles",
    "Racing-car ventricles / Probst bundles",
    "Septo-optic dysplasia",
    "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_0f5e9aeb2428756a56c594e6e3d7d596db3297c60f34bf4a88635b75e75d0bfd.jpg"
  ],
  [
    "Chiari I Malformation",
    "Cerebellar tonsillar herniation >5 mm\nbelow foramen magnum; ± syringomyelia",
    "Peg-like tonsils",
    "Chiari II malformation",
    "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_a4d553a7404de949c1fdbfc699cd619d4c1e06ec48ae8b0ef438c404f45b5556.jpg"
  ],
  [
    "Dandy-Walker Malformation",
    "Cystic dilatation of 4th ventricle;\nhypoplastic vermis; enlarged posterior fossa",
    "Bat-wing 4th ventricle",
    "Arachnoid cyst / Mega cisterna magna",
    "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_7cba0f7aca380026d4178556828560897f68734a752e61c8100731f65a431df0.jpg"
  ],
  [
    "Holoprosencephaly",
    "Single monoventricle; fused thalami;\nabsent falx, corpus callosum & midline",
    "Monoventricle / Pancake brain",
    "Hydranencephaly",
    "https://cdn.orris.care/cdss_images/medpix_vqa_b465b68d-ce0b-43f3-a764-3b33eef04577_1766169634517.png"
  ],
  [
    "Lissencephaly",
    "Smooth brain; thick cortex; absent sulci;\ncolpocephaly; figure-of-8 appearance",
    "Smooth brain / Agyria",
    "Pachygyria spectrum",
    "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_d9b90cd4a1f93d1d9935dfd9a32297c016f60155ee28f2206f29a55083529763.jpg"
  ],
  [
    "Polymicrogyria",
    "Irregular cortical thickening;\nmultiple small overcrowded gyri",
    "Too many gyri",
    "Focal cortical dysplasia",
    null
  ],
  [
    "Schizencephaly",
    "CSF cleft lined by gray matter\nspanning full cortical thickness",
    "Gray-matter–lined cleft",
    "Porencephaly (no gray-matter lining)",
    null
  ],
  [
    "Tuberous Sclerosis",
    "Subependymal nodules; cortical tubers;\nradial migration bands (candle drippings)",
    "Candle guttering / Subependymal nodules",
    "Subependymal giant cell astrocytoma (SEGA)",
    "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_8f1f1ec3e79a2c39ee3e2cacf3652ea63e7a4e548377701139fac55616762b77.jpg"
  ],
  [
    "Sturge-Weber Syndrome",
    "Leptomeningeal enhancement;\ntram-track cortical calcifications;\nhemisphere atrophy",
    "Tram-track calcification",
    "Meningioma",
    null
  ],
  [
    "Neurofibromatosis Type 1 (NF1)",
    "T2 hyperintense unidentified bright\nobjects (UBOs) in basal ganglia,\ncerebellum, brainstem",
    "UBOs (Unidentified Bright Objects)",
    "Low-grade glioma",
    null
  ],
  [
    "Neurofibromatosis Type 2 (NF2)",
    "Bilateral vestibular schwannomas;\nmeningiomas; spinal ependymomas",
    "Bilateral vestibular schwannomas",
    "Meningioma",
    null
  ],
  [
    "Vein of Galen Malformation",
    "Midline vascular mass with flow voids;\nhigh-output cardiac failure in neonates",
    "Median prosencephalic fistula",
    "AVM",
    null
  ],
  [
    "Cavernous Malformation",
    "Popcorn lesion with mixed signal;\nhemosiderin rim on GRE/SWI (blooming)",
    "Popcorn lesion",
    "Hemorrhagic metastasis",
    null
  ],
  [
    "Arteriovenous Malformation (AVM)",
    "Serpiginous flow voids; nidus;\nmixed hemorrhage; angioarchitecture",
    "Bag of worms",
    "Dural AV fistula",
    null
  ],
  [
    "Hypertensive Hemorrhage",
    "Deep hemorrhage — basal ganglia,\nthalamus, pons; blooming on SWI;\nCharcot-Bouchard microaneurysms",
    "Charcot-Bouchard aneurysm (site)",
    "AVM rupture",
    null
  ],
  [
    "Subarachnoid Hemorrhage",
    "Hyperintense sulci on FLAIR;\nblooming on SWI; blood in cisterns",
    "Berry aneurysm rupture",
    "Meningitis (sulcal FLAIR hyperintensity)",
    null
  ],
  [
    "Ischemic Stroke (Acute)",
    "DWI hyperintensity; ADC hypointensity\n(cytotoxic edema); vascular territory",
    "Bright on DWI / DWI-ADC mismatch",
    "Seizure-related changes (Todd paralysis)",
    "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_5df989fcd229ba4365973eb71cce8e33192f281a3755b87ce9032b0668907ac2.jpg"
  ],
  [
    "Posterior Reversible Encephalopathy\nSyndrome (PRES)",
    "Bilateral posterior > anterior white\nmatter T2/FLAIR edema; no DWI restriction\n(vasogenic edema)",
    "Posterior edema — reversible",
    "Basilar artery stroke / ischemia",
    null
  ],
  [
    "Cerebral Venous Thrombosis (CVT)",
    "Absent flow in venous sinus; dense\nsinus sign on CT; blooming on SWI;\nempty delta sign post-contrast",
    "Empty delta sign",
    "Tumour thrombus",
    null
  ],
  [
    "Moyamoya Disease",
    "Multiple collateral vessels at skull\nbase; ivy sign on FLAIR; progressive\nICA stenosis",
    "Puff of smoke angiogram",
    "Atherosclerotic disease",
    null
  ],
  [
    "Glioblastoma Multiforme (GBM)",
    "Ring-enhancing lesion; central necrosis;\ncrossing corpus callosum;\nvasogenic edema",
    "Butterfly glioma",
    "Brain abscess (ring lesion)",
    "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_da401eb45e5bf1d0102ec4a1daa0bf5b139adf3405e01d20c68c413d9c1b1a5e.jpg"
  ],
  [
    "Low-Grade Astrocytoma",
    "T2/FLAIR hyperintense; minimal\nor no enhancement; no necrosis;\ncortical-subcortical location",
    "Low-grade glioma — infiltrative",
    "Demyelination",
    null
  ],
  [
    "Anaplastic Astrocytoma (WHO III)",
    "Heterogeneous enhancement;\nno significant necrosis; mass effect",
    "High-grade glioma — patchy enhancement",
    "GBM",
    null
  ],
  [
    "Oligodendroglioma",
    "Cortical-subcortical calcification;\nT2 hyperintense; frontal lobe;\nminimal enhancement",
    "Fried-egg cells / Cortical calcification",
    "Metastasis",
    null
  ],
  [
    "Ependymoma",
    "4th ventricle mass; heterogeneous\nenhancement; plastic — squeezes through\nforamina of Luschka & Magendie",
    "4th ventricle tumor — plastic",
    "Medulloblastoma",
    null
  ],
  [
    "Medulloblastoma",
    "Midline posterior fossa tumor;\nrestricted diffusion (hypercellular);\nhomogeneous enhancement; hydrocephalus",
    "Blue cell tumor / PNET midline",
    "Ependymoma",
    "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_5e366cc8e0b8b6df744b2d0b276010eff8f62f102f94ddb10230569c1a595cf0.jpg"
  ],
  [
    "Meningioma",
    "Extra-axial enhancing mass; broad\ndural base; dural tail sign; buckling\nof white matter",
    "Dural tail sign",
    "Schwannoma",
    null
  ],
  [
    "Primary CNS Lymphoma",
    "Periventricular homogeneous\nenhancement; diffusion restriction;\nhyperdense on CT; immunocompromised",
    "Hyperdense lymphoma — restricted diffusion",
    "Toxoplasmosis",
    null
  ],
  [
    "Brain Metastases",
    "Multiple ring-enhancing lesions;\ngray-white junction; surrounding edema\nout of proportion to size",
    "Multiple mets — grey-white junction",
    "Abscess / Multifocal GBM",
    null
  ],
  [
    "Craniopharyngioma",
    "Suprasellar cystic lesion;\ncalcifications (adamantinomatous);\nT1 hyperintense cyst (cholesterol)",
    "Adamantinomatous tumor — machine oil",
    "Rathke's cleft cyst",
    null
  ],
  [
    "Pituitary Macroadenoma",
    "Sellar mass with suprasellar extension;\nsnowman / figure-8 shape;\ncompresses optic chiasm",
    "Snowman sign",
    "Craniopharyngioma",
    null
  ],
  [
    "Hemangioblastoma",
    "Cerebellar cystic lesion with\nenhancing mural nodule;\nassociated with VHL syndrome",
    "Cyst with mural nodule — cerebellum",
    "Pilocytic astrocytoma",
    null
  ],
  [
    "Central Neurocytoma",
    "Intraventricular mass near\nforamen of Monro; bubbly/\nswiss-cheese appearance; young adults",
    "Foramen of Monro tumor — bubbly",
    "Ependymoma",
    null
  ],
  [
    "DNET (Dysembryoplastic\nNeuroepithelial Tumor)",
    "Cortical lesion; bubbly multicystic\nappearance; no edema; no enhancement;\nlong history of seizures",
    "Bubbly cortical tumor — no edema",
    "Ganglioglioma",
    null
  ],
  [
    "Brain Abscess",
    "Ring-enhancing lesion; central DWI\nrestriction (pus); thin smooth wall;\nsurrounding edema",
    "Ring lesion with central restriction",
    "Necrotic GBM",
    null
  ],
  [
    "Tuberculoma",
    "T2 hypointense rim; caseating\ngranuloma; central enhancement or\nring; basal meningitis",
    "Caseating granuloma — T2 dark rim",
    "Metastasis",
    null
  ],
  [
    "Neurocysticercosis",
    "Cyst with scolex (dot sign);\nstages: vesicular → colloidal →\ngranular → calcified",
    "Scolex sign / Dot-in-hole",
    "Tuberculoma",
    null
  ],
  [
    "Herpes Encephalitis (HSV-1)",
    "Temporal lobe + insular cortex\nhyperintensity on T2/FLAIR;\npetechial hemorrhage; DWI restriction",
    "Temporal lobe encephalitis",
    "Tumour / Other viral encephalitis",
    null
  ],
  [
    "Japanese Encephalitis",
    "Bilateral thalamic T2 hyperintensity\n± hemorrhage; substantia nigra involvement;\n'smiling' thalami",
    "Thalamic JE / Bilateral thalami",
    "Dengue encephalitis",
    null
  ],
  [
    "Progressive Multifocal\nLeukoencephalopathy (PML)",
    "Asymmetric white matter lesions;\nno enhancement (no BBB breakdown\nin early stage); JC virus",
    "JC virus — no enhancement",
    "Multiple sclerosis",
    null
  ],
  [
    "HIV Encephalopathy",
    "Diffuse brain atrophy;\nsymmetric periventricular white\nmatter hyperintensity; HIV dementia",
    "HIV dementia / Global atrophy",
    "Age-related white matter changes",
    null
  ],
  [
    "Multiple Sclerosis (MS)",
    "Periventricular plaques oriented\nperpendicular to ventricles;\nopen-ring enhancement (acute)",
    "Dawson fingers",
    "ADEM",
    "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_3d0039e2d8e703986fad6fecf7005e0f4d3d7ea2de9f8373ee7fbbf99064e6fd.jpg"
  ],
  [
    "Acute Disseminated\nEncephalomyelitis (ADEM)",
    "Diffuse bilateral white matter lesions;\ndeep gray matter involvement;\npost-infectious; children",
    "Post-infectious demyelination",
    "Multiple sclerosis",
    null
  ],
  [
    "Neuromyelitis Optica (NMO)",
    "Longitudinal extensive transverse\nmyelitis (≥3 segments); optic neuritis;\narea postrema involvement",
    "Longitudinal cord lesion",
    "Multiple sclerosis",
    null
  ],
  [
    "Metachromatic\nLeukodystrophy (MLD)",
    "Symmetric periventricular T2\nhyperintensity; tigroid / leopard\nskin pattern; spares U-fibres",
    "Tiger/Leopard-stripe pattern",
    "Krabbe disease",
    null
  ],
  [
    "Adrenoleukodystrophy (ALD)",
    "Posterior white matter involvement;\nsplenium → parieto-occipital;\nenhancement at active edge",
    "Posterior predominant leukodystrophy",
    "MS",
    null
  ],
  [
    "Canavan Disease",
    "Diffuse white matter T2 hyperintensity;\nU-fibres involved early;\nNAA peak on MRS (↑)",
    "Spongy degeneration of white matter",
    "Other leukodystrophies",
    null
  ],
  [
    "Alexander Disease",
    "Frontal predominant white matter\nchanges; periventricular rim;\ngarland enhancement",
    "Frontal leukodystrophy",
    "Tumour",
    null
  ],
  [
    "Marchiafava-Bignami Disease",
    "Corpus callosum body necrosis;\nT2 hyperintensity / DWI restriction;\nalcohol-related",
    "Alcohol-related corpus callosum necrosis",
    "Infarct",
    null
  ],
  [
    "Wernicke Encephalopathy",
    "Mammillary body enhancement;\nbilateral thalami & periaqueductal\ngray T2 hyperintensity",
    "Confusion + Ataxia + Ophthalmoplegia",
    "Alcohol withdrawal",
    null
  ],
  [
    "Osmotic Demyelination Syndrome\n(Central Pontine Myelinolysis)",
    "Central pontine T2 hyperintensity;\ntrident / bat-wing shape;\nfollows rapid Na+ correction",
    "Locked-in syndrome risk",
    "Pontine infarct",
    null
  ],
  [
    "Diffuse Axonal Injury (DAI)",
    "Multiple punctate hemorrhages\non SWI at gray-white junction,\nCC, brainstem; post-traumatic",
    "Shear injury",
    "Contusion",
    null
  ],
  [
    "Hypoxic-Ischemic\nEncephalopathy (HIE)",
    "Diffuse cortical + deep gray injury;\nwatershed infarcts; DWI restriction;\npseudo-normalization on ADC",
    "Watershed injury",
    "Infection",
    null
  ],
  [
    "Rasmussen Encephalitis",
    "Progressive unilateral hemisphere\natrophy; T2 hyperintensity; basal\nganglia involvement",
    "Unilateral hemisphere atrophy",
    "Tumour",
    null
  ],
  [
    "Autoimmune Limbic Encephalitis",
    "Mesial temporal T2/FLAIR\nhyperintensity; hippocampal swelling;\n± enhancement",
    "Limbic encephalitis — NMDAR/LGI1",
    "Herpes encephalitis",
    null
  ],
  [
    "Creutzfeldt-Jakob Disease (CJD)",
    "Cortical ribboning on DWI;\nbasal ganglia DWI restriction;\nhockey-stick sign (pulvinar + dorsal\nthalamus)",
    "Rapid progressive dementia",
    "Alzheimer disease",
    null
  ],
  [
    "Subacute Sclerosing\nPanencephalitis (SSPE)",
    "Diffuse white matter degeneration;\ncortical T2 hyperintensity;\nmeasles (paramyxovirus) complication",
    "Measles complication / SSPE",
    "ADEM",
    null
  ],
  [
    "CADASIL",
    "Anterior temporal lobe + external\ncapsule white matter hyperintensity;\nmigraine + strokes in young adults;\nNOTCH3 mutation",
    "Anterior temporal lobe involvement",
    "Small vessel disease",
    null
  ]
];

// ─── cover slide ─────────────────────────────────────────────────────────────
let pres = new pptxgen();
pres.layout = "LAYOUT_WIDE";
pres.author  = "Orris Neuroimaging";
pres.title   = "Neuroimaging Brain & CNS — Diagnostic Atlas";

function addCover(pres) {
  const sld = pres.addSlide();
  sld.addShape(pres.ShapeType.rect, {
    x: 0, y: 0, w: "100%", h: "100%",
    fill: { color: BG }
  });
  // accent bar top
  sld.addShape(pres.ShapeType.rect, {
    x: 0, y: 0, w: "100%", h: 0.08,
    fill: { color: ACCENT }
  });
  // accent bar bottom
  sld.addShape(pres.ShapeType.rect, {
    x: 0, y: 7.42, w: "100%", h: 0.08,
    fill: { color: ACCENT }
  });

  sld.addText("NEUROIMAGING", {
    x: 0.5, y: 1.4, w: 12.3, h: 1.1,
    fontSize: 64, bold: true, color: WHITE,
    fontFace: "Arial", charSpacing: 8, align: "center"
  });
  sld.addText("BRAIN & CNS DIAGNOSTIC ATLAS", {
    x: 0.5, y: 2.55, w: 12.3, h: 0.7,
    fontSize: 28, bold: false, color: ACCENT,
    fontFace: "Arial", charSpacing: 4, align: "center"
  });

  // divider line
  sld.addShape(pres.ShapeType.rect, {
    x: 3.5, y: 3.45, w: 6.3, h: 0.04,
    fill: { color: GOLD }
  });

  sld.addText("58 Pathologies  •  Key MRI Findings  •  Classic Signs  •  Differentials", {
    x: 0.5, y: 3.65, w: 12.3, h: 0.5,
    fontSize: 16, color: DIM, fontFace: "Arial", align: "center"
  });

  sld.addText("Congenital  |  Vascular  |  Neoplastic  |  Inflammatory  |  Infective  |  Metabolic  |  Traumatic", {
    x: 0.5, y: 4.3, w: 12.3, h: 0.45,
    fontSize: 14, color: DIM, fontFace: "Arial", align: "center", italic: true
  });

  sld.addText("Based on Grainger & Allison's Diagnostic Radiology and authoritative neuroimaging literature", {
    x: 0.5, y: 6.8, w: 12.3, h: 0.35,
    fontSize: 11, color: "4A5568", fontFace: "Arial", align: "center", italic: true
  });
}

// ─── category divider ─────────────────────────────────────────────────────────
function addDivider(pres, title, subtitle) {
  const sld = pres.addSlide();
  sld.addShape(pres.ShapeType.rect, {
    x: 0, y: 0, w: "100%", h: "100%",
    fill: { color: PANEL_BG }
  });
  sld.addShape(pres.ShapeType.rect, {
    x: 0, y: 0, w: 0.12, h: "100%",
    fill: { color: ACCENT }
  });
  sld.addText(title, {
    x: 0.8, y: 2.2, w: 11.7, h: 1.4,
    fontSize: 52, bold: true, color: WHITE, fontFace: "Arial"
  });
  sld.addText(subtitle, {
    x: 0.8, y: 3.7, w: 11.7, h: 0.6,
    fontSize: 20, color: GOLD, fontFace: "Arial"
  });
  sld.addShape(pres.ShapeType.rect, {
    x: 0.8, y: 3.5, w: 5, h: 0.04,
    fill: { color: GOLD }
  });
}

// ─── content slide (with or without image) ───────────────────────────────────
function addPathologySlide(pres, diagnosis, findings, buzzword, diff, imgBase64) {
  const sld = pres.addSlide();

  // background
  sld.addShape(pres.ShapeType.rect, {
    x: 0, y: 0, w: "100%", h: "100%",
    fill: { color: BG }
  });

  // left accent strip
  sld.addShape(pres.ShapeType.rect, {
    x: 0, y: 0, w: 0.06, h: "100%",
    fill: { color: ACCENT }
  });

  // title bar background
  sld.addShape(pres.ShapeType.rect, {
    x: 0.06, y: 0, w: "100%", h: 1.05,
    fill: { color: PANEL_BG }
  });

  // title text
  sld.addText(diagnosis, {
    x: 0.2, y: 0.0, w: 12.8, h: 1.05,
    fontSize: 26, bold: true, color: WHITE,
    fontFace: "Arial", valign: "middle", margin: 6
  });

  const hasImage = imgBase64 && !imgBase64.error;
  const textW = hasImage ? 6.8 : 12.8;
  const textX = 0.2;
  const imgX  = 7.3;
  const imgY  = 1.15;
  const imgW  = 5.5;
  const imgH  = 5.7;

  // ── FINDINGS panel ──
  sld.addShape(pres.ShapeType.rect, {
    x: textX - 0.05, y: 1.12, w: textW + 0.1, h: 1.9,
    fill: { color: "0D1B2A" }, line: { color: ACCENT, width: 1 }
  });
  sld.addText([
    { text: "KEY MRI FINDINGS", options: { bold: true, color: ACCENT, fontSize: 10, charSpacing: 2, breakLine: true } },
    { text: findings, options: { color: WHITE, fontSize: 14.5, breakLine: false } }
  ], {
    x: textX, y: 1.12, w: textW, h: 1.9,
    fontFace: "Arial", valign: "middle", margin: 10
  });

  // ── BUZZWORD panel ──
  sld.addShape(pres.ShapeType.rect, {
    x: textX - 0.05, y: 3.1, w: textW + 0.1, h: 1.5,
    fill: { color: "1A1100" }, line: { color: GOLD, width: 1 }
  });
  sld.addText([
    { text: "CLASSIC SIGN / BUZZWORD", options: { bold: true, color: GOLD, fontSize: 10, charSpacing: 2, breakLine: true } },
    { text: buzzword, options: { color: WHITE, fontSize: 15, bold: true, breakLine: false } }
  ], {
    x: textX, y: 3.1, w: textW, h: 1.5,
    fontFace: "Arial", valign: "middle", margin: 10
  });

  // ── DIFFERENTIAL panel ──
  sld.addShape(pres.ShapeType.rect, {
    x: textX - 0.05, y: 4.7, w: textW + 0.1, h: 1.05,
    fill: { color: "0D1A17" }, line: { color: "00B89C", width: 1 }
  });
  sld.addText([
    { text: "TOP DIFFERENTIAL", options: { bold: true, color: "00B89C", fontSize: 10, charSpacing: 2, breakLine: true } },
    { text: diff, options: { color: WHITE, fontSize: 14, breakLine: false } }
  ], {
    x: textX, y: 4.7, w: textW, h: 1.05,
    fontFace: "Arial", valign: "middle", margin: 10
  });

  // ── bottom bar ──
  sld.addShape(pres.ShapeType.rect, {
    x: 0, y: 7.3, w: "100%", h: 0.2,
    fill: { color: ACCENT }
  });
  sld.addText("Grainger & Allison's Diagnostic Radiology  |  Neuroimaging Atlas", {
    x: 0.2, y: 7.3, w: 12.8, h: 0.2,
    fontSize: 8, color: BG, fontFace: "Arial", bold: true, valign: "middle"
  });

  // ── image ──
  if (hasImage) {
    // image frame
    sld.addShape(pres.ShapeType.rect, {
      x: imgX - 0.08, y: imgY - 0.08, w: imgW + 0.16, h: imgH + 0.16,
      fill: { color: PANEL_BG }, line: { color: ACCENT, width: 1.5 }
    });
    sld.addImage({
      data: imgBase64,
      x: imgX, y: imgY, w: imgW, h: imgH,
      sizing: { type: "contain", w: imgW, h: imgH }
    });
  } else {
    // placeholder box
    sld.addShape(pres.ShapeType.rect, {
      x: imgX - 0.08, y: imgY - 0.08, w: imgW + 0.16, h: imgH + 0.16,
      fill: { color: PANEL_BG }, line: { color: "2D3748", width: 1 }
    });
    sld.addText("MRI\nIMAGE", {
      x: imgX, y: imgY + 1.8, w: imgW, h: 1.8,
      fontSize: 26, color: "2D3748", fontFace: "Arial",
      align: "center", valign: "middle", bold: true
    });
  }
}

// ─── category definitions ──────────────────────────────────────────────────────
const categories = [
  { title: "CONGENITAL & DEVELOPMENTAL",  subtitle: "Corpus Callosum  |  Posterior Fossa  |  Cortical Malformations  |  Neurocutaneous", range: [0, 10] },
  { title: "VASCULAR",                     subtitle: "Haemorrhage  |  Ischaemia  |  Venous  |  Malformations",                           range: [11, 19] },
  { title: "NEOPLASTIC",                   subtitle: "Gliomas  |  Meningioma  |  Lymphoma  |  Pituitary  |  Posterior Fossa Tumours",    range: [20, 32] },
  { title: "INFECTIVE & INFLAMMATORY",     subtitle: "Abscess  |  Granuloma  |  Encephalitis  |  Parasites",                             range: [33, 39] },
  { title: "DEMYELINATING",                subtitle: "MS  |  ADEM  |  NMO  |  Leukodystrophies",                                         range: [40, 47] },
  { title: "TOXIC / METABOLIC /\nTRAUMATIC", subtitle: "Alcohol  |  Metabolic  |  Traumatic  |  Hypoxic",                               range: [48, 57] },
];

// ─── build presentation ───────────────────────────────────────────────────────
addCover(pres);

// collect all image URLs that need fetching
const urlsNeeded = slides.map(s => s[4]).filter(Boolean);
console.log(`Fetching ${urlsNeeded.length} images...`);
const fetched = fetchImages(urlsNeeded);
const imgMap = {};
urlsNeeded.forEach((url, i) => {
  imgMap[url] = fetched[i] && !fetched[i].error ? fetched[i].base64 : null;
});
console.log("Images fetched. Building slides...");

let slideIdx = 0;
categories.forEach(cat => {
  addDivider(pres, cat.title, cat.subtitle);
  const [start, end] = cat.range;
  for (let i = start; i <= end; i++) {
    const [diag, findings, buzz, diff, imgUrl] = slides[i];
    const imgData = imgUrl ? imgMap[imgUrl] : null;
    addPathologySlide(pres, diag, findings, buzz, diff, imgData);
    slideIdx++;
    if (slideIdx % 10 === 0) console.log(`  → Slide ${slideIdx}/58 done`);
  }
});

// ─── summary / index slide ────────────────────────────────────────────────────
function addIndex(pres) {
  const sld = pres.addSlide();
  sld.addShape(pres.ShapeType.rect, {
    x: 0, y: 0, w: "100%", h: "100%",
    fill: { color: BG }
  });
  sld.addShape(pres.ShapeType.rect, {
    x: 0, y: 0, w: "100%", h: 0.08,
    fill: { color: ACCENT }
  });
  sld.addText("PATHOLOGY INDEX", {
    x: 0.4, y: 0.2, w: 12.5, h: 0.7,
    fontSize: 30, bold: true, color: WHITE, fontFace: "Arial", charSpacing: 4
  });
  sld.addShape(pres.ShapeType.rect, {
    x: 0.4, y: 0.95, w: 12.5, h: 0.04,
    fill: { color: ACCENT }
  });

  const names = slides.map(s => s[0].replace(/\n/g, " "));
  // 3 columns
  const col = Math.ceil(names.length / 3);
  for (let c = 0; c < 3; c++) {
    const chunk = names.slice(c * col, (c + 1) * col);
    const bullets = chunk.map((n, idx) => ({
      text: `${c * col + idx + 1}. ${n}`,
      options: { bullet: false, breakLine: true, color: WHITE, fontSize: 10 }
    }));
    sld.addText(bullets, {
      x: 0.3 + c * 4.3, y: 1.1, w: 4.2, h: 6.2,
      fontFace: "Arial", valign: "top", margin: 4
    });
  }
}

addIndex(pres);

const outPath = "/home/daytona/workspace/neuroimaging-brain-ppt/Neuroimaging_Brain_CNS_Atlas.pptx";
pres.writeFile({ fileName: outPath }).then(() => {
  console.log("DONE: " + outPath);
}).catch(err => {
  console.error("Error writing file:", err);
  process.exit(1);
});
Running Command

cd /home/daytona/workspace/neuroimaging-brain-ppt && node generate.js 2>&1

Running Command

ls -lh /home/daytona/workspace/neuroimaging-brain-ppt/Neuroimaging_Brain_CNS_Atlas.pptx

Your presentation is ready — 1.5 MB, built with dark navy + cyan design.

Neuroimaging Brain CNS Atlas

Presentation · PPTX


What's inside (67 total slides)

SectionSlides
Cover1 branded title slide
6 Category DividersCongenital / Vascular / Neoplastic / Infective / Demyelinating / Metabolic-Traumatic
58 Pathology SlidesOne per diagnosis
Full Index SlideAll 58 numbered, 3-column layout

Each pathology slide contains

  • Diagnosis title (large, bold)
  • Key MRI Findings — cyan panel with all critical imaging features
  • Classic Exam Buzzword/Sign — gold panel (racing-car ventricles, butterfly glioma, Dawson fingers, etc.)
  • Top Differential — green panel

Real MRI images embedded (from peer-reviewed literature)

SlideImage
Agenesis of Corpus CallosumSagittal T1/T2 + axial FLAIR — colpocephaly, parallel ventricles
Chiari ISagittal T1 — peg tonsils below foramen magnum
Dandy-WalkerSagittal T2 — enlarged posterior fossa cyst
HoloprosencephalyAxial T2 — monoventricle, fused thalami
LissencephalyAxial T2 — smooth brain, thick cortex
Tuberous SclerosisAxial T2 + GRE — subependymal nodules + cortical tubers
GlioblastomaAxial Gd-T1 — butterfly pattern crossing corpus callosum
Ischemic StrokeDWI + ADC — posterior circulation restriction
Multiple SclerosisSagittal FLAIR — Dawson fingers perpendicular to ventricles
MedulloblastomaSagittal T1 Gd + axial T2 — midline posterior fossa mass
Slides without a matched image display a styled placeholder box — you can paste in your own MRI images from PowerPoint at any time.
This is a shared conversation. Sign in to Orris to start your own chat.