For pediatric radiology meet Here is a full details of the girl First time evaluation and course in our hospital Help me to write a presentation
cd "/home/daytona/workspace/attachments/aa8bf790-eb1b-4015-b424-0f31b4fbf286" && python3 -c " import pdfplumber with pdfplumber.open('1000441985 (1)_merged.pdf') as pdf: print(f'Total pages: {len(pdf.pages)}') for i, page in enumerate(pdf.pages): print(f'\n=== PAGE {i+1} ===') text = page.extract_text() if text: print(text) else: print('[No text extracted - possibly image/scan]') " 2>&1 | head -400
cd "/home/daytona/workspace/attachments/aa8bf790-eb1b-4015-b424-0f31b4fbf286" && python3 -c " import fitz # PyMuPDF import os pdf_path = '1000441985 (1)_merged.pdf' output_dir = '/home/daytona/workspace/radiology_images' os.makedirs(output_dir, exist_ok=True) doc = fitz.open(pdf_path) print(f'Total pages: {len(doc.pages)}') # Extract images from pages 10-29 for page_num in range(9, len(doc)): # 0-indexed page = doc[page_num] mat = fitz.Matrix(2, 2) # 2x zoom for better quality pix = page.get_pixmap(matrix=mat) img_path = f'{output_dir}/page_{page_num+1}.png' pix.save(img_path) print(f'Saved page {page_num+1} to {img_path}') print('Done extracting images') " 2>&1
cd "/home/daytona/workspace/attachments/aa8bf790-eb1b-4015-b424-0f31b4fbf286" && python3 -c " import subprocess, os output_dir = '/home/daytona/workspace/radiology_images' os.makedirs(output_dir, exist_ok=True) # Use pdftoppm to convert pages 10-29 to images result = subprocess.run(['pdftoppm', '-r', '150', '-png', '-f', '10', '-l', '29', '1000441985 (1)_merged.pdf', f'{output_dir}/page'], capture_output=True, text=True) print('stdout:', result.stdout) print('stderr:', result.stderr) print('returncode:', result.returncode) import os files = sorted(os.listdir(output_dir)) print('Files created:', files) " 2>&1
cd /home/daytona/workspace/radiology_images && python3 -m http.server 8765 & sleep 2 echo "Server started" # Check it's running curl -s -o /dev/null -w "%{http_code}" http://localhost:8765/page-10.png
python3 -m http.server 8765 --directory /home/daytona/workspace/radiology_images > /tmp/httpserver.log 2>&1 & echo $! sleep 1 echo "done"
python3 -c "import pytesseract; from PIL import Image; img = Image.open('/home/daytona/workspace/radiology_images/page-10.png'); text = pytesseract.image_to_string(img); print(text[:3000])" 2>&1
mkdir -p /home/daytona/workspace/radiology-ppt && ls /home/daytona/workspace/radiology-ppt
~/radiology-ppt/create_pptx.js
const pptxgen = require("pptxgenjs");
const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Disseminated TB with Multiple Tuberculoma - Pediatric Radiology Case";
pres.author = "Department of Paediatrics";
// ─── COLOR PALETTE ───────────────────────────────────────────────
const C = {
navy: "1A2744", // dominant dark navy
teal: "1D7874", // accent teal
amber: "E8A838", // highlight amber
white: "FFFFFF",
lightBg: "F0F4F8", // light slide background
slate: "334155", // body text
muted: "94A3B8", // muted/caption text
red: "DC2626", // alert/abnormal
green: "16A34A", // normal
};
// ─── HELPER: add a section header bar ────────────────────────────
function addSlideHeader(slide, title, subtitle = "") {
// Top bar
slide.addShape(pres.ShapeType.rect, {
x: 0, y: 0, w: 10, h: 0.85,
fill: { color: C.navy },
line: { color: C.navy },
});
slide.addText(title, {
x: 0.2, y: 0, w: 9.6, h: 0.85,
fontSize: 22, bold: true, color: C.white, valign: "middle", margin: 0,
});
if (subtitle) {
slide.addText(subtitle, {
x: 0.2, y: 0.85, w: 9.6, h: 0.35,
fontSize: 11, color: C.teal, italic: true, margin: 0,
});
}
// Accent bar
slide.addShape(pres.ShapeType.rect, {
x: 0, y: 0.85, w: 10, h: 0.06,
fill: { color: C.teal },
line: { color: C.teal },
});
}
function addFooter(slide, text = "Pediatric Radiology Meet | Department of Paediatrics") {
slide.addShape(pres.ShapeType.rect, {
x: 0, y: 5.45, w: 10, h: 0.175,
fill: { color: C.navy },
line: { color: C.navy },
});
slide.addText(text, {
x: 0.2, y: 5.45, w: 9.6, h: 0.175,
fontSize: 9, color: C.muted, valign: "middle", margin: 0,
});
}
// ─────────────────────────────────────────────────────────────────
// SLIDE 1 - TITLE SLIDE
// ─────────────────────────────────────────────────────────────────
{
const s = pres.addSlide();
// Full background
s.addShape(pres.ShapeType.rect, {
x: 0, y: 0, w: 10, h: 5.625,
fill: { color: C.navy }, line: { color: C.navy },
});
// Accent stripe
s.addShape(pres.ShapeType.rect, {
x: 0, y: 2.9, w: 10, h: 0.08,
fill: { color: C.teal }, line: { color: C.teal },
});
s.addText("PEDIATRIC RADIOLOGY MEET", {
x: 0.5, y: 0.5, w: 9, h: 0.5,
fontSize: 13, bold: true, color: C.amber, align: "center", charSpacing: 4,
});
s.addText([
{ text: "Disseminated Tuberculosis\n", options: { bold: true, fontSize: 32 } },
{ text: "with Multiple Tuberculoma", options: { bold: true, fontSize: 32 } },
], {
x: 0.5, y: 1.1, w: 9, h: 1.5,
align: "center", color: C.white, valign: "middle",
});
s.addText("? Middle Ear TB | ? Pulmonary TB | TB Meningitis Stage 2", {
x: 0.5, y: 2.65, w: 9, h: 0.35,
fontSize: 13, color: C.teal, align: "center", italic: true,
});
s.addText([
{ text: "16-Year-Old Female | First Evaluation & Inpatient Course\n", options: { fontSize: 13 } },
{ text: "Admitted: 30 June 2026 Discharged: 09 July 2026", options: { fontSize: 12, color: C.muted } },
], {
x: 0.5, y: 3.1, w: 9, h: 0.9,
align: "center", color: C.white,
});
s.addText("Department of Paediatrics", {
x: 0.5, y: 4.4, w: 9, h: 0.4,
fontSize: 11, color: C.muted, align: "center",
});
s.addText("IP No: 26012063 | OP No: 25048958", {
x: 0.5, y: 4.9, w: 9, h: 0.3,
fontSize: 10, color: C.muted, align: "center",
});
}
// ─────────────────────────────────────────────────────────────────
// SLIDE 2 - PATIENT PROFILE & CHIEF COMPLAINTS
// ─────────────────────────────────────────────────────────────────
{
const s = pres.addSlide();
s.background = { color: C.lightBg };
addSlideHeader(s, "Patient Profile & Chief Complaints");
addFooter(s);
// Left box - demographics
s.addShape(pres.ShapeType.rect, {
x: 0.2, y: 1.1, w: 3.5, h: 3.8,
fill: { color: C.navy }, line: { color: C.navy }, rounding: 0.08,
});
s.addText("DEMOGRAPHICS", {
x: 0.2, y: 1.1, w: 3.5, h: 0.45,
fontSize: 11, bold: true, color: C.amber, align: "center", valign: "middle",
});
const demoLines = [
["Name", "Ms. Hemasree"],
["Age / Sex", "16 Years / Female"],
["DOA", "30 June 2026"],
["DOD", "09 July 2026"],
["LOS", "10 Days"],
["IP No.", "26012063"],
["Allergies", "None"],
["Immunisation", "Last vax at 9 months"],
["Birth Wt.", "3.5 kg, Term NVD"],
];
demoLines.forEach(([k, v], i) => {
s.addText(k, {
x: 0.3, y: 1.6 + i * 0.34, w: 1.5, h: 0.3,
fontSize: 10, color: C.amber, bold: true, margin: 0,
});
s.addText(v, {
x: 1.85, y: 1.6 + i * 0.34, w: 1.7, h: 0.3,
fontSize: 10, color: C.white, margin: 0,
});
});
// Right box - chief complaints
s.addShape(pres.ShapeType.rect, {
x: 4.0, y: 1.1, w: 5.75, h: 3.8,
fill: { color: C.white }, line: { color: C.teal, pt: 1.5 }, rounding: 0.08,
});
s.addText("CHIEF COMPLAINTS", {
x: 4.0, y: 1.1, w: 5.75, h: 0.45,
fontSize: 11, bold: true, color: C.teal, align: "center", valign: "middle",
});
const complaints = [
{ text: "Right ear pain + tinnitus + discharge", sub: "3 months ago (1 month duration)" },
{ text: "Headache + photophobia", sub: "1 month duration; frontal → holocranial" },
{ text: "Diplopia (binocular, right lateral gaze)", sub: "1 month" },
{ text: "Vomiting", sub: "1 day" },
{ text: "Fever (high grade, intermittent)", sub: "1 day" },
{ text: "Weight loss", sub: "Not significant" },
{ text: "Imbalance on walking", sub: "Resolved after ear treatment" },
];
complaints.forEach((c, i) => {
s.addText([
{ text: `\u25CF ${c.text}`, options: { bold: true, color: C.navy, fontSize: 11 } },
{ text: `\n ${c.sub}`, options: { color: C.muted, fontSize: 9, italic: true } },
], {
x: 4.2, y: 1.6 + i * 0.46, w: 5.3, h: 0.44,
margin: 0,
});
});
}
// ─────────────────────────────────────────────────────────────────
// SLIDE 3 - HISTORY & RISK FACTORS
// ─────────────────────────────────────────────────────────────────
{
const s = pres.addSlide();
s.background = { color: C.lightBg };
addSlideHeader(s, "History & Risk Factors");
addFooter(s);
// Timeline of events
s.addText("TIMELINE OF ILLNESS", {
x: 0.2, y: 1.0, w: 9.6, h: 0.35,
fontSize: 13, bold: true, color: C.navy,
});
const timeline = [
{ time: "3 months ago", event: "Rt ear pain, tinnitus, discharge, imbalance while walking" },
{ time: "2 months ago", event: "Admitted outside hospital → Dx: Disseminated TB + Stage 2 TBM + Spontaneous TM perforation + Middle ear TB\nEar culture: Staphylococcus aureus → Linezolid 2 weeks" },
{ time: "1 month ago", event: "MRI Brain (NIMHANS): Multiple ring-enhancing lesions → Multiple Tuberculoma\nHRCT Chest: Consolidation Lt lower lobe + Miliary infiltrates\nCSF: Cells 101, L 82%, N 11%, Protein 85.6, Glucose 40\nATT started" },
{ time: "30 Jun 2026", event: "Admitted here: persistent headache + diplopia + neck pain despite 1 month ATT" },
{ time: "Hospital course", event: "Steroid dose escalated → IV Dexamethasone → MRI repeated → Acetazolamide added\nOphthalmology: ocular exercises prescribed\nImproved, discharged 09 July 2026" },
];
const dotX = 0.4;
const lineX = 0.55;
timeline.forEach((t, i) => {
const y = 1.4 + i * 0.78;
// Dot
s.addShape(pres.ShapeType.ellipse, {
x: dotX - 0.12, y: y - 0.04, w: 0.24, h: 0.24,
fill: { color: C.teal }, line: { color: C.teal },
});
// Vertical line (except last)
if (i < timeline.length - 1) {
s.addShape(pres.ShapeType.rect, {
x: dotX - 0.02, y: y + 0.2, w: 0.04, h: 0.58,
fill: { color: C.muted }, line: { color: C.muted },
});
}
// Time label
s.addText(t.time, {
x: 0.75, y: y - 0.04, w: 1.6, h: 0.24,
fontSize: 10, bold: true, color: C.amber, valign: "middle", margin: 0,
});
// Event text
s.addText(t.event, {
x: 2.4, y: y - 0.06, w: 7.4, h: 0.7,
fontSize: 9.5, color: C.slate, valign: "top", margin: 0,
});
});
// Family history box
s.addShape(pres.ShapeType.rect, {
x: 0.2, y: 5.05, w: 9.6, h: 0.3,
fill: { color: C.amber }, line: { color: C.amber }, rounding: 0.05,
});
s.addText("FAMILY HISTORY: Paternal grandfather — Pulmonary TB (7 yrs ago, completed ATT) | Mother — TB Lymphadenitis (14 yrs ago, completed ATT)", {
x: 0.2, y: 5.05, w: 9.6, h: 0.3,
fontSize: 10, bold: true, color: C.navy, align: "center", valign: "middle", margin: 0,
});
}
// ─────────────────────────────────────────────────────────────────
// SLIDE 4 - CLINICAL EXAMINATION
// ─────────────────────────────────────────────────────────────────
{
const s = pres.addSlide();
s.background = { color: C.lightBg };
addSlideHeader(s, "Clinical Examination");
addFooter(s);
// Vitals row
const vitals = [
{ label: "Temp", val: "98°F", sub: "Afebrile" },
{ label: "SpO2", val: "98%", sub: "on 4L O2" },
{ label: "HR", val: "96/min", sub: "Regular" },
{ label: "RR", val: "24/min", sub: "" },
{ label: "BP", val: "120/80", sub: "mmHg" },
];
vitals.forEach((v, i) => {
const x = 0.2 + i * 1.92;
s.addShape(pres.ShapeType.rect, {
x, y: 1.0, w: 1.82, h: 0.85,
fill: { color: C.navy }, line: { color: C.teal, pt: 1 }, rounding: 0.06,
});
s.addText(v.label, { x, y: 1.0, w: 1.82, h: 0.25, fontSize: 9, color: C.muted, align: "center", margin: 0 });
s.addText(v.val, { x, y: 1.25, w: 1.82, h: 0.35, fontSize: 16, bold: true, color: C.amber, align: "center", margin: 0 });
s.addText(v.sub, { x, y: 1.6, w: 1.82, h: 0.22, fontSize: 8.5, color: C.teal, align: "center", margin: 0 });
});
// Anthropometry
s.addText("ANTHROPOMETRY", {
x: 0.2, y: 1.95, w: 9.6, h: 0.3, fontSize: 11, bold: true, color: C.navy, margin: 0,
});
const anthro = [
["Parameter", "Observed", "Expected", "Centile"],
["Weight", "37.2 kg", "50 kg", "3rd–10th"],
["Height", "152 cm", "157 cm", "10th–25th"],
["BMI", "16.1", "20", "5th–10th"],
];
anthro.forEach((row, ri) => {
row.forEach((cell, ci) => {
s.addShape(pres.ShapeType.rect, {
x: 0.2 + ci * 2.4, y: 2.25 + ri * 0.3, w: 2.38, h: 0.29,
fill: { color: ri === 0 ? C.teal : (ri % 2 === 0 ? "E2EEF4" : C.white) },
line: { color: "CBD5E1", pt: 0.5 },
});
s.addText(cell, {
x: 0.2 + ci * 2.4, y: 2.25 + ri * 0.3, w: 2.38, h: 0.29,
fontSize: 10, bold: ri === 0, color: ri === 0 ? C.white : C.slate,
align: "center", valign: "middle", margin: 0,
});
});
});
// Key Neurological Findings
s.addText("KEY NEUROLOGICAL FINDINGS", {
x: 0.2, y: 3.47, w: 9.6, h: 0.3, fontSize: 11, bold: true, color: C.navy, margin: 0,
});
const neuroLeft = [
["6th CN Palsy", "Bilateral (R > L) — Diplopia on right lateral gaze", C.red],
["Meningeal Signs", "Neck rigidity PRESENT; Kernig's –ve; Brudzinski's –ve", C.red],
["Weber Test", "Lateralised to RIGHT ear", C.red],
];
const neuroRight = [
["Power", "4/5 all limbs (mild global reduction)", C.amber],
["Pallor", "Present", C.amber],
["Other CNs", "I, III, IV, V, VII, VIII–XII — Normal", C.green],
["Cerebellar", "No signs; Romberg absent", C.green],
];
neuroLeft.forEach(([label, val, col], i) => {
s.addShape(pres.ShapeType.rect, {
x: 0.2, y: 3.83 + i * 0.38, w: 4.6, h: 0.35,
fill: { color: C.white }, line: { color: col, pt: 1.5 }, rounding: 0.04,
});
s.addText([
{ text: label + ": ", options: { bold: true, color: col, fontSize: 10 } },
{ text: val, options: { color: C.slate, fontSize: 10 } },
], { x: 0.2, y: 3.83 + i * 0.38, w: 4.6, h: 0.35, valign: "middle", margin: 6 });
});
neuroRight.forEach(([label, val, col], i) => {
s.addShape(pres.ShapeType.rect, {
x: 5.1, y: 3.83 + i * 0.38, w: 4.7, h: 0.35,
fill: { color: C.white }, line: { color: col, pt: 1.5 }, rounding: 0.04,
});
s.addText([
{ text: label + ": ", options: { bold: true, color: col, fontSize: 10 } },
{ text: val, options: { color: C.slate, fontSize: 10 } },
], { x: 5.1, y: 3.83 + i * 0.38, w: 4.7, h: 0.35, valign: "middle", margin: 6 });
});
}
// ─────────────────────────────────────────────────────────────────
// SLIDE 5 - CSF & LAB INVESTIGATIONS
// ─────────────────────────────────────────────────────────────────
{
const s = pres.addSlide();
s.background = { color: C.lightBg };
addSlideHeader(s, "Investigations — CSF Analysis & Microbiology");
addFooter(s);
// CSF table
s.addText("CSF ANALYSIS (NIMHANS)", {
x: 0.2, y: 1.05, w: 4.5, h: 0.3, fontSize: 11, bold: true, color: C.navy, margin: 0,
});
const csf = [
["Parameter", "Value", "Interpretation"],
["Total WBC", "101 cells", "Elevated (pleocytosis)"],
["Neutrophils", "11%", "Minor neutrophilia"],
["Lymphocytes", "82%", "Lymphocyte dominant"],
["Protein", "85.6 mg/dL", "Elevated"],
["Glucose (CSF)", "40 mg/dL", "Low"],
["Blood Sugar", "140 mg/dL", "CSF:BS ratio 0.28 (low)"],
["CBNAAT (CSF)", "Negative", ""],
["Culture (CSF)", "No growth", "Awaited from NIMHANS"],
];
csf.forEach((row, ri) => {
const cols = [0.2, 2.5, 3.8];
const widths = [2.25, 1.25, 2.4];
row.forEach((cell, ci) => {
const isAbnormal = ri > 0 && (cell.includes("Elevated") || cell.includes("Low") || cell.includes("0.28"));
s.addShape(pres.ShapeType.rect, {
x: cols[ci], y: 1.38 + ri * 0.32, w: widths[ci], h: 0.31,
fill: { color: ri === 0 ? C.navy : (ri % 2 === 0 ? "E8F4F8" : C.white) },
line: { color: "CBD5E1", pt: 0.5 },
});
s.addText(cell, {
x: cols[ci], y: 1.38 + ri * 0.32, w: widths[ci], h: 0.31,
fontSize: ri === 0 ? 9.5 : 9,
bold: ri === 0,
color: ri === 0 ? C.white : (isAbnormal ? C.red : C.slate),
valign: "middle", align: ci === 1 ? "center" : "left", margin: 4,
});
});
});
// Microbiology / other results
s.addText("MICROBIOLOGY & OTHER KEY RESULTS", {
x: 5.0, y: 1.05, w: 4.75, h: 0.3, fontSize: 11, bold: true, color: C.navy, margin: 0,
});
const micro = [
{ label: "Ear Discharge C&S", val: "Staphylococcus aureus (+ve)\n→ Linezolid given (sensitivity)", color: C.red },
{ label: "Sputum CBNAAT", val: "Negative", color: C.amber },
{ label: "CSF CBNAAT", val: "Negative", color: C.amber },
{ label: "CSF Culture (NIMHANS)", val: "Processing — Awaited", color: C.muted },
{ label: "ENT Swab (our hospital)", val: "Scanty / Nil discharge — not done", color: C.amber },
];
micro.forEach((m, i) => {
s.addShape(pres.ShapeType.rect, {
x: 5.0, y: 1.38 + i * 0.62, w: 4.75, h: 0.58,
fill: { color: C.white }, line: { color: m.color, pt: 1.5 }, rounding: 0.05,
});
s.addText([
{ text: m.label + "\n", options: { bold: true, fontSize: 10, color: C.navy } },
{ text: m.val, options: { fontSize: 9.5, color: m.color } },
], { x: 5.1, y: 1.38 + i * 0.62, w: 4.55, h: 0.58, valign: "middle", margin: 0 });
});
// Nutritional status
s.addShape(pres.ShapeType.rect, {
x: 0.2, y: 4.52, w: 9.55, h: 0.72,
fill: { color: "FEF3C7" }, line: { color: C.amber, pt: 1.5 }, rounding: 0.06,
});
s.addText("NUTRITIONAL ASSESSMENT", {
x: 0.4, y: 4.55, w: 9.3, h: 0.28, fontSize: 10, bold: true, color: C.navy, margin: 0,
});
s.addText("Caloric intake: 1122 kcal/day (Expected: 1840 kcal) — Deficit: 718 kcal | Protein: 38.2 g/day (Expected: 40.2 g) | BMI: 16.1 (5th–10th centile)", {
x: 0.4, y: 4.82, w: 9.3, h: 0.38, fontSize: 10, color: C.slate, margin: 0,
});
}
// ─────────────────────────────────────────────────────────────────
// SLIDE 6 - MRI BRAIN FINDINGS (NIMHANS - prior imaging)
// ─────────────────────────────────────────────────────────────────
{
const s = pres.addSlide();
s.background = { color: C.lightBg };
addSlideHeader(s, "MRI Brain Findings — NIMHANS (Prior Imaging)", "Multiple Ring-Enhancing Lesions — Tuberculoma");
addFooter(s);
s.addText("IMAGING DETAILS", {
x: 0.2, y: 1.25, w: 9.6, h: 0.28, fontSize: 11, bold: true, color: C.navy, margin: 0,
});
s.addText("Modality: MRI Brain with Contrast | Indication: Severe headache + raised ICP features | Institution: NIMHANS", {
x: 0.2, y: 1.52, w: 9.6, h: 0.25, fontSize: 10, color: C.slate, margin: 0,
});
// Signal characteristics box
s.addShape(pres.ShapeType.rect, {
x: 0.2, y: 1.85, w: 4.5, h: 2.35,
fill: { color: C.navy }, line: { color: C.navy }, rounding: 0.07,
});
s.addText("SIGNAL CHARACTERISTICS", {
x: 0.2, y: 1.85, w: 4.5, h: 0.35, fontSize: 10, bold: true, color: C.amber, align: "center", valign: "middle",
});
const signals = [
["T1", "Isointense"],
["T2 / FLAIR", "Hypointense (target sign)"],
["Enhancement", "Ring-enhancing pattern"],
["Perilesional", "Vasogenic edema — present"],
];
signals.forEach(([seq, finding], i) => {
s.addText([
{ text: seq + ": ", options: { bold: true, color: C.teal, fontSize: 11 } },
{ text: finding, options: { color: C.white, fontSize: 11 } },
], {
x: 0.4, y: 2.3 + i * 0.42, w: 4.1, h: 0.38, valign: "middle", margin: 0,
});
});
// Lesion locations
s.addShape(pres.ShapeType.rect, {
x: 4.9, y: 1.85, w: 4.9, h: 2.35,
fill: { color: C.white }, line: { color: C.teal, pt: 1.5 }, rounding: 0.07,
});
s.addText("LESION LOCATIONS (Multiple Tuberculoma)", {
x: 4.9, y: 1.85, w: 4.9, h: 0.35, fontSize: 10, bold: true, color: C.teal, align: "center", valign: "middle",
});
const locs = [
"Right Frontal Lobe",
"Right Parietal Lobe",
"Right Occipital Lobe",
"Left Periventricular Region",
"Bilateral Basal Ganglia",
"Thalamus",
"Left Temporal Lobe",
"Left Cerebellum",
];
const col1 = locs.slice(0, 4);
const col2 = locs.slice(4);
col1.forEach((loc, i) => {
s.addText("\u25BA " + loc, {
x: 5.0, y: 2.28 + i * 0.42, w: 2.35, h: 0.38,
fontSize: 10, color: C.slate, valign: "middle", margin: 0,
});
});
col2.forEach((loc, i) => {
s.addText("\u25BA " + loc, {
x: 7.4, y: 2.28 + i * 0.42, w: 2.3, h: 0.38,
fontSize: 10, color: C.slate, valign: "middle", margin: 0,
});
});
// Impression
s.addShape(pres.ShapeType.rect, {
x: 0.2, y: 4.3, w: 9.55, h: 0.65,
fill: { color: C.teal }, line: { color: C.teal }, rounding: 0.07,
});
s.addText("IMPRESSION: Multiple ring-enhancing lesions with T2 hypointensity and perilesional vasogenic edema — distribution and characteristics consistent with GRANULOMATOUS ETIOLOGY (TUBERCULOMA)", {
x: 0.35, y: 4.3, w: 9.3, h: 0.65,
fontSize: 11, bold: true, color: C.white, valign: "middle", margin: 0,
});
}
// ─────────────────────────────────────────────────────────────────
// SLIDE 7 - HRCT CHEST FINDINGS
// ─────────────────────────────────────────────────────────────────
{
const s = pres.addSlide();
s.background = { color: C.lightBg };
addSlideHeader(s, "HRCT Chest Findings — NIMHANS", "Disseminated Pulmonary TB");
addFooter(s);
// Left panel
s.addShape(pres.ShapeType.rect, {
x: 0.2, y: 1.15, w: 4.8, h: 3.9,
fill: { color: C.navy }, line: { color: C.navy }, rounding: 0.08,
});
s.addText("HRCT CHEST FINDINGS", {
x: 0.2, y: 1.15, w: 4.8, h: 0.38, fontSize: 11, bold: true, color: C.amber, align: "center", valign: "middle",
});
const hrct = [
{ finding: "Consolidation", detail: "Left lower lobe consolidation\nsuggesting active parenchymal disease" },
{ finding: "Miliary Pattern", detail: "Miliary infiltrates — bilateral\nconsistent with haematogenous dissemination" },
];
hrct.forEach((f, i) => {
s.addShape(pres.ShapeType.rect, {
x: 0.4, y: 1.65 + i * 1.35, w: 4.4, h: 1.15,
fill: { color: "1E3A5F" }, line: { color: C.teal, pt: 1 }, rounding: 0.06,
});
s.addText(f.finding, {
x: 0.5, y: 1.65 + i * 1.35, w: 4.2, h: 0.35, fontSize: 13, bold: true, color: C.amber, margin: 0,
});
s.addText(f.detail, {
x: 0.5, y: 2.0 + i * 1.35, w: 4.2, h: 0.75, fontSize: 11, color: C.white, margin: 0,
});
});
s.addText("IMPRESSION: Findings consistent with DISSEMINATED PULMONARY TB", {
x: 0.4, y: 4.1, w: 4.4, h: 0.5,
fontSize: 10, bold: true, color: C.teal, margin: 0, align: "center", valign: "middle",
});
// Right panel - Clinical context
s.addShape(pres.ShapeType.rect, {
x: 5.2, y: 1.15, w: 4.6, h: 3.9,
fill: { color: C.white }, line: { color: C.teal, pt: 1.5 }, rounding: 0.08,
});
s.addText("CLINICAL CONTEXT", {
x: 5.2, y: 1.15, w: 4.6, h: 0.38, fontSize: 11, bold: true, color: C.teal, align: "center", valign: "middle",
});
const context = [
{ icon: "►", label: "Dissemination route", val: "Haematogenous spread → simultaneous CNS + pulmonary + possible middle ear involvement" },
{ icon: "►", label: "Risk factor", val: "Strong family history of TB (grandfather: pulmonary TB; mother: TB lymphadenitis)" },
{ icon: "►", label: "Immunisation gap", val: "Not immunised after 9 months of age — BCG protection inadequate" },
{ icon: "►", label: "Nutritional status", val: "Caloric deficit (38% below expected) — contributes to susceptibility" },
{ icon: "►", label: "Sputum CBNAAT", val: "Negative — microbiological confirmation of pulmonary TB pending" },
];
context.forEach((c, i) => {
s.addText([
{ text: c.label + ":\n", options: { bold: true, fontSize: 10, color: C.navy } },
{ text: c.val, options: { fontSize: 9.5, color: C.slate } },
], {
x: 5.4, y: 1.6 + i * 0.68, w: 4.2, h: 0.64, valign: "middle", margin: 0,
});
if (i < context.length - 1) {
s.addShape(pres.ShapeType.rect, {
x: 5.3, y: 2.22 + i * 0.68, w: 4.4, h: 0.01,
fill: { color: "E2E8F0" }, line: { color: "E2E8F0" },
});
}
});
}
// ─────────────────────────────────────────────────────────────────
// SLIDE 8 - MRI BRAIN AT OUR HOSPITAL (REPEAT)
// ─────────────────────────────────────────────────────────────────
{
const s = pres.addSlide();
s.background = { color: C.lightBg };
addSlideHeader(s, "Repeat MRI Brain — Our Hospital", "After 1 Month of ATT — Comparative Analysis");
addFooter(s);
// Comparison columns
const cols = [
{
title: "PREVIOUS MRI (NIMHANS)\n~1 Month Earlier",
color: C.navy,
items: [
"Multiple ring-enhancing lesions",
"T1 isointense / T2 hypointense",
"Significant perilesional vasogenic edema",
"8 sites involved (bilateral, multifocal)",
"No basal leptomeningeal enhancement noted",
],
},
{
title: "CURRENT MRI (OUR HOSPITAL)\nAfter 1 Month ATT",
color: C.teal,
items: [
"NEW: Mild basal leptomeningeal enhancement",
"Significant REDUCTION in lesion size",
"Significant REDUCTION in perilesional edema",
"Persistent ring-enhancing pattern",
"No new lesions identified",
],
},
];
cols.forEach((col, ci) => {
const x = 0.2 + ci * 5.0;
s.addShape(pres.ShapeType.rect, {
x, y: 1.1, w: 4.7, h: 0.55,
fill: { color: col.color }, line: { color: col.color }, rounding: 0.06,
});
s.addText(col.title, {
x, y: 1.1, w: 4.7, h: 0.55, fontSize: 10.5, bold: true, color: C.white, align: "center", valign: "middle",
});
col.items.forEach((item, ii) => {
const isNew = item.startsWith("NEW:");
const isGood = item.includes("REDUCTION") || item.includes("No new");
s.addShape(pres.ShapeType.rect, {
x, y: 1.72 + ii * 0.46, w: 4.7, h: 0.42,
fill: { color: isNew ? "FEF3C7" : (isGood ? "F0FFF4" : C.white) },
line: { color: isNew ? C.amber : (isGood ? C.green : "CBD5E1"), pt: 1 },
rounding: 0.04,
});
s.addText("\u25CF " + item, {
x: x + 0.1, y: 1.72 + ii * 0.46, w: 4.5, h: 0.42,
fontSize: 10, color: isNew ? C.amber : (isGood ? C.green : C.slate),
bold: isNew, valign: "middle", margin: 0,
});
});
});
// Divider arrow
s.addShape(pres.ShapeType.rect, {
x: 4.9, y: 2.7, w: 0.2, h: 0.7,
fill: { color: C.amber }, line: { color: C.amber },
});
s.addText("►", {
x: 4.75, y: 3.0, w: 0.5, h: 0.5,
fontSize: 20, color: C.amber, align: "center", margin: 0,
});
// Key interpretation
s.addShape(pres.ShapeType.rect, {
x: 0.2, y: 4.4, w: 9.55, h: 0.8,
fill: { color: "F0FFF4" }, line: { color: C.green, pt: 1.5 }, rounding: 0.07,
});
s.addText([
{ text: "RADIOLOGICAL RESPONSE: ", options: { bold: true, fontSize: 11, color: C.green } },
{ text: "Despite new basal leptomeningeal enhancement (possible paradoxical reaction or disease progression at CSF compartment), lesion size and vasogenic edema have significantly reduced — suggesting a PARTIAL RADIOLOGICAL RESPONSE to ATT. ", options: { fontSize: 10.5, color: C.slate } },
{ text: "Steroid dose escalated accordingly.", options: { fontSize: 10.5, italic: true, color: C.navy } },
], { x: 0.35, y: 4.4, w: 9.3, h: 0.8, valign: "middle", margin: 0 });
}
// ─────────────────────────────────────────────────────────────────
// SLIDE 9 - MANAGEMENT OVERVIEW
// ─────────────────────────────────────────────────────────────────
{
const s = pres.addSlide();
s.background = { color: C.lightBg };
addSlideHeader(s, "Management — Course in Hospital");
addFooter(s);
// ATT box
s.addShape(pres.ShapeType.rect, {
x: 0.2, y: 1.1, w: 9.55, h: 0.45,
fill: { color: C.navy }, line: { color: C.navy }, rounding: 0.06,
});
s.addText("ANTI-TUBERCULAR THERAPY (ATT) — Continued throughout admission", {
x: 0.2, y: 1.1, w: 9.55, h: 0.45,
fontSize: 11, bold: true, color: C.amber, align: "center", valign: "middle",
});
s.addText("4FDC Adult 2 tabs OD + 3FDC Paediatric 2 tabs OD + Tab. Ethambutol 200mg OD + Tab. Pyridoxine 40mg OD", {
x: 0.2, y: 1.55, w: 9.55, h: 0.28, fontSize: 10, color: C.slate, align: "center", margin: 0,
});
// Management steps grid
const steps = [
{ title: "1. Steroid Escalation", detail: "Prednisolone 1 mg/kg/day → 2 mg/kg/day\nIV Dexamethasone 4mg Q6h × 6 days\n→ Switched to oral Prednisolone 80mg/day (2 mg/kg/day)", color: C.teal },
{ title: "2. Anti-Edema / ICP", detail: "Tab. Acetazolamide 250mg Q6h × 9 days\n(for raised intracranial pressure)\nDiscontinued after symptom resolution", color: C.teal },
{ title: "3. Anticonvulsant", detail: "Tab. Levetiracetam 500mg Q12h\n(prophylactic — no documented seizure)\nContinued on discharge", color: C.navy },
{ title: "4. Ophthalmology Review", detail: "6th CN palsy → bilateral diplopia\nOcular movement exercises:\n15 repetitions × 3 sessions/day", color: C.navy },
{ title: "5. ENT Evaluation", detail: "Middle ear TB suspected (NIMHANS)\nScanty/nil discharge here → biopsy/\nmicrobiological confirmation not feasible", color: C.amber },
{ title: "6. Multidisciplinary", detail: "Paed. Neurologist: steroid protocol\nPaed. Endocrinologist: consulted\nGeneticist: consulted\nPaed. Surgeon: consulted", color: C.amber },
];
steps.forEach((step, i) => {
const col = i % 2 === 0 ? 0.2 : 5.1;
const row = Math.floor(i / 2);
const y = 1.9 + row * 1.1;
s.addShape(pres.ShapeType.rect, {
x: col, y, w: 4.75, h: 1.0,
fill: { color: C.white }, line: { color: step.color, pt: 1.5 }, rounding: 0.07,
});
s.addShape(pres.ShapeType.rect, {
x: col, y, w: 0.22, h: 1.0,
fill: { color: step.color }, line: { color: step.color }, rounding: 0.03,
});
s.addText(step.title, {
x: col + 0.3, y: y + 0.02, w: 4.35, h: 0.3,
fontSize: 10.5, bold: true, color: step.color, margin: 0,
});
s.addText(step.detail, {
x: col + 0.3, y: y + 0.32, w: 4.35, h: 0.62,
fontSize: 9.5, color: C.slate, margin: 0,
});
});
}
// ─────────────────────────────────────────────────────────────────
// SLIDE 10 - DIFFERENTIAL DIAGNOSIS
// ─────────────────────────────────────────────────────────────────
{
const s = pres.addSlide();
s.background = { color: C.lightBg };
addSlideHeader(s, "Differential Diagnosis — Ring-Enhancing Lesions in a Child");
addFooter(s);
const diffs = [
{
dx: "Tuberculoma ✓ (Favoured)",
for_: "Multiple lesions, T2 hypointense, granulomatous pattern, miliary chest, strong TB contact history, CSF lymphocytosis, BCG gap, partial ATT response",
against: "CBNAAT negative; Culture pending",
likely: true,
},
{
dx: "Pyogenic Brain Abscess",
for_: "Ring-enhancing lesions",
against: "No DWI restriction pattern reported; afebrile on admission; no source of pyogenic infection; no neutrophilic CSF predominance",
likely: false,
},
{
dx: "Neurocysticercosis",
for_: "Ring-enhancing lesions, endemic region",
against: "Multiple active lesions without calcification; T2 hypointensity not typical; no dietary risk; miliary chest pattern not explained",
likely: false,
},
{
dx: "Lymphoma (CNS)",
for_: "Multiple periventricular lesions",
against: "Child, immunocompetent; no systemic lymphoma features; pattern more granulomatous",
likely: false,
},
{
dx: "Toxoplasmosis",
for_: "Ring-enhancing, basal ganglia involvement",
against: "Immunocompetent child; no HIV risk; exposure history absent",
likely: false,
},
];
const headers = ["DIFFERENTIAL DIAGNOSIS", "POINTS IN FAVOUR", "POINTS AGAINST"];
const colX = [0.2, 2.8, 6.2];
const colW = [2.55, 3.35, 3.55];
headers.forEach((h, ci) => {
s.addShape(pres.ShapeType.rect, {
x: colX[ci], y: 1.05, w: colW[ci], h: 0.3,
fill: { color: C.navy }, line: { color: C.navy },
});
s.addText(h, {
x: colX[ci], y: 1.05, w: colW[ci], h: 0.3,
fontSize: 9.5, bold: true, color: C.white, align: "center", valign: "middle", margin: 0,
});
});
diffs.forEach((d, i) => {
const y = 1.38 + i * 0.74;
const bg = d.likely ? "F0FFF4" : C.white;
const borderCol = d.likely ? C.green : "CBD5E1";
colX.forEach((x, ci) => {
s.addShape(pres.ShapeType.rect, {
x, y, w: colW[ci], h: 0.7,
fill: { color: bg }, line: { color: borderCol, pt: d.likely ? 1.5 : 0.5 },
});
});
const texts = [d.dx, d.for_, d.against];
texts.forEach((txt, ci) => {
s.addText(txt, {
x: colX[ci] + 0.05, y: y + 0.04, w: colW[ci] - 0.1, h: 0.62,
fontSize: ci === 0 ? 10 : 9,
bold: ci === 0,
color: ci === 0 ? (d.likely ? C.green : C.navy) : C.slate,
valign: "top", margin: 0,
});
});
});
}
// ─────────────────────────────────────────────────────────────────
// SLIDE 11 - DISCHARGE PLAN & FOLLOW-UP
// ─────────────────────────────────────────────────────────────────
{
const s = pres.addSlide();
s.background = { color: C.lightBg };
addSlideHeader(s, "Discharge Plan & Follow-Up");
addFooter(s);
// Discharge medications table
s.addText("DISCHARGE MEDICATIONS", {
x: 0.2, y: 1.05, w: 5.5, h: 0.3, fontSize: 11, bold: true, color: C.navy, margin: 0,
});
const meds = [
["Drug", "Dose", "Frequency", "Duration"],
["ATT (4FDC Adult)", "2 tabs", "Once daily", "1 month"],
["ATT (3FDC Paed.)", "2 tabs", "Once daily", "1 month"],
["Tab. Ethambutol", "200 mg", "Once daily", "1 month"],
["Tab. Levetiracetam", "500 mg", "BD (12-hrly)", "1 month"],
["Tab. Prednisolone", "20 mg", "2-0-2 (80mg/day)", "4 weeks then taper"],
["Tab. Pyridoxine", "40 mg", "BD", "4 weeks"],
["Tab. Calcium", "500 mg", "Once daily", "1 month"],
];
const mColX = [0.2, 2.85, 4.0, 5.15];
const mColW = [2.6, 1.1, 1.1, 1.9];
meds.forEach((row, ri) => {
row.forEach((cell, ci) => {
s.addShape(pres.ShapeType.rect, {
x: mColX[ci], y: 1.38 + ri * 0.3, w: mColW[ci], h: 0.29,
fill: { color: ri === 0 ? C.teal : (ri % 2 === 0 ? "F0F9FF" : C.white) },
line: { color: "CBD5E1", pt: 0.5 },
});
s.addText(cell, {
x: mColX[ci], y: 1.38 + ri * 0.3, w: mColW[ci], h: 0.29,
fontSize: ri === 0 ? 9 : 9.5, bold: ri === 0,
color: ri === 0 ? C.white : C.slate,
align: ci === 0 ? "left" : "center", valign: "middle", margin: 4,
});
});
});
// Follow-up box
s.addShape(pres.ShapeType.rect, {
x: 7.4, y: 1.05, w: 2.35, h: 3.6,
fill: { color: C.navy }, line: { color: C.navy }, rounding: 0.08,
});
s.addText("FOLLOW-UP PLAN", {
x: 7.4, y: 1.05, w: 2.35, h: 0.35, fontSize: 10, bold: true, color: C.amber, align: "center", valign: "middle",
});
const fu = [
{ date: "19 Jul 2026", clinic: "Paediatric OPD\n9 AM, 1st Floor" },
{ date: "25 Jul 2026", clinic: "Paed. Neurology OPD\n(Dr. Arathi)\n1st Floor" },
{ date: "31 Jul 2026", clinic: "ATT review\n(1-month course ends)" },
{ date: "Next visit", clinic: "CBC, LFT,\nVitamin D levels" },
];
fu.forEach((f, i) => {
s.addText(f.date, {
x: 7.5, y: 1.5 + i * 0.78, w: 2.1, h: 0.28,
fontSize: 10, bold: true, color: C.amber, align: "center", margin: 0,
});
s.addText(f.clinic, {
x: 7.5, y: 1.78 + i * 0.78, w: 2.1, h: 0.42,
fontSize: 9.5, color: C.white, align: "center", margin: 0,
});
});
// Warning signs
s.addShape(pres.ShapeType.rect, {
x: 0.2, y: 4.8, w: 7.1, h: 0.55,
fill: { color: C.red }, line: { color: C.red }, rounding: 0.06,
});
s.addText([
{ text: "WARNING SIGNS — Return to ER: ", options: { bold: true, fontSize: 10.5, color: C.white } },
{ text: "Seizures | Persistent vomiting | Abnormal movements | Limb weakness", options: { fontSize: 10.5, color: C.white } },
], { x: 0.35, y: 4.8, w: 6.9, h: 0.55, valign: "middle", margin: 0 });
}
// ─────────────────────────────────────────────────────────────────
// SLIDE 12 - SUMMARY & TEACHING POINTS
// ─────────────────────────────────────────────────────────────────
{
const s = pres.addSlide();
s.background = { color: C.navy };
// Accent
s.addShape(pres.ShapeType.rect, {
x: 0, y: 0, w: 10, h: 0.07,
fill: { color: C.teal }, line: { color: C.teal },
});
s.addText("CASE SUMMARY & RADIOLOGY TEACHING POINTS", {
x: 0.3, y: 0.15, w: 9.4, h: 0.6,
fontSize: 20, bold: true, color: C.amber, align: "center",
});
s.addShape(pres.ShapeType.rect, {
x: 0, y: 0.75, w: 10, h: 0.05,
fill: { color: C.teal }, line: { color: C.teal },
});
const points = [
{ num: "01", title: "Classic Tuberculoma Pattern", body: "T2 hypointensity + ring enhancement + perilesional edema = target sign. Differentiates from most other ring-enhancing lesions which are T2 hyperintense." },
{ num: "02", title: "Miliary TB — Haematogenous Dissemination", body: "Simultaneous involvement of brain (tuberculoma), lungs (miliary + consolidation), and possibly middle ear confirms haematogenous route. HRCT miliary pattern is pathognomonic." },
{ num: "03", title: "New Leptomeningeal Enhancement on Repeat MRI", body: "Basal leptomeningeal enhancement not seen on initial MRI — consider paradoxical reaction vs. true progression despite ATT. Steroid escalation is the correct response." },
{ num: "04", title: "Culture/CBNAAT Negativity is Common", body: "CSF CBNAAT sensitivity ~50–60% in TBM. Do not withhold treatment. Clinical + radiological + epidemiological diagnosis is sufficient in resource-limited settings." },
{ num: "05", title: "6th CN Palsy in TBM", body: "Long intracranial course of 6th CN makes it highly susceptible to raised ICP and basal meningitis. Its presence in TBM carries both localising and non-localising significance." },
];
points.forEach((p, i) => {
const col = i < 3 ? 0 : 1;
const row = i < 3 ? i : i - 3;
const x = 0.25 + col * 5.0;
const y = 0.95 + row * 1.38;
s.addShape(pres.ShapeType.rect, {
x, y, w: 4.65, h: 1.28,
fill: { color: "1E3A5F" }, line: { color: C.teal, pt: 1 }, rounding: 0.07,
});
s.addText(p.num, {
x: x + 0.1, y: y + 0.08, w: 0.52, h: 0.52,
fontSize: 22, bold: true, color: C.teal, align: "center", margin: 0,
});
s.addText(p.title, {
x: x + 0.68, y: y + 0.06, w: 3.85, h: 0.34,
fontSize: 11, bold: true, color: C.amber, margin: 0,
});
s.addText(p.body, {
x: x + 0.68, y: y + 0.42, w: 3.85, h: 0.8,
fontSize: 9.5, color: C.white, margin: 0,
});
});
}
// ─────────────────────────────────────────────────────────────────
// WRITE FILE
// ─────────────────────────────────────────────────────────────────
const outPath = "/home/daytona/workspace/radiology-ppt/Disseminated_TB_Tuberculoma_PedRadiology.pptx";
pres.writeFile({ fileName: outPath }).then(() => {
console.log("SUCCESS: " + outPath);
}).catch(err => {
console.error("ERROR:", err);
});
cd /home/daytona/workspace/radiology-ppt && node create_pptx.js 2>&1
ls -lh /home/daytona/workspace/radiology-ppt/Disseminated_TB_Tuberculoma_PedRadiology.pptx
Disseminated TB Tuberculoma PedRadiology
Presentation · PPTX
| Slide | Content |
|---|---|
| 1 | Title slide — case identity, diagnosis, dates |
| 2 | Patient profile, demographics, chief complaints |
| 3 | Timeline of illness + family history / risk factors |
| 4 | Clinical examination — vitals, anthropometry, neurological findings (6th CN palsy, meningism) |
| 5 | CSF analysis table + microbiology results + nutritional assessment |
| 6 | MRI Brain (NIMHANS) — signal characteristics + all 8 lesion locations |
| 7 | HRCT Chest — miliary pattern + consolidation + clinical context (haematogenous dissemination) |
| 8 | Repeat MRI (your hospital) — comparative analysis: new leptomeningeal enhancement vs. reduction in lesion size/edema |
| 9 | In-hospital management — ATT, steroid escalation, acetazolamide, levetiracetam, ophthalmology, MDT |
| 10 | Differential diagnosis table — Tuberculoma vs. abscess vs. NCC vs. lymphoma vs. toxoplasmosis |
| 11 | Discharge medications + follow-up schedule + warning signs |
| 12 | Case summary & 5 radiology teaching points |