Give me differential diagnosis for tuberculoma
tuberculoma differential diagnosis intracranial
| Condition | Key Distinguishing Features |
|---|---|
| Neurocysticercosis | Most common mimic in endemic areas; thin-walled cystic lesion, scolex visible on MRI ("hole-with-dot" sign); serology positive |
| Toxoplasma encephalitis | Especially in HIV (CD4 <100); multiple ring-enhancing lesions; responds rapidly to empirical pyrimethamine-sulfadiazine; Toxoplasma IgG positive |
| Pyogenic brain abscess | Usually single thick-walled ring-enhancing lesion; restricted diffusion on DWI (bright); fever + systemic sepsis; often from contiguous ear/sinus source or hematogenous spread |
| Tuberculous abscess | Rare; larger than tuberculoma, thinner enhancing rim (lobulated); restricted diffusion in non-enhancing core, similar to pyogenic abscess |
| Fungal granuloma (Cryptococcus, Aspergillus, Histoplasma, Candida) | Immunocompromised host; cryptococcal lesions often cause meningitis; may have gelatinous pseudocysts |
| Amoebic abscess (Entamoeba histolytica) | Rare; hepatic abscess usually coexistent |
| Hydatid cyst (Echinococcus) | Large, smooth, unilocular cyst; no perilesional edema; endemic area |
| Cerebral malaria | Multiple petechial/hemorrhagic foci; travel history; positive blood smear |
| Condition | Key Distinguishing Features |
|---|---|
| High-grade glioma (GBM) | Irregular ring enhancement; marked mass effect; vasogenic edema; heterogeneous; elevated MRS Cho:NAA ratio |
| Low-grade glioma | Non-enhancing; diffuse T2 signal; usually in white matter |
| Metastatic carcinoma | Multiple lesions at grey-white junction; known primary; marked surrounding edema; enhancing nodule or ring |
| Primary CNS lymphoma (PCNSL) | Periventricular location; hyperdense on CT; homogeneous enhancement; associated with HIV (CD4 <50); solitary lesion often >4 cm; EBV PCR positive in CSF |
| Meningioma | Dural-based; uniformly enhancing; "dural tail"; no surrounding edema unless large |
| Medulloblastoma/ependymoma | Children; posterior fossa midline location |
| Condition | Key Distinguishing Features |
|---|---|
| Tumefactive MS | Young adults; "open-ring" enhancement (incomplete ring, open toward grey matter); juxtacortical/periventricular; CSF oligoclonal bands |
| Neurosarcoidosis | Leptomeningeal and parenchymal lesions; predilection for basal meninges; systemic sarcoid (hilar adenopathy, elevated ACE); responds to steroids |
| Vasculitis (CNS) | Multiple infarct-like lesions; angiography abnormal; CSF inflammatory |
| ADEM | Post-infectious; multifocal white matter; bilateral; often in children |
| Condition | Key Distinguishing Features |
|---|---|
| Cavernous malformation | "Popcorn" appearance on MRI; hemosiderin rim (dark on GRE/SWI); no enhancement; no edema |
| Hemorrhagic infarct | DWI bright (restricted); vascular territory; evolving signal changes |
| AVM / aneurysm | Flow voids; vascular blush on angiography |
| Setting | Top Differentials |
|---|---|
| HIV patient | Toxoplasma, PCNSL, PML, CMV encephalitis, cryptococcal abscess |
| Immunocompetent patient in TB-endemic region | Neurocysticercosis, pyogenic abscess, glioma, metastasis |
| Child in tropical region | Neurocysticercosis, tuberculoma itself, medulloblastoma (cerebellar) |
| Developed country | CNS lymphoma, metastasis, high-grade glioma |
Create a visual comparison chart: tuberculoma vs neurocysticercosis vs brain abscess
ls -la /home/daytona/workspace/ 2>/dev/null || echo "workspace empty or not found"
mkdir -p /home/daytona/workspace/neuro-comparison
~/neuro-comparison/chart.js
const pptxgen = require("pptxgenjs");
const pres = new pptxgen();
pres.layout = "LAYOUT_WIDE"; // 13.3" x 7.5"
// ─── COLOUR PALETTE ───────────────────────────────────────────────
const BG = "0D1B2A"; // deep navy (dominant)
const PANEL = "12263A"; // slightly lighter navy panel
const ACCENT1 = "00C2CB"; // teal – tuberculoma
const ACCENT2 = "F4A832"; // amber – neurocysticercosis
const ACCENT3 = "E84855"; // coral-red – brain abscess
const WHITE = "FFFFFF";
const GREY = "8FA3B1";
const DIVIDER = "1E3A52";
// ─── HELPER ───────────────────────────────────────────────────────
function colCard(slide, x, w, color) {
slide.addShape(pres.ShapeType.rect, {
x, y: 0.78, w, h: 6.45,
fill: { color: PANEL },
line: { color: color, width: 2.5 }
});
}
function hdrBar(slide, x, w, color, emoji, title, subtitle) {
slide.addShape(pres.ShapeType.rect, {
x, y: 0.78, w, h: 0.88,
fill: { color: color }, line: { color: color, width: 0 }
});
slide.addText([
{ text: emoji + " " + title, options: { bold: true, fontSize: 14, color: WHITE, breakLine: true } },
{ text: subtitle, options: { fontSize: 9.5, color: WHITE, italic: true } }
], { x: x + 0.12, y: 0.82, w: w - 0.24, h: 0.80, valign: "middle", margin: 0 });
}
function rowLabel(slide, y, label) {
slide.addShape(pres.ShapeType.rect, {
x: 0.18, y, w: 2.6, h: 0.56,
fill: { color: DIVIDER }, line: { color: DIVIDER, width: 0 },
rounding: 0.08
});
slide.addText(label, {
x: 0.22, y: y + 0.04, w: 2.52, h: 0.48,
fontSize: 9, bold: true, color: ACCENT1, valign: "middle", margin: 0, charSpacing: 1
});
}
function cell(slide, x, y, w, lines, color) {
// Thin left accent bar
slide.addShape(pres.ShapeType.rect, {
x: x + 0.10, y: y + 0.04, w: 0.04, h: 0.46,
fill: { color }, line: { color, width: 0 }
});
const richLines = lines.map((l, i) => ({
text: l,
options: { breakLine: i < lines.length - 1 ? true : false }
}));
slide.addText(richLines, {
x: x + 0.22, y: y + 0.03, w: w - 0.32, h: 0.52,
fontSize: 8.8, color: WHITE, valign: "middle", margin: 0
});
}
// ════════════════════════════════════════════════════════════════
// SLIDE 1 – MASTER COMPARISON TABLE
// ════════════════════════════════════════════════════════════════
const s1 = pres.addSlide();
s1.background = { color: BG };
// Title bar
s1.addShape(pres.ShapeType.rect, {
x: 0, y: 0, w: 13.3, h: 0.78, fill: { color: "091420" }, line: { color: "091420", width: 0 }
});
s1.addText("NEURO-INFECTIOUS MASS LESIONS | Visual Comparison Chart", {
x: 0.3, y: 0.04, w: 10, h: 0.68, fontSize: 15, bold: true, color: WHITE, valign: "middle", margin: 0
});
s1.addText("Tuberculoma • Neurocysticercosis • Brain Abscess", {
x: 0.3, y: 0.42, w: 13, h: 0.34, fontSize: 9, color: GREY, valign: "middle", margin: 0
});
// Column widths: row labels 2.78 | col1 3.38 | col2 3.38 | col3 3.38 | margins
const COL = [2.96, 6.34, 9.72];
const CW = 3.22;
// Column cards + headers
colCard(s1, COL[0], CW, ACCENT1);
colCard(s1, COL[1], CW, ACCENT2);
colCard(s1, COL[2], CW, ACCENT3);
hdrBar(s1, COL[0], CW, ACCENT1, "🟦", "TUBERCULOMA", "M. tuberculosis granuloma");
hdrBar(s1, COL[1], CW, ACCENT2, "🟨", "NEUROCYSTICERCOSIS", "Taenia solium larvae");
hdrBar(s1, COL[2], CW, ACCENT3, "🟥", "PYOGENIC BRAIN ABSCESS","Bacterial / polymicrobial");
// Row definitions [y-position, label, [tb data], [ncc data], [ba data]]
const ROWS = [
[1.72, "CAUSATIVE AGENT",
["M. tuberculosis"],
["Taenia solium (larval cyst)"],
["Streptococcus, Staph,", "Gram-negatives (polymicrobial)"]
],
[2.34, "EPIDEMIOLOGY",
["TB-endemic regions;", "immunocompromised"],
["Rural developing world;", "pork-eating populations"],
["Any; post-surgery, dental,", "ear/sinus source, IV drug use"]
],
[2.96, "LOCATION",
["Grey-white junction;", "any lobe; posterior fossa kids"],
["Grey-white junction,", "subarachnoid / ventricular"],
["Frontal / temporal lobes;", "often near cortex"]
],
[3.58, "NUMBER",
["Single or multiple"],
["Often multiple (all stages)"],
["Usually solitary; can be multiple"]
],
[4.20, "CT APPEARANCE",
["Iso/hypo-dense; rim or solid", "enhancement; target sign*"],
["Cyst ± scolex (dense dot);", "wall calcification late stage"],
["Hypodense centre; thick", "irregular ring enhancement"]
],
[4.82, "MRI SIGNATURE",
["T2 LOW in caseating stage", "(diagnostic clue); DWI variable"],
["T2 bright cyst fluid;", "scolex = eccentric T1 bright dot"],
["T2 bright centre; DWI", "BRIGHT (restricted diffusion)"]
],
[5.44, "KEY DIAGNOSTICS",
["TST/IGRA; chest X-ray;", "CSF AFB/PCR; biopsy"],
["Serology (ELISA/EITB);", "scolex on MRI; stool O&P"],
["Blood cultures; CSF culture;", "Gram stain of aspirate"]
],
[6.05, "TREATMENT",
["HRZE × 2 mo → HR × 7-10 mo;", "steroids if cerebral oedema"],
["Albendazole + praziquantel;", "anti-epileptics; steroids"],
["Surgical drainage / aspiration;", "IV antibiotics 4-8 weeks"]
],
];
ROWS.forEach(([y, label, tb, ncc, ba]) => {
rowLabel(s1, y, label);
cell(s1, COL[0], y, CW, tb, ACCENT1);
cell(s1, COL[1], y, CW, ncc, ACCENT2);
cell(s1, COL[2], y, CW, ba, ACCENT3);
});
// Footer note
s1.addText("* Target sign (central calcification + rim enhancement) seen in tuberculoma and cysticercosis — not pathognomonic for either | DWI = diffusion-weighted imaging | HRZE = isoniazid-rifampin-pyrazinamide-ethambutol", {
x: 0.18, y: 7.18, w: 12.94, h: 0.28, fontSize: 6.5, color: GREY, valign: "middle", margin: 0
});
// ════════════════════════════════════════════════════════════════
// SLIDE 2 – DWI / MRI SIGNAL QUICK-REFERENCE CARD
// ════════════════════════════════════════════════════════════════
const s2 = pres.addSlide();
s2.background = { color: BG };
s2.addShape(pres.ShapeType.rect, {
x: 0, y: 0, w: 13.3, h: 0.78, fill: { color: "091420" }, line: { color: "091420", width: 0 }
});
s2.addText("MRI SIGNAL PATTERN | At-a-Glance Differentiator", {
x: 0.3, y: 0.12, w: 12, h: 0.55, fontSize: 15, bold: true, color: WHITE, valign: "middle", margin: 0
});
// Signal grid helper
function sigBox(slide, x, y, w, h, fillColor, labelColor, label, detail) {
slide.addShape(pres.ShapeType.roundRect, {
x, y, w, h, rectRadius: 0.12,
fill: { color: fillColor }, line: { color: fillColor, width: 0 }
});
slide.addText([
{ text: label, options: { bold: true, fontSize: 11, color: labelColor, breakLine: true } },
{ text: detail, options: { fontSize: 8.5, color: labelColor } }
], { x: x + 0.12, y, w: w - 0.24, h, valign: "middle", margin: 0 });
}
const sequences = [
{ seq: "T1 WI", tb: ["Iso/hypo-intense", "rim may enhance"], tbc: "1E3A52", ncc: ["Hypo-intense (cyst)", "Bright scolex dot"], nccc: "1E4A2A", ba: ["Hypo-intense centre", "Enhancing thick rim"], bac: "3A1E24" },
{ seq: "T2 WI", tb: ["LOW signal", "(caseation – key clue)"], tbc: "103A4A", ncc: ["HIGH signal (cyst fluid)", "Hypo scolex"], nccc: "1E4A2A", ba: ["HIGH signal centre", "Surrounding oedema"], bac: "3A1E24" },
{ seq: "DWI", tb: ["Variable", "(elevated or restricted)"], tbc: "1E3A52", ncc: ["Variable;", "cyst usually bright"], nccc: "1E4A2A", ba: ["BRIGHT (restricted)", "Pus = high viscosity"], bac: "5A1E28" },
{ seq: "T1+Gad", tb: ["Rim OR solid", "enhancement"], tbc: "1E3A52", ncc: ["Ring or nodular;", "scolex may enhance"], nccc: "1E4A2A", ba: ["THICK irregular ring", "enhancement"], bac: "3A1E24" },
{ seq: "MRS", tb: ["↑ Lipid/lactate", "No Cho:NAA shift"], tbc: "1E3A52", ncc: ["Succinate peak", "(anaerobic glycolysis)"], nccc: "1E4A2A", ba: ["↑ Acetate, succinate", "↑ Amino acids"], bac: "3A1E24" },
];
// Column headers
[["TUBERCULOMA", ACCENT1], ["NEUROCYSTICERCOSIS", ACCENT2], ["BRAIN ABSCESS", ACCENT3]].forEach(([label, col], i) => {
const x = 3.5 + i * 3.2;
s2.addShape(pres.ShapeType.rect, { x, y: 0.82, w: 3.1, h: 0.44, fill: { color: col }, line: { color: col, width: 0 } });
s2.addText(label, { x, y: 0.82, w: 3.1, h: 0.44, fontSize: 9, bold: true, color: WHITE, align: "center", valign: "middle", margin: 0 });
});
sequences.forEach((row, ri) => {
const rowY = 1.32 + ri * 1.12;
// Sequence label
s2.addShape(pres.ShapeType.rect, { x: 0.18, y: rowY, w: 3.22, h: 1.0, fill: { color: DIVIDER }, line: { color: DIVIDER, width: 0 }, rounding: 0.1 });
s2.addText(row.seq, { x: 0.18, y: rowY, w: 3.22, h: 1.0, fontSize: 12, bold: true, color: WHITE, align: "center", valign: "middle", margin: 0 });
// TB cell
sigBox(s2, 3.50, rowY, 3.1, 1.0, row.tbc, ACCENT1, row.tb[0], row.tb[1]);
// NCC cell
sigBox(s2, 6.70, rowY, 3.1, 1.0, row.nccc, ACCENT2, row.ncc[0], row.ncc[1]);
// BA cell
sigBox(s2, 9.90, rowY, 3.1, 1.0, row.bac, ACCENT3, row.ba[0], row.ba[1]);
});
s2.addText("MRS = Magnetic Resonance Spectroscopy | Gad = Gadolinium contrast | DWI restricted diffusion (bright) = high cellularity / viscosity", {
x: 0.18, y: 7.18, w: 12.94, h: 0.28, fontSize: 6.5, color: GREY, valign: "middle", margin: 0
});
// ════════════════════════════════════════════════════════════════
// SLIDE 3 – CLINICAL DECISION ALGORITHM
// ════════════════════════════════════════════════════════════════
const s3 = pres.addSlide();
s3.background = { color: BG };
s3.addShape(pres.ShapeType.rect, {
x: 0, y: 0, w: 13.3, h: 0.78, fill: { color: "091420" }, line: { color: "091420", width: 0 }
});
s3.addText("CLINICAL DECISION FRAMEWORK | Ring-Enhancing Lesion Workup", {
x: 0.3, y: 0.12, w: 12, h: 0.55, fontSize: 15, bold: true, color: WHITE, valign: "middle", margin: 0
});
// Decision boxes helper
function dBox(slide, x, y, w, h, fillColor, lineColor, text, textColor, fontSize) {
slide.addShape(pres.ShapeType.roundRect, {
x, y, w, h, rectRadius: 0.14,
fill: { color: fillColor }, line: { color: lineColor, width: 1.5 }
});
slide.addText(text, {
x: x + 0.08, y, w: w - 0.16, h, fontSize: fontSize || 9, color: textColor || WHITE,
align: "center", valign: "middle", margin: 0, bold: false
});
}
function arrow(slide, x1, y1, x2, y2, color) {
slide.addShape(pres.ShapeType.line, {
x: x1, y: y1, w: x2 - x1, h: y2 - y1,
line: { color: color || GREY, width: 1.5, endArrowType: "arrow" }
});
}
// Start node
dBox(s3, 4.9, 0.90, 3.5, 0.62, "1A2E42", ACCENT1, "Ring/nodular enhancing brain\nlesion on CT/MRI", WHITE, 9.5);
// 3 branches
const branches = [
{ x: 0.6, color: ACCENT1, title: "DWI BRIGHT\n+ Fever + Leukocytosis", dx: 1.0, dw: 2.5, dh: 0.72,
items: ["Blood cultures (3 sets)", "CT chest/abdomen", "Ear / dental exam", "MRS: ↑ acetate/succinate", "→ BRAIN ABSCESS"] },
{ x: 4.9, color: ACCENT2, title: "SCOLEX visible\n+ Pork exposure + Seizures", dx: 4.9, dw: 3.5, dh: 0.72,
items: ["Serology: EITB/ELISA", "Stool O&P", "MRS: succinate peak", "All-stage cysts on MRI", "→ NEUROCYSTICERCOSIS"] },
{ x: 9.2, color: ACCENT1, title: "T2 LOW signal\n+ TB history + Caseation", dx: 9.2, dw: 3.5, dh: 0.72,
items: ["TST / IGRA", "Chest X-ray / CT", "CSF AFB PCR", "Sputum culture", "→ TUBERCULOMA"] },
];
// branch connectors
arrow(s3, 6.65, 1.52, 1.85, 2.08, GREY);
arrow(s3, 6.65, 1.52, 6.65, 2.08, GREY);
arrow(s3, 6.65, 1.52, 10.95, 2.08, GREY);
branches.forEach((b, i) => {
dBox(s3, b.dx, 2.08, b.dw, b.dh, "1E3A52", b.color, b.title, WHITE, 9);
b.items.forEach((item, ii) => {
const yy = 2.92 + ii * 0.60;
const isFinal = item.startsWith("→");
s3.addShape(pres.ShapeType.rect, {
x: b.dx + 0.04, y: yy, w: b.dw - 0.08, h: 0.54,
fill: { color: isFinal ? b.color : "162B3E" },
line: { color: isFinal ? b.color : DIVIDER, width: isFinal ? 0 : 0.5 }
});
s3.addText(item, {
x: b.dx + 0.12, y: yy, w: b.dw - 0.2, h: 0.54,
fontSize: isFinal ? 9.5 : 8.5, bold: isFinal, color: WHITE,
align: "left", valign: "middle", margin: 0
});
});
});
// HIV patient note
s3.addShape(pres.ShapeType.roundRect, {
x: 0.18, y: 6.45, w: 12.94, h: 0.72, rectRadius: 0.1,
fill: { color: "1A1A2E" }, line: { color: "7B5EA7", width: 1.5 }
});
s3.addText("⚠ HIV PATIENT (CD4 < 100): Empirically treat Toxoplasma first (pyrimethamine + sulfadiazine × 2 wks) → repeat MRI. If no response → biopsy. Also consider PCNSL (EBV PCR in CSF), CMV encephalitis, PML (JC virus PCR).", {
x: 0.30, y: 6.50, w: 12.70, h: 0.62, fontSize: 8.5, color: "C9B8E8", valign: "middle", margin: 0
});
// ════════════════════════════════════════════════════════════════
// Save
// ════════════════════════════════════════════════════════════════
pres.writeFile({ fileName: "/home/daytona/workspace/neuro-comparison/Tuberculoma_vs_NCC_vs_BrainAbscess.pptx" })
.then(() => console.log("DONE"))
.catch(e => console.error(e));
cd /home/daytona/workspace/neuro-comparison && node chart.js
ls -lh /home/daytona/workspace/neuro-comparison/
Tuberculoma vs NCC vs BrainAbscess
Presentation · PPTX
There are multiple lesions with ring enhancement with surrounding edema
| Question | Points Toward |
|---|---|
| Known primary malignancy? | Metastases |
| HIV/CD4 <100? | Toxoplasma first, then PCNSL |
| TB-endemic area / TB contact? | Tuberculomas |
| Fever + murmur + IV drug use? | Septic emboli (endocarditis) |
| Seizures in young person + pork exposure? | Neurocysticercosis |
| Scolex on MRI (bright dot in cyst)? | NCC - pathognomonic |
| T2 hypointense lesion? | Tuberculoma (caseation) |
| DWI bright core? | Pyogenic abscess |
| Periventricular, open ring? | Demyelination |
| Subcortical in South American HIV patient? | Chagas reactivation |
There is open ring enhancement, give me all about that


| Condition | Details |
|---|---|
| Multiple Sclerosis (MS) - acute plaque | Classic cause; open ring is more typical of MS than any other entity; enhancement lasts days to weeks; may evolve from nodular → ring over time |
| Tumefactive MS | Large (>2 cm) solitary lesion; mimics tumor/abscess; open ring with arc facing grey matter; relative paucity of mass effect for lesion size; DWI shows peripheral restriction |
| Marburg variant MS | Fulminant; multiple large bilateral lesions, all may enhance simultaneously; poor prognosis |
| Baló concentric sclerosis | Alternating concentric bands of enhancement/non-enhancement; "onion-ring" or whorled appearance on T2 |
| ADEM | Post-infectious; open ring or patchy "cloud-like" enhancement; lesions usually larger, poorly marginated, subcortical; more common in children |
| NMO Spectrum Disorder | Less likely to show open ring; spinal cord lesions span >3 segments; AQP4-IgG positive |
| Feature | Finding |
|---|---|
| Shape of gap | Open side faces cortical/subcortical grey matter (not random) |
| T2/FLAIR | Bright; lesion larger than the enhancing component |
| T1 (unenhanced) | Iso or hypointense; "black hole" = irreversible axonal loss |
| DWI | Peripheral restriction (bright rim on DWI, dark ADC at lesion periphery) - characteristic of tumefactive demyelination |
| Mass effect | Disproportionately minor for lesion size (vs. tumor or abscess which have marked mass effect) |
| Enhancement duration | Days to weeks; resolves; rarely >2-3 months |
| Steroid response | Enhancement rapidly suppressed |
| MRS | ↓ NAA (neuronal loss), ↑ Cho, ↑ Lac/lipids; ↑ Glutamine/glutamate favors demyelination over tumor; ↑ Myo-inositol + high Cho favors tumor |
| Perfusion (rCBV) | Normal or mildly elevated - key differentiator from GBM (GBM has markedly elevated rCBV due to neoangiogenesis) |
| Feature | Open Ring (Demyelination) | Closed Ring (Tumor/Abscess) |
|---|---|---|
| Ring completeness | Incomplete; gap toward grey matter | Complete, smooth or irregular |
| Mass effect | Mild, disproportionate | Significant |
| DWI | Peripheral restriction | Central restriction (abscess) or variable (tumor) |
| rCBV perfusion | Normal/mildly elevated | Markedly elevated (GBM) |
| Enhancement duration | Weeks, steroid-responsive | Persistent unless treated surgically |
| Surrounding edema | Mild to moderate | Often marked |
| Other lesions | Periventricular, Dawson's fingers, corpus callosum | Solitary or at grey-white junction |