Give me radiological features of sinonasal tumors and other benign sinonasal growth as I have to present lecture on it so please make schematic approach

Reading File
Finding Sources
Finding Sources
Finding Sources
Searching PubMed

sinonasal tumors radiology CT MRI features imaging

Finding Sources
Finding Sources
Finding Sources
Searching the Web

sinonasal tumors radiology CT MRI features schematic approach lecture review 2023 2024

Finding Sources
Finding Sources
Reading Web Page

https://www.frontiersin.org/journals/radiology/articles/10.3…

Finding Sources
Reading Web Page

https://www.frontiersin.org/journals/radiology/articles/10.3…

Finding Sources
Searching Images

sinonasal tumor CT MRI imaging radiology

Here is a comprehensive, schematic lecture-ready overview of the radiological features of sinonasal tumors and benign sinonasal growths.

🧠 RADIOLOGICAL FEATURES OF SINONASAL TUMORS

A Schematic Approach for Lecture


PART 1 β€” IMAGING STRATEGY OVERVIEW

CLINICAL SUSPICION OF SINONASAL LESION
               β”‚
               β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                   CT (First Line)                β”‚
β”‚  β€’ Define site of origin                        β”‚
β”‚  β€’ Bony remodeling vs. destruction              β”‚
β”‚  β€’ Intralesional calcifications/tumor matrix    β”‚
β”‚  β€’ Identify feeding arteries                    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                       β”‚
                       β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              MRI (Problem-Solving)               β”‚
β”‚  β€’ Superior soft-tissue differentiation         β”‚
β”‚  β€’ Tumor extent mapping                         β”‚
β”‚  β€’ Tumor vs. obstructed secretions              β”‚
β”‚  β€’ Perineural tumor spread (PNTS)              β”‚
β”‚  β€’ Intracranial / orbital extension             β”‚
β”‚  β€’ DWI/ADC: high = benign/fluid/mucus          β”‚
β”‚             low  = malignant/hypercellular      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
Key "red flag" CT findings for malignancy:
  • Unilateral sinus disease
  • Bone destruction/erosion (vs. remodeling in benign)
  • Extensive soft-tissue mass
  • Tumor necrosis
  • Cervical lymphadenopathy

PART 2 β€” PATTERNS OF BONY INVOLVEMENT (Critical Discriminator)

PatternAssociation
Bone destruction/erosionMalignancy (SCC, SNUC, melanoma), osteomyelitis, invasive fungal sinusitis
Bone remodeling/dehiscenceLong-standing benign: mucocele, polyp, inverted papilloma, schwannoma, cephalocele
Reactive sclerosisChronic infection sequela
New bone formationOsteoma, fibrous dysplasia
Focal hyperostosis at tumor baseClassic for inverted papilloma

PART 3 β€” BENIGN SINONASAL GROWTHS

3A. SINONASAL POLYPS (Most Common Benign)

CT:  β€’ Bilateral, multiple, low-attenuation masses
     β€’ Expand sinus, remodel (not destroy) bone
     β€’ Mucosal thickening background
MRI: β€’ T1: Low signal
     β€’ T2: Hyperintense (high water content)
     β€’ Enhancement: Peripheral rim only (not solid)
Key: BILATERAL = think benign polyposis
     UNILATERAL = must exclude neoplasm

3B. ANTROCHOANAL POLYP

CT:  β€’ Unilateral; arises in maxillary sinus, extends through enlarged 
       accessory ostium into nasopharynx
     β€’ "Dumbbell" shape through posterior choana
MRI: β€’ T2: Hyperintense
     β€’ Peripheral contrast enhancement (vs. solid central in IP)
Tip: Young patients; no bone destruction

3C. INVERTED PAPILLOMA (Schneiderian Papilloma)

Site: Lateral nasal wall β†’ middle turbinate / ethmoid recesses β†’ maxillary sinus
CT:   β€’ Soft-tissue mass with bony remodeling
      β€’ FOCAL HYPEROSTOSIS at attachment site (helps locate origin) β˜…
      β€’ Β± Intralesional calcifications
MRI:  β€’ T1: Iso- to hypointense
      β€’ T2: Hyperintense to muscle
      β€’ β˜… CONVOLUTED CEREBRIFORM PATTERN (CCP): alternating 
        curvilinear high/low signal on T2 and post-contrast T1
        β€” seen in up to 80% of cases (PATHOGNOMONIC)
DWI:  β€’ Intermediate ADC values
Key:  β€’ 0.4–4% of sinonasal tumors; locally aggressive but benign
      β€’ 2–15% recurrence; ~10% malignant transformation risk to SCC
      β€’ CCP differentiates IP from inflammatory polyp
Sinonasal tumor CT and MRI coronal views

3D. OSTEOMA (Most Common Benign Tumor)

Site: Frontal sinus >> ethmoid > maxillary (incidental finding)
CT:   β€’ Dense cortical bone (ivory osteoma) OR ground-glass appearance
      β€’ Well-defined, homogeneous
      β€’ May obstruct sinus drainage
MRI:  β€’ T1/T2: Low signal (cortical bone)
      β€’ Mild post-contrast enhancement
Key:  β€’ Distinguish from fibrous dysplasia (see below)

3E. FIBROUS DYSPLASIA

CT:   β€’ "Ground glass" matrix ← HALLMARK
      β€’ Expansile, well-defined, no periosteal reaction
MRI:  β€’ Variable signal (depends on fibrous vs. cystic component)
      β€’ Mild heterogeneous enhancement
Key:  β€’ Radiological diagnosis is primarily CT-based
      β€’ Can narrow nasal cavity / obstruct sinus

3F. JUVENILE NASOPHARYNGEAL ANGIOFIBROMA (JNA)

Demographics: Adolescent males
Site:         Sphenopalatine foramen β†’ nasopharynx
CT:           β€’ Highly vascular soft-tissue mass
              β€’ Intense early arterial enhancement
              β€’ Posterior wall of maxillary sinus bowed anteriorly
              β€’ "Holman-Miller sign" (anterior bowing of posterior antral wall)
MRI:          β€’ T1: Intermediate signal
              β€’ T2: Intermediate-high signal with FLOW VOIDS (feeding vessels) β˜…
              β€’ Intense, homogeneous enhancement
Angiography:  β€’ Preoperative embolization; external carotid supply
Key:          β€’ DO NOT biopsy (massive hemorrhage risk)

3G. MUCOCELE

Site: Frontal sinus (most common) > ethmoid > maxillary
CT:   β€’ Smooth expansile sinus opacification
      β€’ Bony remodeling (not destruction), thinned walls
      β€’ Attenuation variable (15–40 HU protein-dependent; high protein = dense)
MRI:  β€’ T1: Low β†’ High (varies with protein content)
      β€’ T2: High β†’ Low (inversely proportional to protein)
      β€’ No internal enhancement (wall may enhance)
Key:  β€’ Scalloped expansion is hallmark; look for secondary infection

3H. PLEOMORPHIC ADENOMA (Benign Mixed Tumor)

Site: Nasal septum (salivary rests)
CT:   β€’ Nonspecific; bony REMODELING (not destruction)
MRI:  β€’ T2: HYPERINTENSE β˜… (classic for salivary-type tumors)
      β€’ Enhancement: variable, heterogeneous in large lesions
Demographics: F > M, 30–60 years

3I. SCHWANNOMA / NEUROFIBROMA

CT:   β€’ Low-attenuation or near-cystic appearance
      β€’ Bony remodeling with smooth enlargement of foramina
MRI:  β€’ T1: Intermediate
      β€’ T2: "Bubbly" hyperintense pattern; large ones develop intramural cysts
      β€’ Enhancement: variable, whorled pattern in schwannomas
Key:  β€’ Excellent prognosis; surgical excision

PART 4 β€” MALIGNANT SINONASAL TUMORS

4A. SQUAMOUS CELL CARCINOMA (SCC) β€” Most Common (51.6%)

Site: Maxillary sinus (most common malignancy site)
CT:   β€’ Aggressive bone DESTRUCTION β˜…
      β€’ Soft-tissue mass, may have necrosis
      β€’ Calcification rare
MRI:  β€’ T1: Isointense (non-specific)
      β€’ T2: Faintly hyperintense to muscle
      β€’ CE-T1: Moderate enhancement
      β€’ DWI: Low ADC (hypercellular)
Key:  β€’ Perineural spread along V2 / infraorbital nerve
      β€’ Cervical + retropharyngeal nodal spread if nasopharynx involved
      β€’ Coronal MRI: assess skull base / orbital invasion

4B. ADENOCARCINOMA (12.6%)

Site:   Ethmoid sinuses >> maxillary (intestinal-type associated with woodworking)
CT:     β€’ Lytic bone destruction
        β€’ Β± Calcifications (intestinal-type)
MRI:    β€’ T1: Isointense
        β€’ T2: Variable; hyperintense areas = mucin
        β€’ Heterogeneous enhancement
Key:    β€’ Intestinal-type (ITAC): woodworkers, leather workers β€” occupational link

4C. ADENOID CYSTIC CARCINOMA (AdCC)

Site:  Maxillary sinus, nasal cavity (10% of salivary gland cancers; 5% sinonasal)
CT:    β€’ Irregular, heterogeneous mass
       β€’ Foraminal enlargement β†’ perineural spread (V2, vidian nerve)
MRI:   β€’ T1: Isointense
       β€’ T2: Iso- to hyperintense (depends on cellularity)
       β€’ CE-T1: β˜… PERINEURAL TUMOR SPREAD (PNTS) = enlargement + enhancement 
         of affected nerve compared to contralateral side
Key:   β€’ PNTS is characteristic of AdCC; must trace V2 to pterygopalatine fossa
       β€’ Skip lesions possible along nerve
       β€’ Metastasizes to lung, liver, bone (late)

4D. SINONASAL UNDIFFERENTIATED CARCINOMA (SNUC)

Demographics: Rare, aggressive; 3–5% of sinonasal cancers
Site:  Superior nasal cavity and ethmoid sinus
CT:    β€’ Ill-defined, non-calcified mass
       β€’ Central necrosis on contrast CT β˜…
MRI:   β€’ T1: Isointense + heterogeneous contrast enhancement
       β€’ T2: Iso- to hyperintense
       β€’ Rapid local invasion (skull base, orbit, intracranial)
DWI:   β€’ Low ADC (highly cellular)
Key:   β€’ Very aggressive; presents late with extensive local invasion
SNUC multimodal imaging CT MRI PET

4E. ESTHESIONEUROBLASTOMA (Olfactory Neuroblastoma)

Demographics: Bimodal peaks (11–20 yrs, 50–60 yrs); incidence 0.4/million
Site:  Superior nasal cavity (olfactory epithelium), cribriform plate
CT:    β€’ Soft-tissue mass in superior nasal cavity
       β€’ Cribriform plate dehiscence / erosion
       β€’ Β± Calcifications
MRI:   β€’ T1: Hypointense
       β€’ T2: Hyperintense
       β€’ CE-T1: Moderate enhancement
       β€’ β˜… Intracranial extension with PERIPHERAL CYSTS at tumor-brain interface 
         (highly characteristic)
       β€’ Kadish staging guides extent
Key:   β€’ MRI essential for dural seeding, subarachnoid spread, intracranial extent
Kadish Staging:
A β€” Confined to nasal cavity
B β€” Extends to paranasal sinuses
C β€” Beyond sinuses (orbit, skull base, intracranial)
D β€” Cervical LN / distant metastasis

4F. SINONASAL MELANOMA

Site:  Nasal cavity (septum, lateral wall, inferior turbinate) >> paranasal sinuses
CT:    β€’ May remodel or destroy bone
       β€’ Non-specific soft-tissue mass
MRI (melanotic lesion β€” CLASSIC):
       β€’ T1: HYPERINTENSE (T1 shortening due to paramagnetic melanin) β˜…
       β€’ T2/STIR: HYPOINTENSE β˜…
       β€’ Enhancement: variable; may be hard to see in T1-bright lesion
MRI (amelanotic): signals non-specific
Key:   β€’ T1 bright + T2 dark = think melanoma (paramagnetic melanin)
       β€’ Worse prognosis than cutaneous melanoma

4G. SINONASAL LYMPHOMA (NK/T-cell or Diffuse Large B-cell)

Site:  Nasal cavity >> paranasal sinuses
CT:    β€’ Bulky, lobulated mass; slightly HYPERDENSE on NECT (high cellularity) β˜…
       β€’ Bone remodeling or destruction
MRI:   β€’ T1: Isointense to muscle
       β€’ T2/STIR: HYPOINTENSE (low signal β€” hallmark due to high nuclear:cytoplasmic ratio) β˜…
       β€’ CE-T1: Homogeneous enhancement (homogeneous cell population)
       β€’ Necrosis: UNCOMMON (more in NK subtype)
Key:   β€’ "Dense on CT + dark on T2" = think lymphoma
       β€’ NK/T-cell: midface destructive lesion ("lethal midline granuloma")

4H. RHABDOMYOSARCOMA

Demographics: Most common soft-tissue sarcoma in children
Site:  Nasal cavity, paranasal sinuses, nasopharynx
CT:    β€’ Aggressive bone destruction
       β€’ Homogeneous soft-tissue mass in children
MRI:   β€’ T1: Isointense
       β€’ T2: Hyperintense
       β€’ Moderate enhancement
Key:   β€’ Child + aggressive sinonasal mass + bone destruction = RMS until proven otherwise
       β€’ Orbital invasion common

4I. CHONDROSARCOMA / OSTEOSARCOMA

Chondrosarcoma:
CT:   β€’ "ARC AND RING" calcifications (chondroid matrix) β˜…
      β€’ Bone destruction + cartilage matrix
MRI:  β€’ T2: Hyperintense (lobulated, "bunch of grapes" pattern)

Osteosarcoma:
CT:   β€’ "SUNBURST" or "cloud-like" osteoid matrix β˜…
      β€’ Aggressive periosteal reaction
MRI:  β€’ T1/T2: Heterogeneous; low signal osteoid matrix

PART 5 β€” QUICK COMPARISON TABLE

TumorSiteCT KeyMRI KeyHallmark Sign
PolypBilateralLow attenuationT2 brightPeripheral enhancement
Inverted PapillomaLateral wallFocal hyperostosisCCP on T2/CE-T1Cerebriform pattern
OsteomaFrontal sinusDense bone / ground-glassLow T1/T2Ivory density
JNASphenopalatineIntense enhancementFlow voidsHolman-Miller sign
MucoceleFrontal sinusBony expansionVariable T1/T2No internal enhancement
SCCMaxillaryBone destructionT2 faint brightPNTS along V2
AdCCMaxillaryForaminal enlargementPNTS β˜…Perineural tracking
SNUCSuperior nasal/ethmoidCentral necrosisHeterogeneous CERapid invasion
ENBSuperior nasalCribriform erosionPeripheral cysts β˜…Intracranial cysts
MelanomaNasal cavityVariable boneT1 bright/T2 dark β˜…Paramagnetic melanin
LymphomaNasal cavityHyperdense NECTT2 hypointense β˜…Homogeneous CE
Fibrous DysplasiaAny sinusGround-glass β˜…VariableNo destruction
ChondrosarcomaSkull baseArc-and-ring Ca++T2 lobular brightChondroid matrix

PART 6 β€” SCHEMATIC DIAGNOSTIC APPROACH

             SINONASAL MASS ON IMAGING
                        β”‚
         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
       BILATERAL                   UNILATERAL
         β”‚                              β”‚
       BENIGN                    Evaluate features
     (Polyposis)                        β”‚
                        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                   Bone             Bone              Bone
                 remodeling       expansion         destruction
                    β”‚                β”‚                  β”‚
            IP / JNA /          Mucocele /           MALIGNANCY
           Schwannoma /        Fibrous Dysplasia     (SCC, SNUC,
           Pleomorphic          / Osteoma            Melanoma, etc.)
            adenoma                  
                        
                SPECIFIC MRI FEATURES NARROW DIAGNOSIS:
                β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                β”‚ CCP (cerebriform) β†’ Inverted Papilloma       β”‚
                β”‚ T1↑ / T2↓         β†’ Melanoma                β”‚
                β”‚ T2↓ / Homog. CE   β†’ Lymphoma                β”‚
                β”‚ PNTS              β†’ AdCC / SCC              β”‚
                β”‚ Peripheral cysts  β†’ Esthesioneuroblastoma    β”‚
                β”‚ Flow voids        β†’ JNA                     β”‚
                β”‚ Arc-ring Ca++     β†’ Chondrosarcoma          β”‚
                β”‚ Ground glass CT   β†’ Fibrous Dysplasia       β”‚
                β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

PART 7 β€” ROLE OF ADVANCED IMAGING

ModalityRole
DWI/ADCLow ADC β†’ malignancy (hypercellular); High ADC β†’ benign/mucus
Dynamic CE-MRIJNA: rapid arterial "flush" enhancement
18F-FDG PET-CTStaging, perineural spread, treatment response (SNUC, lymphoma)
CT AngiographyJNA: preoperative embolization planning
MR SpectroscopyResearch; choline peak in malignancy

PART 8 β€” PITFALLS IN SINONASAL IMAGING

  1. Obstructed secretions mimic tumor extension on CT β†’ MRI differentiates: secretions are T2 bright with no enhancement; tumor shows solid enhancement
  2. Fungal sinusitis can destroy bone and mimic malignancy
  3. Amelanotic melanoma loses the classic T1-bright appearance β†’ biopsy required
  4. Lymphoma can look deceptively "benign" with homogeneous enhancement β†’ T2 hypointensity is the clue
  5. IP malignant transformation β†’ loss of CCP + bone destruction = SCC within IP

Sources: Frontiers in Radiology 2024 (Nagornaya et al.); OAE Publishing 2024 (Imaging evaluation of sinonasal tract neoplasms); Applied Radiology (Sinonasal neoplasms: Update on classification); PMID 37149426; PMID 35833947This schematic is structured for a lecture format across 8 logical sections. Here's a quick orientation:
How to use this for your lecture:
  • Part 1–2 β†’ Opening framework: why CT first, MRI second, and the bone pattern discriminator β€” sets the diagnostic mindset
  • Part 3 β†’ Benign lesions (9 entities) with memorable hallmarks
  • Part 4 β†’ Malignant tumors (9 entities) with CT/MRI signatures
  • Part 5 β†’ Rapid-fire comparison table (excellent as a slide summary)
  • Part 6 β†’ The decision tree schematic β€” ideal as a single summary slide
  • Part 7–8 β†’ Advanced imaging roles + pitfalls (good for discussion/MCQ)
High-yield mnemonics to highlight:
  • Cerebriform pattern on MRI β†’ Inverted Papilloma
  • T1 bright / T2 dark β†’ Melanoma (paramagnetic melanin)
  • T2 dark + dense CT + homogeneous CE β†’ Lymphoma
  • PNTS along V2 β†’ Adenoid Cystic Carcinoma
  • Peripheral intracranial cysts β†’ Esthesioneuroblastoma
  • Flow voids + adolescent male β†’ JNA
  • Ground-glass CT β†’ Fibrous Dysplasia
  • Arc-and-ring calcifications β†’ Chondrosarcoma

Create a PowerPoint presentation with schematic diagrams and imaging examples for your lecture

Reading File
Reading File
Reading File
Now let me search for relevant imaging examples and then build the presentation.
Searching Images

inverted papilloma cerebriform pattern MRI nasal cavity

Searching Images

esthesioneuroblastoma olfactory neuroblastoma MRI intracranial cysts

Searching Images

juvenile nasopharyngeal angiofibroma CT MRI flow voids

Searching Images

sinonasal squamous cell carcinoma maxillary sinus bone destruction CT

Running Command

ls /home/daytona/workspace/ 2>/dev/null || echo "workspace empty or doesn't exist"

Excellent imaging found. Now let me get more images and build the presentation.
Searching Images

sinonasal melanoma T1 hyperintense T2 hypointense MRI nasal cavity

Searching Images

sinonasal lymphoma nasal cavity CT hyperdense T2 hypointense MRI

Searching Images

nasal polyp mucocele frontal sinus CT expansion

Searching Images

adenoid cystic carcinoma sinonasal perineural spread MRI

I have all the images I need. Now let me build the full presentation.
Running Command

mkdir -p /home/daytona/workspace/sinonasal-pptx && ls /home/daytona/workspace/sinonasal-pptx/

Writing File

~/sinonasal-pptx/build.js

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

// ─── Fetch images ────────────────────────────────────────────────────────────
const imageUrls = [
  // [0] Inverted papilloma cerebriform
  "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_ded7169a4885c5d69adf8f03e62868a2d88a397a0b6e1ee09dac0eb8a8d57487.jpg",
  // [1] Inverted papilloma CT + MRI
  "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_bde8eaf3031d0d80eeefbbd5dd53f73861d952978d4bc3487e754fc9fd2d02eb.jpg",
  // [2] Esthesioneuroblastoma dumbbell cysts
  "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_1b87b71d39e0947ca73a89d0d9727a4142571e24adf81b9fedb7621ce63b4fa8.jpg",
  // [3] JNA MRI flow voids + CT vidian canal
  "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_cd50b17ede7b0f003a6310c59c9c4099cca6ac4dfe0b5b6c48a4e9848a2bf087.jpg",
  // [4] SCC maxillary bone destruction CT
  "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_dfb37d17393643e7d5f537160478e595274dc3c6289968f86daec5f1729d1e87.jpg",
  // [5] SCC perineural spread CT+MRI
  "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_9fc7da93295344f1205fc722b106e9ca83801d2279f3a264f1d4f5e5622e02b6.jpg",
  // [6] Adenoid cystic carcinoma perineural spread
  "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_037cfc460b5de82999c553761b0048771c6200e83407aedde531634fa38469e4.jpg",
  // [7] SNUC multimodal CT MRI PET
  "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_235565862e4529fc77b943f06415b46246496d0e336cb7424435b70c3028634a.jpg",
  // [8] Melanoma T1 bright T2 variable MRI
  "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_a56303c2640f1f7d0cc9bb94169c3dcd4c261203e0fce3131cf86cb5f651e868.jpg",
  // [9] Lymphoma T2 hypointense homogeneous CE
  "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_361a5848643447cd3966ad3b3d0cedeb94494b24ff5828e74fcfad40b8f607da.jpg",
  // [10] Mucocele frontal sinus CT
  "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_69a1f783bdd2819cb3e569adf32df5d50a1176d6ba638f4fca8b904cf6983da8.jpg",
  // [11] ENB Kadish C sagittal T1
  "https://cdn.orris.care/cdss_images/roco_radiology_ROCO_39467_1766648326045.png",
];

console.log("Fetching images...");
const fetched = JSON.parse(
  execSync(
    `node /home/daytona/skills/shared/scripts/fetch_images.js ${imageUrls.map(u => `"${u}"`).join(" ")}`
  ).toString()
);
console.log(`Fetched ${fetched.filter(f => !f.error).length}/${fetched.length} images`);

// ─── Palette ─────────────────────────────────────────────────────────────────
const C = {
  dark:    "0B1E3D",  // deep navy
  mid:     "1A3A6B",  // mid navy
  accent:  "E84B3C",  // medical red
  gold:    "F5A623",  // highlight gold
  teal:    "00A8A8",  // teal
  white:   "FFFFFF",
  offwhite:"F0F4F8",
  text:    "1A1A2E",
  light:   "8FAEC7",  // light steel blue
  green:   "2ECC71",
  orange:  "E67E22",
};

function img(idx) {
  return fetched[idx] && !fetched[idx].error ? fetched[idx].base64 : null;
}

// ─── Presentation ────────────────────────────────────────────────────────────
const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.author = "Radiology Lecture";
pres.title = "Radiological Features of Sinonasal Tumors";

// ══════════════════════════════════════════════════════════════
// SLIDE 1 β€” TITLE
// ══════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  // Deep navy background
  s.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:10, h:5.625, fill:{color: C.dark}, line:{color:C.dark} });
  // Red accent bar left
  s.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:0.35, h:5.625, fill:{color: C.accent}, line:{color:C.accent} });
  // Subtle grid pattern top right
  s.addShape(pres.shapes.RECTANGLE, { x:6.5, y:0, w:3.5, h:2.8, fill:{color:C.mid, transparency:60}, line:{color:C.mid, transparency:60} });

  s.addText("RADIOLOGICAL FEATURES OF", {
    x:0.6, y:0.8, w:9, h:0.55,
    fontSize:16, bold:false, color:C.light, fontFace:"Calibri",
    charSpacing:5, align:"left"
  });
  s.addText("SINONASAL TUMORS", {
    x:0.6, y:1.3, w:9, h:1.1,
    fontSize:44, bold:true, color:C.white, fontFace:"Calibri",
    align:"left"
  });
  s.addText("& Benign Sinonasal Growths", {
    x:0.6, y:2.35, w:9, h:0.55,
    fontSize:24, bold:false, color:C.gold, fontFace:"Calibri", align:"left"
  });

  // Divider
  s.addShape(pres.shapes.RECTANGLE, { x:0.6, y:3.05, w:8.5, h:0.04, fill:{color:C.teal}, line:{color:C.teal} });

  s.addText("A Schematic Approach", {
    x:0.6, y:3.2, w:5, h:0.4,
    fontSize:14, bold:false, color:C.light, fontFace:"Calibri", align:"left"
  });
  s.addText("Radiology / Otolaryngology Lecture", {
    x:0.6, y:3.65, w:9, h:0.35,
    fontSize:12, color:C.light, fontFace:"Calibri", align:"left"
  });

  // Decorative circles
  s.addShape(pres.shapes.OVAL, { x:8.2, y:3.5, w:1.8, h:1.8, fill:{color:C.accent, transparency:80}, line:{color:C.accent, transparency:80} });
  s.addShape(pres.shapes.OVAL, { x:7.6, y:4.0, w:2.4, h:1.6, fill:{color:C.teal, transparency:85}, line:{color:C.teal, transparency:85} });
}

// ══════════════════════════════════════════════════════════════
// SLIDE 2 β€” AGENDA / TABLE OF CONTENTS
// ══════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:10, h:5.625, fill:{color:C.offwhite}, line:{color:C.offwhite} });
  s.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:10, h:0.85, fill:{color:C.dark}, line:{color:C.dark} });
  s.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:0.35, h:5.625, fill:{color:C.accent}, line:{color:C.accent} });

  s.addText("LECTURE OUTLINE", {
    x:0.6, y:0.15, w:9, h:0.55,
    fontSize:22, bold:true, color:C.white, fontFace:"Calibri"
  });

  const items = [
    ["01", "Imaging Strategy: CT vs MRI", "When & why to use each modality"],
    ["02", "Bone Involvement Patterns", "The key diagnostic discriminator"],
    ["03", "Benign Sinonasal Growths", "Polyps Β· IP Β· Osteoma Β· JNA Β· Mucocele Β· Schwannoma"],
    ["04", "Malignant Epithelial Tumors", "SCC Β· Adenocarcinoma Β· AdCC Β· SNUC"],
    ["05", "Malignant Non-Epithelial Tumors", "ENB Β· Melanoma Β· Lymphoma Β· Rhabdomyosarcoma"],
    ["06", "Schematic Decision Tree", "Algorithm for radiological diagnosis"],
    ["07", "Quick Reference Table", "Hallmark signs at a glance"],
    ["08", "Pitfalls & Advanced Imaging", "DWI, PET-CT, perineural spread"],
  ];

  items.forEach(([num, title, sub], i) => {
    const col = i < 4 ? 0 : 1;
    const row = i % 4;
    const x = col === 0 ? 0.5 : 5.2;
    const y = 1.1 + row * 1.05;

    s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
      x, y, w:4.5, h:0.88,
      fill:{color: col===0 ? C.mid : C.dark},
      line:{color: col===0 ? C.mid : C.dark},
      rectRadius:0.05,
      shadow:{type:"outer", color:"000000", blur:4, offset:2, angle:135, opacity:0.12}
    });
    s.addShape(pres.shapes.RECTANGLE, {
      x, y, w:0.48, h:0.88,
      fill:{color: C.accent}, line:{color:C.accent}
    });
    s.addText(num, {
      x, y, w:0.48, h:0.88,
      fontSize:13, bold:true, color:C.white, fontFace:"Calibri",
      align:"center", valign:"middle", margin:0
    });
    s.addText(title, {
      x: x+0.55, y: y+0.06, w:3.85, h:0.34,
      fontSize:11, bold:true, color:C.white, fontFace:"Calibri",
      margin:0
    });
    s.addText(sub, {
      x: x+0.55, y: y+0.46, w:3.85, h:0.28,
      fontSize:8.5, color:C.light, fontFace:"Calibri",
      italic:true, margin:0
    });
  });
}

// ══════════════════════════════════════════════════════════════
// SLIDE 3 β€” IMAGING STRATEGY
// ══════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:10, h:5.625, fill:{color:C.dark}, line:{color:C.dark} });
  s.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:10, h:0.75, fill:{color:C.mid}, line:{color:C.mid} });
  s.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:0.35, h:5.625, fill:{color:C.accent}, line:{color:C.accent} });

  s.addText("IMAGING STRATEGY: CT vs MRI", {
    x:0.6, y:0.12, w:9, h:0.5,
    fontSize:20, bold:true, color:C.white, fontFace:"Calibri"
  });

  // CT box
  s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
    x:0.55, y:0.95, w:4.3, h:3.95,
    fill:{color:C.mid}, line:{color:C.teal, pt:2},
    rectRadius:0.12
  });
  s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
    x:0.55, y:0.95, w:4.3, h:0.52,
    fill:{color:C.teal}, line:{color:C.teal},
    rectRadius:0.12
  });
  // fix rounded top corners visible underneath
  s.addShape(pres.shapes.RECTANGLE, {
    x:0.55, y:1.2, w:4.3, h:0.27,
    fill:{color:C.teal}, line:{color:C.teal}
  });

  s.addText("CT  β€”  FIRST LINE", {
    x:0.65, y:0.98, w:4.1, h:0.44,
    fontSize:14, bold:true, color:C.dark, fontFace:"Calibri",
    align:"center", valign:"middle", margin:0
  });

  const ctPoints = [
    "Define site of origin",
    "Bony remodeling vs. destruction",
    "Intralesional calcifications / tumor matrix",
    "Identify feeding arteries",
    "Detect cervical lymphadenopathy",
    "Screen β€” mimics sinusitis initially",
  ];
  s.addText(ctPoints.map((t,i)=>({ text:"β–Έ  "+t, options:{breakLine:i<ctPoints.length-1, color:C.white, fontSize:11} })),{
    x:0.75, y:1.58, w:3.95, h:3.1,
    fontFace:"Calibri", valign:"top"
  });

  // MRI box
  s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
    x:5.15, y:0.95, w:4.3, h:3.95,
    fill:{color:C.mid}, line:{color:C.gold, pt:2},
    rectRadius:0.12
  });
  s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
    x:5.15, y:0.95, w:4.3, h:0.52,
    fill:{color:C.gold}, line:{color:C.gold},
    rectRadius:0.12
  });
  s.addShape(pres.shapes.RECTANGLE, {
    x:5.15, y:1.2, w:4.3, h:0.27,
    fill:{color:C.gold}, line:{color:C.gold}
  });

  s.addText("MRI  β€”  PROBLEM SOLVING", {
    x:5.25, y:0.98, w:4.1, h:0.44,
    fontSize:14, bold:true, color:C.dark, fontFace:"Calibri",
    align:"center", valign:"middle", margin:0
  });

  const mriPoints = [
    "Superior soft-tissue differentiation",
    "Tumor extent mapping",
    "Tumor vs. obstructed secretions",
    "Perineural tumor spread (PNTS)",
    "Intracranial / orbital extension",
    "DWI/ADC: ↑ benign/mucus  |  ↓ malignant",
  ];
  s.addText(mriPoints.map((t,i)=>({ text:"β–Έ  "+t, options:{breakLine:i<mriPoints.length-1, color:C.white, fontSize:11} })),{
    x:5.3, y:1.58, w:3.95, h:3.1,
    fontFace:"Calibri", valign:"top"
  });

  // Arrow between
  s.addShape(pres.shapes.RECTANGLE, { x:4.87, y:2.65, w:0.26, h:0.04, fill:{color:C.accent}, line:{color:C.accent} });
  s.addText("β†’", { x:4.83, y:2.42, w:0.34, h:0.35, fontSize:20, color:C.accent, align:"center", bold:true });

  // Bottom note
  s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
    x:0.55, y:5.0, w:8.9, h:0.45,
    fill:{color:C.accent, transparency:20}, line:{color:C.accent},
    rectRadius:0.06
  });
  s.addText("KEY: Unilateral disease  |  Bone destruction  |  Necrosis  |  Extensive soft-tissue mass  |  Lymphadenopathy  β†’  SUSPECT MALIGNANCY", {
    x:0.65, y:5.0, w:8.7, h:0.45,
    fontSize:9.5, bold:true, color:C.white, fontFace:"Calibri",
    align:"center", valign:"middle", margin:0
  });
}

// ══════════════════════════════════════════════════════════════
// SLIDE 4 β€” BONE PATTERNS
// ══════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:10, h:5.625, fill:{color:"F7F9FC"}, line:{color:"F7F9FC"} });
  s.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:10, h:0.72, fill:{color:C.dark}, line:{color:C.dark} });
  s.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:0.35, h:5.625, fill:{color:C.accent}, line:{color:C.accent} });

  s.addText("PATTERNS OF BONY INVOLVEMENT β€” The Key Discriminator", {
    x:0.6, y:0.12, w:9, h:0.48,
    fontSize:18, bold:true, color:C.white, fontFace:"Calibri"
  });

  const patterns = [
    { label:"BONE\nDESTRUCTION", color:C.accent, sub:"Aggressive erosion of cortex", assoc:"SCC Β· SNUC Β· Melanoma\nOsteomyelitis Β· Invasive Fungal Sinusitis", icon:"πŸ’€" },
    { label:"BONE\nREMODELING", color:C.teal, sub:"Smooth expansion / dehiscence", assoc:"Mucocele Β· Polyp\nInverted Papilloma Β· Schwannoma\nCephalocele", icon:"πŸ”„" },
    { label:"REACTIVE\nSCLEROSIS", color:C.gold, sub:"New bone / ivory density", assoc:"Chronic infection\nOsteoma · Fibrous Dysplasia", icon:"🦴" },
    { label:"FOCAL\nHYPEROSTOSIS", color:"6C3BAA", sub:"At tumor attachment site", assoc:"β˜… INVERTED PAPILLOMA\n(pathognomonic)", icon:"πŸ“" },
  ];

  patterns.forEach(({label,color,sub,assoc,icon},i)=>{
    const x = 0.55 + i*2.35;
    s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
      x, y:0.85, w:2.2, h:4.55,
      fill:{color:C.dark}, line:{color, pt:2},
      rectRadius:0.1,
      shadow:{type:"outer", color:"000000", blur:6, offset:2, angle:135, opacity:0.15}
    });
    s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
      x, y:0.85, w:2.2, h:0.55,
      fill:{color}, line:{color},
      rectRadius:0.1
    });
    s.addShape(pres.shapes.RECTANGLE, {
      x, y:1.08, w:2.2, h:0.32,
      fill:{color}, line:{color}
    });
    s.addText(label, {
      x: x+0.05, y:0.87, w:2.1, h:0.51,
      fontSize:11, bold:true, color:C.dark, fontFace:"Calibri",
      align:"center", valign:"middle", margin:0
    });
    s.addText(icon, {
      x: x+0.6, y:1.56, w:1.0, h:0.6,
      fontSize:28, align:"center"
    });
    s.addText(sub, {
      x: x+0.08, y:2.22, w:2.04, h:0.45,
      fontSize:9, color:C.light, fontFace:"Calibri",
      italic:true, align:"center"
    });
    s.addShape(pres.shapes.RECTANGLE, {
      x:x+0.2, y:2.72, w:1.8, h:0.03,
      fill:{color, transparency:40}, line:{color, transparency:40}
    });
    s.addText("ASSOCIATED WITH:", {
      x: x+0.08, y:2.8, w:2.04, h:0.3,
      fontSize:8, bold:true, color, fontFace:"Calibri", align:"center"
    });
    s.addText(assoc, {
      x: x+0.08, y:3.12, w:2.04, h:2.0,
      fontSize:9.5, color:C.white, fontFace:"Calibri",
      align:"center", valign:"top"
    });
  });
}

// ══════════════════════════════════════════════════════════════
// SLIDE 5 β€” BENIGN: POLYPS & INVERTED PAPILLOMA
// ══════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:10, h:5.625, fill:{color:C.dark}, line:{color:C.dark} });
  s.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:10, h:0.72, fill:{color:"1B4D8E"}, line:{color:"1B4D8E"} });
  s.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:0.35, h:5.625, fill:{color:C.teal}, line:{color:C.teal} });

  s.addText("BENIGN GROWTHS β€” Polyps & Inverted Papilloma", {
    x:0.6, y:0.12, w:9.2, h:0.48,
    fontSize:18, bold:true, color:C.white, fontFace:"Calibri"
  });

  // Left column β€” Polyp
  s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
    x:0.5, y:0.85, w:4.5, h:4.62,
    fill:{color:C.mid}, line:{color:C.teal, pt:1.5},
    rectRadius:0.1
  });
  s.addShape(pres.shapes.RECTANGLE, {
    x:0.5, y:0.85, w:4.5, h:0.44,
    fill:{color:C.teal}, line:{color:C.teal}
  });
  s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
    x:0.5, y:0.85, w:4.5, h:0.44,
    fill:{color:C.teal}, line:{color:C.teal}, rectRadius:0.1
  });
  s.addText("SINONASAL POLYPS", {
    x:0.55, y:0.87, w:4.4, h:0.4,
    fontSize:12, bold:true, color:C.dark, fontFace:"Calibri",
    align:"center", valign:"middle", margin:0
  });

  const polypData = [
    ["CT", "β€’ Bilateral, multiple, low-attenuation\nβ€’ Expand sinus β†’ remodel bone (not destroy)\nβ€’ Mucosal thickening background"],
    ["MRI", "β€’ T1: Low signal\nβ€’ T2: Hyperintense (high water content)\nβ€’ Enhancement: Peripheral rim ONLY (not solid)"],
    ["KEY RULE", "BILATERAL = think benign polyposis\nUNILATERAL = must exclude neoplasm!"],
  ];
  let py = 1.42;
  polypData.forEach(([lbl, txt]) => {
    const lc = lbl==="KEY RULE" ? C.gold : C.teal;
    s.addShape(pres.shapes.RECTANGLE, { x:0.6, y:py, w:0.8, h:0.28, fill:{color:lc}, line:{color:lc} });
    s.addText(lbl, { x:0.6, y:py, w:0.8, h:0.28, fontSize:8, bold:true, color:C.dark, align:"center", valign:"middle", fontFace:"Calibri", margin:0 });
    s.addText(txt, { x:1.5, y:py, w:3.35, h:0.62, fontSize:9.5, color:C.white, fontFace:"Calibri", valign:"top" });
    py += 0.72;
  });

  s.addShape(pres.shapes.RECTANGLE, { x:0.6, y:3.2, w:4.25, h:0.03, fill:{color:C.teal,transparency:50}, line:{color:C.teal,transparency:50} });

  s.addText("ANTROCHOANAL POLYP", {
    x:0.6, y:3.3, w:3.8, h:0.3,
    fontSize:10, bold:true, color:C.gold, fontFace:"Calibri"
  });
  s.addText('β€’ Unilateral "dumbbell" through posterior choana\nβ€’ Arises in maxillary sinus β†’ exits via accessory ostium\nβ€’ T2 hyperintense Β· Peripheral enhancement (vs. solid in IP)\nβ€’ Young patients; NO bone destruction', {
    x:0.6, y:3.64, w:4.3, h:1.0,
    fontSize:9.5, color:C.white, fontFace:"Calibri"
  });

  // Right column β€” Inverted Papilloma
  s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
    x:5.1, y:0.85, w:4.75, h:4.62,
    fill:{color:C.mid}, line:{color:C.gold, pt:1.5},
    rectRadius:0.1
  });
  s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
    x:5.1, y:0.85, w:4.75, h:0.44,
    fill:{color:C.gold}, line:{color:C.gold}, rectRadius:0.1
  });
  s.addShape(pres.shapes.RECTANGLE, {
    x:5.1, y:1.0, w:4.75, h:0.29,
    fill:{color:C.gold}, line:{color:C.gold}
  });
  s.addText("INVERTED PAPILLOMA  β˜…", {
    x:5.15, y:0.87, w:4.6, h:0.4,
    fontSize:12, bold:true, color:C.dark, fontFace:"Calibri",
    align:"center", valign:"middle", margin:0
  });

  const ipData = [
    ["SITE", "Lateral nasal wall → middle turbinate\n→ ethmoid/maxillary sinuses"],
    ["CT", "β€’ Soft-tissue mass, bony REMODELING\nβ€’ FOCAL HYPEROSTOSIS at base β˜…\nβ€’ Β± Intralesional calcifications"],
    ["MRI", "β€’ T1: Iso- to hypointense\nβ€’ T2: Hyperintense to muscle\nβ€’ β˜… CONVOLUTED CEREBRIFORM\n  PATTERN (CCP) β€” 80% of cases"],
    ["RISK", "10% malignant β†’ SCC\nLoss of CCP + bone destruction\n= malignant transformation"],
  ];
  let ipy = 1.42;
  ipData.forEach(([lbl,txt]) => {
    const lc = lbl==="RISK" ? C.accent : C.gold;
    s.addShape(pres.shapes.RECTANGLE, { x:5.2, y:ipy, w:0.8, h:0.28, fill:{color:lc}, line:{color:lc} });
    s.addText(lbl, { x:5.2, y:ipy, w:0.8, h:0.28, fontSize:8, bold:true, color:C.dark, align:"center", valign:"middle", fontFace:"Calibri", margin:0 });
    const lines = txt.split("\n").length;
    const h = Math.max(0.54, lines * 0.26);
    s.addText(txt, { x:6.08, y:ipy, w:3.65, h:h, fontSize:9.5, color:C.white, fontFace:"Calibri", valign:"top" });
    ipy += Math.max(0.7, h + 0.15);
  });

  // Image - Inverted Papilloma
  if (img(0)) {
    s.addImage({ data:img(0), x:5.2, y:4.05, w:4.5, h:1.35, altText:"Inverted Papilloma cerebriform MRI" });
    s.addText("β–² Inverted Papilloma: Cerebriform pattern on CE-T1 MRI", {
      x:5.2, y:5.38, w:4.5, h:0.18,
      fontSize:6.5, italic:true, color:C.light, fontFace:"Calibri"
    });
  }
}

// ══════════════════════════════════════════════════════════════
// SLIDE 6 β€” BENIGN: OSTEOMA, FIBROUS DYSPLASIA, MUCOCELE, SCHWANNOMA
// ══════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:10, h:5.625, fill:{color:"F7F9FC"}, line:{color:"F7F9FC"} });
  s.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:10, h:0.72, fill:{color:C.dark}, line:{color:C.dark} });
  s.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:0.35, h:5.625, fill:{color:C.teal}, line:{color:C.teal} });

  s.addText("BENIGN SINONASAL GROWTHS β€” Osseous, Mucocele & Neural", {
    x:0.6, y:0.12, w:9, h:0.48,
    fontSize:18, bold:true, color:C.white, fontFace:"Calibri"
  });

  const lesions = [
    {
      name:"OSTEOMA",
      color:"3A9BD5",
      site:"Frontal sinus (most common)",
      ct:"Dense cortical (ivory) OR ground-glass\nWell-defined, homogeneous",
      mri:"T1/T2: Low signal (cortical bone)\nMild post-contrast enhancement",
      key:"Most common benign sinonasal tumor\nMay obstruct drainage; usually incidental",
    },
    {
      name:"FIBROUS DYSPLASIA",
      color:"9B59B6",
      site:"Any sinus; may narrow nasal cavity",
      ct:"β˜… GROUND-GLASS matrix β€” HALLMARK\nExpansile, no periosteal reaction",
      mri:"Variable signal (fibrous vs. cystic)\nMild heterogeneous enhancement\nPrimary diagnosis = CT",
      key:"No malignant potential\nMonostotic > polyostotic",
    },
    {
      name:"MUCOCELE",
      color:C.gold,
      site:"Frontal > ethmoid > maxillary",
      ct:"Smooth expansile opacification\nBony remodeling (NOT destruction)\nDensity ↑ with protein content",
      mri:"T1: variable (lowβ†’high with protein)\nT2: highβ†’low (inversely)\nNO internal enhancement β˜…",
      key:"Scalloped sinus expansion is hallmark\nWall may enhance; no solid component",
    },
    {
      name:"SCHWANNOMA",
      color:C.green,
      site:"Nasal cavity, ethmoid",
      ct:"Low-attenuation / near-cystic\nSmooth foraminal enlargement",
      mri:"T2: Bubbly hyperintense; cysts in large\nEnhancement: whorled pattern\nExcellent prognosis",
      key:"Nerve sheath origin\nSurgical excision curative",
    },
  ];

  lesions.forEach(({name,color,site,ct,mri,key}, i) => {
    const col = i % 2;
    const row = Math.floor(i/2);
    const x = col===0 ? 0.45 : 5.15;
    const y = 0.88 + row*2.35;

    s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
      x, y, w:4.55, h:2.18,
      fill:{color:"FFFFFF"}, line:{color, pt:2},
      rectRadius:0.08,
      shadow:{type:"outer", color:"000000", blur:5, offset:2, angle:135, opacity:0.1}
    });
    s.addShape(pres.shapes.RECTANGLE, {
      x, y, w:4.55, h:0.38,
      fill:{color}, line:{color}
    });
    s.addText(name, {
      x:x+0.08, y:y+0.04, w:4.38, h:0.3,
      fontSize:12, bold:true, color:C.white, fontFace:"Calibri",
      valign:"middle", margin:0
    });
    s.addText([
      {text:"πŸ“ "+site+"\n", options:{bold:true, color:"333333", fontSize:9}},
      {text:"CT: ", options:{bold:true, color, fontSize:9}},
      {text:ct+"\n", options:{color:"333333", fontSize:9}},
      {text:"MRI: ", options:{bold:true, color:"8B44CC", fontSize:9}},
      {text:mri+"\n", options:{color:"333333", fontSize:9}},
      {text:"β˜… "+key, options:{italic:true, color:"666666", fontSize:8.5}},
    ], {
      x:x+0.1, y:y+0.43, w:4.35, h:1.72,
      fontFace:"Calibri", valign:"top"
    });
  });

  // Mucocele image bottom right
  if (img(10)) {
    s.addImage({ data:img(10), x:7.15, y:4.62, w:2.6, h:0.85, altText:"Frontal mucocele CT MRI" });
    s.addText("β–² Frontal sinus mucocele: expansion + no internal enhancement", {
      x:5.2, y:5.5, w:4.6, h:0.12,
      fontSize:6.5, italic:true, color:"666666", fontFace:"Calibri"
    });
  }
}

// ══════════════════════════════════════════════════════════════
// SLIDE 7 β€” JNA
// ══════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:10, h:5.625, fill:{color:C.dark}, line:{color:C.dark} });
  s.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:10, h:0.72, fill:{color:"8B1A1A"}, line:{color:"8B1A1A"} });
  s.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:0.35, h:5.625, fill:{color:C.accent}, line:{color:C.accent} });

  s.addText("JUVENILE NASOPHARYNGEAL ANGIOFIBROMA (JNA)", {
    x:0.6, y:0.12, w:9, h:0.48,
    fontSize:18, bold:true, color:C.white, fontFace:"Calibri"
  });

  // Demographics banner
  s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
    x:0.5, y:0.88, w:9, h:0.45,
    fill:{color:C.accent, transparency:25}, line:{color:C.accent},
    rectRadius:0.06
  });
  s.addText("πŸ‘¨ ADOLESCENT MALES  |  Site: Sphenopalatine foramen β†’ Nasopharynx  |  ⚠️ DO NOT BIOPSY β€” risk of massive haemorrhage", {
    x:0.6, y:0.88, w:8.8, h:0.45,
    fontSize:10, bold:true, color:C.white, fontFace:"Calibri",
    align:"center", valign:"middle", margin:0
  });

  // Features table
  const jnaRows = [
    ["CT", C.teal, "Intense early arterial enhancement\nHolman-Miller sign: anterior bowing of posterior antral wall β˜…\nVidian canal enlargement on CT"],
    ["MRI", "9B59B6", "T1: Intermediate signal\nT2: Intermediate-high + FLOW VOIDS (feeding vessels) β˜…\nIntense, homogeneous enhancement\n'Salt and pepper' pattern (large tumors)"],
    ["ANGIOGRAPHY", C.gold, "Preoperative embolization mandatory\nSupply from external carotid (internal maxillary artery)\nInternal carotid involvement in intracranial extension"],
    ["STAGING", C.green, "Radkowski / Andrews classification\nStage I: Limited to nasopharynx\nStage II: Pterygomaxillary / infratemporal involvement\nStage III: Intracranial extension"],
  ];

  jnaRows.forEach(([lbl, color, text], i) => {
    const y = 1.48 + i * 0.94;
    s.addShape(pres.shapes.RECTANGLE, { x:0.5, y, w:1.4, h:0.72, fill:{color}, line:{color} });
    s.addText(lbl, { x:0.5, y, w:1.4, h:0.72, fontSize:10, bold:true, color:C.dark, fontFace:"Calibri", align:"center", valign:"middle", margin:0 });
    s.addShape(pres.shapes.RECTANGLE, { x:1.9, y, w:5.0, h:0.72, fill:{color:C.mid}, line:{color:C.mid} });
    s.addText(text, { x:2.0, y:y+0.04, w:4.82, h:0.64, fontSize:9.5, color:C.white, fontFace:"Calibri", valign:"top" });
  });

  // Image
  if (img(3)) {
    s.addImage({ data:img(3), x:7.05, y:1.48, w:2.75, h:3.7, altText:"JNA MRI flow voids CT vidian canal" });
    s.addText("JNA: flow voids on MRI + vidian canal enlargement on CT", {
      x:7.05, y:5.2, w:2.75, h:0.22,
      fontSize:7, italic:true, color:C.light, fontFace:"Calibri", align:"center"
    });
  }
}

// ══════════════════════════════════════════════════════════════
// SLIDE 8 β€” MALIGNANT: SCC + ADENOCARCINOMA
// ══════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:10, h:5.625, fill:{color:"0D0D0D"}, line:{color:"0D0D0D"} });
  s.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:10, h:0.72, fill:{color:"7A0000"}, line:{color:"7A0000"} });
  s.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:0.35, h:5.625, fill:{color:C.accent}, line:{color:C.accent} });

  s.addText("MALIGNANT EPITHELIAL β€” SCC & Adenocarcinoma", {
    x:0.6, y:0.12, w:9, h:0.48,
    fontSize:18, bold:true, color:C.white, fontFace:"Calibri"
  });

  // SCC
  s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
    x:0.45, y:0.83, w:5.2, h:4.65,
    fill:{color:"1A0000"}, line:{color:C.accent, pt:2},
    rectRadius:0.1
  });
  s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
    x:0.45, y:0.83, w:5.2, h:0.5,
    fill:{color:C.accent}, line:{color:C.accent}, rectRadius:0.1
  });
  s.addShape(pres.shapes.RECTANGLE, { x:0.45, y:1.06, w:5.2, h:0.27, fill:{color:C.accent}, line:{color:C.accent} });
  s.addText("SQUAMOUS CELL CARCINOMA  (51.6%)", {
    x:0.55, y:0.85, w:5.0, h:0.44,
    fontSize:12, bold:true, color:C.white, fontFace:"Calibri",
    align:"center", valign:"middle", margin:0
  });

  const sccText = [
    ["SITE", "Maxillary sinus (most common malignancy site)"],
    ["CT", "Aggressive bone DESTRUCTION β˜…\nHeterogeneous mass Β± necrosis\nCalcification rare"],
    ["MRI T1", "Isointense (non-specific)"],
    ["MRI T2", "Faintly hyperintense to muscle"],
    ["CE-MRI", "Moderate heterogeneous enhancement"],
    ["DWI", "Low ADC β€” hypercellular"],
    ["PNTS", "V2 β†’ pterygopalatine fossa β†’ foramen rotundum β†’ Meckel's cave"],
    ["NODES", "Retropharyngeal + cervical if nasopharynx involved"],
  ];
  let sccY = 1.46;
  sccText.forEach(([lbl,val])=>{
    s.addShape(pres.shapes.RECTANGLE, { x:0.55, y:sccY, w:0.85, h:0.26, fill:{color:C.accent, transparency:30}, line:{color:C.accent} });
    s.addText(lbl, { x:0.55, y:sccY, w:0.85, h:0.26, fontSize:8, bold:true, color:C.white, fontFace:"Calibri", align:"center", valign:"middle", margin:0 });
    s.addText(val, { x:1.48, y:sccY+0.02, w:3.98, h:0.5, fontSize:9.5, color:C.white, fontFace:"Calibri", valign:"top" });
    sccY += val.includes("\n") ? 0.58 : 0.38;
  });

  if(img(4)){
    s.addImage({ data:img(4), x:0.5, y:4.42, w:2.4, h:1.0, altText:"SCC maxillary CT" });
    s.addText("SCC: bone destruction, maxillary sinus", { x:0.5, y:5.44, w:2.4, h:0.14, fontSize:6.5, italic:true, color:C.light, fontFace:"Calibri" });
  }
  if(img(5)){
    s.addImage({ data:img(5), x:3.0, y:4.42, w:2.5, h:1.0, altText:"SCC perineural spread CT MRI" });
    s.addText("SCC: perineural spread along V2", { x:3.0, y:5.44, w:2.5, h:0.14, fontSize:6.5, italic:true, color:C.light, fontFace:"Calibri" });
  }

  // Adenocarcinoma
  s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
    x:5.78, y:0.83, w:4.02, h:4.65,
    fill:{color:"001A1A"}, line:{color:C.teal, pt:2},
    rectRadius:0.1
  });
  s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
    x:5.78, y:0.83, w:4.02, h:0.5,
    fill:{color:C.teal}, line:{color:C.teal}, rectRadius:0.1
  });
  s.addShape(pres.shapes.RECTANGLE, { x:5.78, y:1.06, w:4.02, h:0.27, fill:{color:C.teal}, line:{color:C.teal} });
  s.addText("ADENOCARCINOMA  (12.6%)", {
    x:5.85, y:0.85, w:3.85, h:0.44,
    fontSize:11, bold:true, color:C.dark, fontFace:"Calibri",
    align:"center", valign:"middle", margin:0
  });

  const adText = [
    ["SITE", "Ethmoid >> maxillary\nIntestinal-type (ITAC) β€” woodworkers β˜…"],
    ["CT", "Lytic bone destruction\nΒ± Calcifications (ITAC)"],
    ["MRI T2", "Variable; hyperintense areas = mucin"],
    ["CE-MRI", "Heterogeneous enhancement"],
    ["ADC", "Low (hypercellular)"],
    ["SPECIAL", "ITAC occupational link:\nWoodworkers, leather workers,\nnickel/chromate exposure"],
  ];
  let adY = 1.46;
  adText.forEach(([lbl,val])=>{
    s.addShape(pres.shapes.RECTANGLE, { x:5.88, y:adY, w:0.85, h:0.26, fill:{color:C.teal, transparency:30}, line:{color:C.teal} });
    s.addText(lbl, { x:5.88, y:adY, w:0.85, h:0.26, fontSize:8, bold:true, color:C.dark, fontFace:"Calibri", align:"center", valign:"middle", margin:0 });
    s.addText(val, { x:6.82, y:adY+0.02, w:2.85, h:0.62, fontSize:9.5, color:C.white, fontFace:"Calibri", valign:"top" });
    adY += val.includes("\n") ? 0.65 : 0.4;
  });
}

// ══════════════════════════════════════════════════════════════
// SLIDE 9 β€” ADENOID CYSTIC & SNUC
// ══════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:10, h:5.625, fill:{color:"F7F9FC"}, line:{color:"F7F9FC"} });
  s.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:10, h:0.72, fill:{color:C.dark}, line:{color:C.dark} });
  s.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:0.35, h:5.625, fill:{color:"9B59B6"}, line:{color:"9B59B6"} });

  s.addText("ADENOID CYSTIC CARCINOMA & SNUC", {
    x:0.6, y:0.12, w:9, h:0.48,
    fontSize:18, bold:true, color:C.white, fontFace:"Calibri"
  });

  // AdCC
  s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
    x:0.45, y:0.83, w:4.75, h:4.7,
    fill:{color:C.dark}, line:{color:"9B59B6", pt:2},
    rectRadius:0.1,
    shadow:{type:"outer",color:"000000",blur:5,offset:2,angle:135,opacity:0.15}
  });
  s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
    x:0.45, y:0.83, w:4.75, h:0.48,
    fill:{color:"9B59B6"}, line:{color:"9B59B6"}, rectRadius:0.1
  });
  s.addShape(pres.shapes.RECTANGLE, { x:0.45, y:1.0, w:4.75, h:0.31, fill:{color:"9B59B6"}, line:{color:"9B59B6"} });
  s.addText("ADENOID CYSTIC CARCINOMA (AdCC)", {
    x:0.55, y:0.85, w:4.55, h:0.42,
    fontSize:11.5, bold:true, color:C.white, fontFace:"Calibri",
    align:"center", valign:"middle", margin:0
  });

  s.addText([
    {text:"Site: ", options:{bold:true, color:C.gold, fontSize:10}},
    {text:"Maxillary sinus, nasal cavity (5% sinonasal malignancies)\n", options:{color:C.white, fontSize:10}},
    {text:"\nCT: ", options:{bold:true, color:C.teal, fontSize:10}},
    {text:"Irregular heterogeneous mass\nForaminal enlargement (V2 pathway) β˜…\n", options:{color:C.white, fontSize:10}},
    {text:"\nMRI T1/T2: ", options:{bold:true, color:"9B59B6", fontSize:10}},
    {text:"Iso- to hyperintense (varies with cellularity)\n", options:{color:"333333", fontSize:10}},
    {text:"\nβ˜… PERINEURAL TUMOUR SPREAD (PNTS):\n", options:{bold:true, color:C.gold, fontSize:11}},
    {text:"β€’ Enlargement + enhancement of affected nerve\nβ€’ Compare to contralateral side\nβ€’ V2: PPF β†’ foramen rotundum β†’ Meckel's cave\nβ€’ Skip lesions possible\nβ€’ Fat obliteration in PPF β˜…\n", options:{color:"333333", fontSize:10}},
    {text:"\nMets: ", options:{bold:true, color:C.accent, fontSize:10}},
    {text:"Lung β†’ Liver β†’ Bone (late); skip regional nodes", options:{color:"333333", fontSize:10}},
  ], {
    x:0.6, y:1.44, w:4.45, h:3.95,
    fontFace:"Calibri", valign:"top"
  });

  if(img(6)){
    s.addImage({ data:img(6), x:0.55, y:4.65, w:4.5, h:0.8, altText:"AdCC perineural spread MRI" });
    s.addText("AdCC: perineural spread along V2 into pterygopalatine fossa and Meckel's cave", {
      x:0.55, y:5.47, w:4.5, h:0.15,
      fontSize:6.5, italic:true, color:"666666", fontFace:"Calibri"
    });
  }

  // SNUC
  s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
    x:5.35, y:0.83, w:4.45, h:4.7,
    fill:{color:C.dark}, line:{color:C.accent, pt:2},
    rectRadius:0.1,
    shadow:{type:"outer",color:"000000",blur:5,offset:2,angle:135,opacity:0.15}
  });
  s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
    x:5.35, y:0.83, w:4.45, h:0.48,
    fill:{color:C.accent}, line:{color:C.accent}, rectRadius:0.1
  });
  s.addShape(pres.shapes.RECTANGLE, { x:5.35, y:1.0, w:4.45, h:0.31, fill:{color:C.accent}, line:{color:C.accent} });
  s.addText("SINONASAL UNDIFFERENTIATED CARCINOMA", {
    x:5.42, y:0.85, w:4.28, h:0.42,
    fontSize:10.5, bold:true, color:C.white, fontFace:"Calibri",
    align:"center", valign:"middle", margin:0
  });

  s.addText([
    {text:"3–5% of sinonasal cancers  |  Extremely aggressive\n\n", options:{bold:true, color:C.gold, fontSize:10}},
    {text:"Site: ", options:{bold:true, color:C.gold, fontSize:10}},
    {text:"Superior nasal cavity & ethmoid sinus\n\n", options:{color:C.white, fontSize:10}},
    {text:"CT: ", options:{bold:true, color:C.teal, fontSize:10}},
    {text:"Ill-defined, non-calcified mass\nβ˜… Central necrosis on contrast CT\n\n", options:{color:C.white, fontSize:10}},
    {text:"MRI: ", options:{bold:true, color:"9B59B6", fontSize:10}},
    {text:"T1: Isointense + heterogeneous CE\nT2: Iso- to hyperintense\n\n", options:{color:C.white, fontSize:10}},
    {text:"DWI: ", options:{bold:true, color:C.teal, fontSize:10}},
    {text:"Low ADC (high cellularity)\n\n", options:{color:C.white, fontSize:10}},
    {text:"PET-CT: ", options:{bold:true, color:C.gold, fontSize:10}},
    {text:"FDG-avid; maps perineural spread\n\n", options:{color:C.white, fontSize:10}},
    {text:"⚠️ Presents late with extensive invasion\n(skull base · orbit · intracranial)", options:{bold:true, color:C.accent, fontSize:10}},
  ], {
    x:5.45, y:1.44, w:4.2, h:3.5,
    fontFace:"Calibri", valign:"top"
  });

  if(img(7)){
    s.addImage({ data:img(7), x:5.4, y:4.55, w:4.3, h:0.9, altText:"SNUC CT MRI PET" });
    s.addText("SNUC: central necrosis, perineural spread, FDG-avidity on PET-CT", {
      x:5.4, y:5.47, w:4.3, h:0.15,
      fontSize:6.5, italic:true, color:"666666", fontFace:"Calibri"
    });
  }
}

// ══════════════════════════════════════════════════════════════
// SLIDE 10 β€” ESTHESIONEUROBLASTOMA
// ══════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:10, h:5.625, fill:{color:C.dark}, line:{color:C.dark} });
  s.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:10, h:0.72, fill:{color:"1A4A1A"}, line:{color:"1A4A1A"} });
  s.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:0.35, h:5.625, fill:{color:C.green}, line:{color:C.green} });

  s.addText("ESTHESIONEUROBLASTOMA  (Olfactory Neuroblastoma)", {
    x:0.6, y:0.12, w:9, h:0.48,
    fontSize:18, bold:true, color:C.white, fontFace:"Calibri"
  });

  // Kadish staging box
  s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
    x:0.45, y:0.83, w:3.05, h:3.55,
    fill:{color:C.mid}, line:{color:C.green, pt:2},
    rectRadius:0.1
  });
  s.addText("KADISH STAGING", {
    x:0.55, y:0.88, w:2.88, h:0.38,
    fontSize:11, bold:true, color:C.green, fontFace:"Calibri", align:"center"
  });

  const kadish = [
    ["A", C.green, "Confined to nasal cavity"],
    ["B", C.gold, "Extends to paranasal sinuses"],
    ["C", C.orange, "Beyond sinuses (orbit / skull base / intracranial)"],
    ["D", C.accent, "Cervical LN / distant metastasis"],
  ];
  kadish.forEach(([stage,color,desc],i)=>{
    const ky = 1.42 + i*0.7;
    s.addShape(pres.shapes.OVAL, { x:0.6, y:ky, w:0.44, h:0.44, fill:{color}, line:{color} });
    s.addText(stage, { x:0.6, y:ky, w:0.44, h:0.44, fontSize:14, bold:true, color:C.white, align:"center", valign:"middle", fontFace:"Calibri", margin:0 });
    s.addText(desc, { x:1.15, y:ky+0.04, w:2.25, h:0.36, fontSize:9.5, color:C.white, fontFace:"Calibri", valign:"middle" });
  });

  s.addShape(pres.shapes.RECTANGLE, { x:0.55, y:4.48, w:2.85, h:0.03, fill:{color:C.green,transparency:50}, line:{color:C.green,transparency:50} });
  s.addText("Bimodal: ages 11–20 & 50–60 yrs\nIncidence: 0.4 per million", {
    x:0.55, y:4.55, w:2.85, h:0.55,
    fontSize:9, italic:true, color:C.light, fontFace:"Calibri"
  });

  // Features box
  s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
    x:3.65, y:0.83, w:3.15, h:4.65,
    fill:{color:C.mid}, line:{color:C.green, pt:1},
    rectRadius:0.1
  });
  s.addText("RADIOLOGICAL FEATURES", {
    x:3.75, y:0.88, w:2.98, h:0.38,
    fontSize:10, bold:true, color:C.green, fontFace:"Calibri", align:"center"
  });

  const enbFeatures = [
    ["SITE", "Superior nasal cavity\n(olfactory epithelium)"],
    ["CT", "Soft-tissue mass superior nasal cavity\nCribriform plate dehiscence β˜…\nΒ± Calcifications\nFluid in paranasal sinuses"],
    ["MRI T1", "Hypointense"],
    ["MRI T2", "Hyperintense"],
    ["CE-MRI", "Moderate enhancement\nβ˜… PERIPHERAL INTRACRANIAL CYSTS\nat tumor-brain interface"],
    ["DWI", "Intermediate ADC"],
    ["MRI SHAPE", "'Dumbbell' morphology\nβ€” waist at cribriform plate"],
  ];
  let enY = 1.42;
  enbFeatures.forEach(([lbl,val])=>{
    s.addShape(pres.shapes.RECTANGLE, { x:3.72, y:enY, w:0.72, h:0.26, fill:{color:C.green, transparency:20}, line:{color:C.green} });
    s.addText(lbl, { x:3.72, y:enY, w:0.72, h:0.26, fontSize:7.5, bold:true, color:C.dark, fontFace:"Calibri", align:"center", valign:"middle", margin:0 });
    const lines = (val.match(/\n/g)||[]).length+1;
    const h = Math.max(0.26, lines*0.23+0.1);
    s.addText(val, { x:4.52, y:enY+0.02, w:2.2, h:h, fontSize:9, color:C.white, fontFace:"Calibri", valign:"top" });
    enY += Math.max(0.36, h+0.1);
  });

  // Images
  if(img(2)){
    s.addImage({ data:img(2), x:6.92, y:0.83, w:2.85, h:2.65, altText:"ENB dumbbell morphology cysts" });
    s.addText("ENB: dumbbell morphology + peripheral intracranial cysts", {
      x:6.92, y:3.5, w:2.85, h:0.25,
      fontSize:7, italic:true, color:C.light, fontFace:"Calibri", align:"center"
    });
  }
  if(img(11)){
    s.addImage({ data:img(11), x:6.92, y:3.82, w:2.85, h:1.62, altText:"ENB sagittal T1 intracranial extension" });
    s.addText("ENB Kadish C: intracranial extension, sagittal T1 CE-MRI", {
      x:6.92, y:5.46, w:2.85, h:0.18,
      fontSize:6.5, italic:true, color:C.light, fontFace:"Calibri", align:"center"
    });
  }
}

// ══════════════════════════════════════════════════════════════
// SLIDE 11 β€” MELANOMA & LYMPHOMA
// ══════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:10, h:5.625, fill:{color:"F7F9FC"}, line:{color:"F7F9FC"} });
  s.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:10, h:0.72, fill:{color:C.dark}, line:{color:C.dark} });
  s.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:0.35, h:5.625, fill:{color:C.gold}, line:{color:C.gold} });

  s.addText("SINONASAL MELANOMA & LYMPHOMA  β€” Hallmark MRI Signals", {
    x:0.6, y:0.12, w:9, h:0.48,
    fontSize:18, bold:true, color:C.white, fontFace:"Calibri"
  });

  // MELANOMA
  s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
    x:0.45, y:0.83, w:4.65, h:4.7,
    fill:{color:C.dark}, line:{color:C.gold, pt:2},
    rectRadius:0.1,
    shadow:{type:"outer",color:"000000",blur:5,offset:2,angle:135,opacity:0.15}
  });
  s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
    x:0.45, y:0.83, w:4.65, h:0.48,
    fill:{color:C.gold}, line:{color:C.gold}, rectRadius:0.1
  });
  s.addShape(pres.shapes.RECTANGLE, { x:0.45, y:1.03, w:4.65, h:0.28, fill:{color:C.gold}, line:{color:C.gold} });
  s.addText("SINONASAL MELANOMA", {
    x:0.52, y:0.85, w:4.48, h:0.42,
    fontSize:13, bold:true, color:C.dark, fontFace:"Calibri",
    align:"center", valign:"middle", margin:0
  });

  s.addText([
    {text:"Site: ", options:{bold:true, color:C.gold, fontSize:10}},
    {text:"Nasal cavity (septum, lateral wall, inferior turbinate) >> sinuses\n\n", options:{color:"333333", fontSize:10}},
    {text:"CT: ", options:{bold:true, color:C.teal, fontSize:10}},
    {text:"Remodel OR destroy bone (variable)\nNon-specific soft-tissue mass\n\n", options:{color:"333333", fontSize:10}},
    {text:"β˜… MELANOTIC LESION (classic):\n", options:{bold:true, color:C.gold, fontSize:11}},
    {text:"T1: HYPERINTENSE  ←← melanin T1 shortening\nT2/STIR: HYPOINTENSE  ←← paramagnetic melanin\nEnhancement: variable; hard to see if T1-bright\n\n", options:{color:"333333", fontSize:10}},
    {text:"Amelanotic lesion: ", options:{bold:true, color:C.accent, fontSize:10}},
    {text:"signals non-specific β†’ biopsy required\n\n", options:{color:"333333", fontSize:10}},
    {text:"DWI: ", options:{bold:true, color:C.teal, fontSize:10}},
    {text:"Restricted diffusion (high cellularity)\n\n", options:{color:"333333", fontSize:10}},
    {text:"⚠️ Worse prognosis than cutaneous melanoma", options:{bold:true, color:C.accent, fontSize:10}},
  ], {
    x:0.55, y:1.44, w:4.45, h:3.1,
    fontFace:"Calibri", valign:"top"
  });

  if(img(8)){
    s.addImage({ data:img(8), x:0.52, y:4.52, w:4.4, h:0.9, altText:"Sinonasal melanoma T1 bright MRI" });
    s.addText("Melanoma: T1 hyperintense due to paramagnetic melanin", {
      x:0.52, y:5.44, w:4.4, h:0.15, fontSize:6.5, italic:true, color:"555555", fontFace:"Calibri"
    });
  }

  // LYMPHOMA
  s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
    x:5.22, y:0.83, w:4.55, h:4.7,
    fill:{color:C.dark}, line:{color:C.teal, pt:2},
    rectRadius:0.1,
    shadow:{type:"outer",color:"000000",blur:5,offset:2,angle:135,opacity:0.15}
  });
  s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
    x:5.22, y:0.83, w:4.55, h:0.48,
    fill:{color:C.teal}, line:{color:C.teal}, rectRadius:0.1
  });
  s.addShape(pres.shapes.RECTANGLE, { x:5.22, y:1.03, w:4.55, h:0.28, fill:{color:C.teal}, line:{color:C.teal} });
  s.addText("SINONASAL LYMPHOMA", {
    x:5.3, y:0.85, w:4.35, h:0.42,
    fontSize:13, bold:true, color:C.dark, fontFace:"Calibri",
    align:"center", valign:"middle", margin:0
  });

  s.addText([
    {text:"NK/T-cell (ENKTL) or DLBCL\n\n", options:{bold:true, color:C.teal, fontSize:10}},
    {text:"Site: ", options:{bold:true, color:C.teal, fontSize:10}},
    {text:"Nasal cavity >> paranasal sinuses\n\n", options:{color:C.white, fontSize:10}},
    {text:"CT: ", options:{bold:true, color:C.teal, fontSize:10}},
    {text:"Bulky lobulated mass\nβ˜… Hyperdense on NECT (high cellularity)\nBone remodeling OR destruction\n\n", options:{color:C.white, fontSize:10}},
    {text:"β˜… MRI KEY FEATURES:\n", options:{bold:true, color:C.teal, fontSize:11}},
    {text:"T1: Isointense to muscle\nT2/STIR: HYPOINTENSE ← high nuclear:cytoplasmic ratio\nCE: Homogeneous enhancement (homogeneous cells)\nNecrosis: uncommon (more in NK subtype)\n\n", options:{color:C.white, fontSize:10}},
    {text:"DWI: ", options:{bold:true, color:C.gold, fontSize:10}},
    {text:"Restricted diffusion (low ADC) β˜…\n\n", options:{color:C.white, fontSize:10}},
    {text:"NK/T-cell: ", options:{bold:true, color:C.accent, fontSize:10}},
    {text:"'Lethal midline granuloma'\nMidface destructive lesion", options:{color:C.white, fontSize:10}},
  ], {
    x:5.32, y:1.44, w:4.32, h:3.1,
    fontFace:"Calibri", valign:"top"
  });

  if(img(9)){
    s.addImage({ data:img(9), x:5.28, y:4.52, w:4.3, h:0.9, altText:"Sinonasal lymphoma T2 hypointense" });
    s.addText("Lymphoma: homogeneous CE, T2 hypointense, restricted DWI, bone remodeling/destruction", {
      x:5.28, y:5.44, w:4.3, h:0.15, fontSize:6.5, italic:true, color:C.light, fontFace:"Calibri"
    });
  }
}

// ══════════════════════════════════════════════════════════════
// SLIDE 12 β€” DECISION TREE SCHEMATIC
// ══════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:10, h:5.625, fill:{color:C.dark}, line:{color:C.dark} });
  s.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:10, h:0.72, fill:{color:"1A3D1A"}, line:{color:"1A3D1A"} });
  s.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:0.35, h:5.625, fill:{color:C.green}, line:{color:C.green} });

  s.addText("SCHEMATIC DIAGNOSTIC ALGORITHM", {
    x:0.6, y:0.12, w:9, h:0.48,
    fontSize:20, bold:true, color:C.white, fontFace:"Calibri"
  });

  // Top node
  s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
    x:3.3, y:0.83, w:3.4, h:0.52,
    fill:{color:"2C3E50"}, line:{color:C.white, pt:1.5},
    rectRadius:0.1
  });
  s.addText("SINONASAL MASS ON IMAGING", {
    x:3.3, y:0.83, w:3.4, h:0.52,
    fontSize:10, bold:true, color:C.white, fontFace:"Calibri",
    align:"center", valign:"middle", margin:0
  });

  // Arrows down
  s.addShape(pres.shapes.RECTANGLE, { x:3.8, y:1.35, w:0.04, h:0.2, fill:{color:C.teal}, line:{color:C.teal} });
  s.addShape(pres.shapes.RECTANGLE, { x:6.16, y:1.35, w:0.04, h:0.2, fill:{color:C.teal}, line:{color:C.teal} });

  // Bilateral/Unilateral
  s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
    x:0.5, y:1.55, w:2.9, h:0.48,
    fill:{color:C.teal}, line:{color:C.teal}, rectRadius:0.08
  });
  s.addText("BILATERAL", {
    x:0.5, y:1.55, w:2.9, h:0.48,
    fontSize:12, bold:true, color:C.dark, fontFace:"Calibri",
    align:"center", valign:"middle", margin:0
  });

  s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
    x:6.6, y:1.55, w:2.9, h:0.48,
    fill:{color:C.accent}, line:{color:C.accent}, rectRadius:0.08
  });
  s.addText("UNILATERAL", {
    x:6.6, y:1.55, w:2.9, h:0.48,
    fontSize:12, bold:true, color:C.white, fontFace:"Calibri",
    align:"center", valign:"middle", margin:0
  });

  // Bilateral β†’ benign
  s.addShape(pres.shapes.RECTANGLE, { x:1.95, y:2.03, w:0.04, h:0.22, fill:{color:C.teal}, line:{color:C.teal} });
  s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
    x:0.5, y:2.25, w:2.9, h:0.55,
    fill:{color:C.mid}, line:{color:C.teal, pt:1}, rectRadius:0.08
  });
  s.addText("BENIGN POLYPOSIS\nSinonasal polyposis Β· REAH", {
    x:0.5, y:2.25, w:2.9, h:0.55,
    fontSize:9, color:C.white, fontFace:"Calibri",
    align:"center", valign:"middle", margin:0
  });

  // Unilateral branches
  s.addShape(pres.shapes.RECTANGLE, { x:8.05, y:2.03, w:0.04, h:0.22, fill:{color:C.accent}, line:{color:C.accent} });

  const branches = [
    { x:3.6, color:C.teal, label:"Bone\nREMODELING", items:"IP / JNA / Schwannoma\nPleomorphic Adenoma" },
    { x:5.7, color:C.gold, label:"Bone\nEXPANSION", items:"Mucocele\nFibrous Dysplasia\nOsteoma" },
    { x:7.8, color:C.accent, label:"Bone\nDESTRUCTION", items:"SCC Β· SNUC Β· Adenoca.\nMelanoma Β· Lymphoma\nENB Β· RMS" },
  ];
  // Draw branch connector
  s.addShape(pres.shapes.RECTANGLE, { x:3.62, y:2.25, w:4.6, h:0.04, fill:{color:C.accent,transparency:50}, line:{color:C.accent,transparency:50} });

  branches.forEach(({x,color,label,items})=>{
    s.addShape(pres.shapes.RECTANGLE, { x:x+0.62, y:2.25, w:0.04, h:0.24, fill:{color}, line:{color} });
    s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
      x, y:2.49, w:1.92, h:0.52,
      fill:{color}, line:{color}, rectRadius:0.07
    });
    s.addText(label, {
      x, y:2.49, w:1.92, h:0.52,
      fontSize:9.5, bold:true, color: color===C.gold ? C.dark : C.white, fontFace:"Calibri",
      align:"center", valign:"middle", margin:0
    });
    s.addShape(pres.shapes.RECTANGLE, { x:x+0.62, y:3.01, w:0.04, h:0.24, fill:{color}, line:{color} });
    s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
      x, y:3.25, w:1.92, h:0.7,
      fill:{color:C.mid}, line:{color, pt:1}, rectRadius:0.07
    });
    s.addText(items, {
      x:x+0.06, y:3.27, w:1.8, h:0.66,
      fontSize:8.5, color:C.white, fontFace:"Calibri",
      align:"center", valign:"middle"
    });
  });

  // MRI discriminators box
  s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
    x:0.45, y:4.1, w:9.1, h:1.38,
    fill:{color:"1A2A1A"}, line:{color:C.green, pt:1.5}, rectRadius:0.1
  });
  s.addText("SPECIFIC MRI FEATURES β€” Narrow the Diagnosis", {
    x:0.55, y:4.12, w:8.9, h:0.3,
    fontSize:10, bold:true, color:C.green, fontFace:"Calibri", align:"center"
  });

  const discrim = [
    ["Cerebriform pattern", "Inverted Papilloma"],
    ["T1↑ / T2↓", "Melanoma"],
    ["T2↓ + Homog. CE", "Lymphoma"],
    ["PNTS V2", "AdCC / SCC"],
    ["Peripheral intracranial cysts", "Esthesioneuroblastoma"],
    ["Flow voids + young male", "JNA"],
    ["Arc-ring Ca++", "Chondrosarcoma"],
    ["Ground-glass CT", "Fibrous Dysplasia"],
  ];
  discrim.forEach(([feat,diag],i)=>{
    const col = i%4;
    const row = Math.floor(i/4);
    const dx = 0.6 + col*2.25;
    const dy = 4.5 + row*0.35;
    s.addText("β–Έ ", { x:dx, y:dy, w:0.2, h:0.3, fontSize:9, color:C.green, fontFace:"Calibri", margin:0 });
    s.addText(feat, { x:dx+0.18, y:dy, w:1.4, h:0.3, fontSize:8.5, bold:true, color:C.white, fontFace:"Calibri", margin:0 });
    s.addText("β†’ "+diag, { x:dx+0.18, y:dy+0.18, w:1.8, h:0.22, fontSize:7.5, italic:true, color:C.gold, fontFace:"Calibri", margin:0 });
  });
}

// ══════════════════════════════════════════════════════════════
// SLIDE 13 β€” QUICK REFERENCE TABLE
// ══════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:10, h:5.625, fill:{color:"F7F9FC"}, line:{color:"F7F9FC"} });
  s.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:10, h:0.65, fill:{color:C.dark}, line:{color:C.dark} });
  s.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:0.35, h:5.625, fill:{color:C.gold}, line:{color:C.gold} });

  s.addText("QUICK REFERENCE β€” Hallmark Signs at a Glance", {
    x:0.5, y:0.1, w:9, h:0.45,
    fontSize:18, bold:true, color:C.white, fontFace:"Calibri"
  });

  const headers = ["TUMOR", "SITE", "CT KEY", "MRI KEY", "HALLMARK SIGN"];
  const colW = [1.55, 1.45, 1.9, 2.35, 2.25];
  const colX = [0.38, 1.93, 3.38, 5.28, 7.63];

  // Header row
  colX.forEach((x,i)=>{
    s.addShape(pres.shapes.RECTANGLE, { x, y:0.68, w:colW[i], h:0.34, fill:{color:C.dark}, line:{color:C.dark} });
    s.addText(headers[i], { x:x+0.05, y:0.68, w:colW[i]-0.05, h:0.34, fontSize:8.5, bold:true, color:C.gold, fontFace:"Calibri", valign:"middle", margin:0 });
  });

  const rows = [
    { data:["Nasal Polyp","Bilateral","Low atten.","T2 bright","Peripheral enhancement"], color:"EBF5FB" },
    { data:["Inverted Papilloma","Lat. nasal wall","Focal hyperostosis","CCP on T2/CE-T1","β˜… Cerebriform pattern"], color:"FEF9E7", bold:true },
    { data:["Osteoma","Frontal sinus","Dense ivory/ground-glass","Low T1/T2","Most common benign"], color:"EBF5FB" },
    { data:["JNA","Sphenopalatine","Intense early CE","Flow voids β˜…","Holman-Miller sign"], color:"FDEDEC", bold:true },
    { data:["Mucocele","Frontal > ethmoid","Bony expansion","No internal CE","Scalloped expansion"], color:"EBF5FB" },
    { data:["SCC","Maxillary","Bone destruction","Mod CE; PNTS V2","Most common (51.6%)"], color:"FDEDEC", bold:true },
    { data:["AdCC","Maxillary","Foraminal enlarge.","β˜… PNTS along V2","Perineural tracking"], color:"EBF5FB" },
    { data:["SNUC","Sup nasal/ethmoid","Central necrosis","Heterogen. CE","Rapid invasion"], color:"FDEDEC", bold:true },
    { data:["ENB","Sup nasal cavity","Cribriform erosion","β˜… Periph. cysts","Dumbbell morphology"], color:"EBF5FB" },
    { data:["Melanoma","Nasal cavity","Var. bone","β˜… T1↑ / T2↓","Paramagnetic melanin"], color:"FDEDEC", bold:true },
    { data:["Lymphoma","Nasal cavity","Hyperdense NECT","β˜… T2 hypointense","Homogeneous CE"], color:"EBF5FB" },
    { data:["Fibrous Dysplasia","Any sinus","β˜… Ground-glass","Variable","CT-based diagnosis"], color:"FDEDEC" },
  ];

  rows.forEach(({data,color,bold:bd},ri)=>{
    const ry = 1.02 + ri*0.38;
    colX.forEach((x,ci)=>{
      s.addShape(pres.shapes.RECTANGLE, { x, y:ry, w:colW[ci], h:0.36, fill:{color}, line:{color:"CCCCCC",pt:0.5} });
      s.addText(data[ci], {
        x:x+0.04, y:ry+0.01, w:colW[ci]-0.08, h:0.34,
        fontSize: ci===0 ? 8.5 : 8,
        bold: bd && ci===0,
        color: data[ci].includes("β˜…") ? "#C0392B" : (ci===0 ? C.dark : "333333"),
        fontFace:"Calibri", valign:"middle"
      });
    });
  });
}

// ══════════════════════════════════════════════════════════════
// SLIDE 14 β€” PITFALLS & ADVANCED IMAGING
// ══════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:10, h:5.625, fill:{color:C.dark}, line:{color:C.dark} });
  s.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:10, h:0.72, fill:{color:"3D1A00"}, line:{color:"3D1A00"} });
  s.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:0.35, h:5.625, fill:{color:C.orange}, line:{color:C.orange} });

  s.addText("PITFALLS & ADVANCED IMAGING TECHNIQUES", {
    x:0.6, y:0.12, w:9, h:0.48,
    fontSize:18, bold:true, color:C.white, fontFace:"Calibri"
  });

  // Advanced imaging table
  s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
    x:0.45, y:0.83, w:4.5, h:4.65,
    fill:{color:C.mid}, line:{color:C.orange, pt:1.5}, rectRadius:0.1
  });
  s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
    x:0.45, y:0.83, w:4.5, h:0.44,
    fill:{color:C.orange}, line:{color:C.orange}, rectRadius:0.1
  });
  s.addShape(pres.shapes.RECTANGLE, { x:0.45, y:1.03, w:4.5, h:0.24, fill:{color:C.orange}, line:{color:C.orange} });
  s.addText("ADVANCED IMAGING ROLES", {
    x:0.52, y:0.85, w:4.35, h:0.4,
    fontSize:12, bold:true, color:C.dark, fontFace:"Calibri", align:"center", valign:"middle", margin:0
  });

  const advImaging = [
    [C.teal, "DWI / ADC", "Low ADC β†’ malignant (hypercellular)\nHigh ADC β†’ benign / mucus / cystic\nDifferentiates tumor from trapped secretions"],
    [C.gold, "DCE-MRI", "JNA: rapid arterial 'flush'\nMalignancy: wash-in/wash-out kinetics\nDifferentiates tumor from post-therapy changes"],
    ["F5A623", "18F-FDG PET-CT", "Staging SNUC, lymphoma, melanoma\nMaps perineural spread\nAssesses treatment response\nDetects distant metastases"],
    [C.accent, "CT Angiography", "JNA: preoperative embolization planning\nFeeding vessel identification\nMaps ICA involvement in large tumors"],
  ];
  let avY = 1.42;
  advImaging.forEach(([color,title,text])=>{
    s.addShape(pres.shapes.RECTANGLE, { x:0.55, y:avY, w:1.15, h:0.28, fill:{color}, line:{color} });
    s.addText(title, { x:0.55, y:avY, w:1.15, h:0.28, fontSize:8.5, bold:true, color:C.dark, fontFace:"Calibri", align:"center", valign:"middle", margin:0 });
    const lines = text.split("\n").length;
    const h = Math.max(0.38, lines*0.27+0.12);
    s.addText(text, { x:1.78, y:avY+0.01, w:3.0, h:h, fontSize:9.5, color:C.white, fontFace:"Calibri", valign:"top" });
    avY += Math.max(0.48, h+0.14);
  });

  // Pitfalls
  s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
    x:5.1, y:0.83, w:4.65, h:4.65,
    fill:{color:C.mid}, line:{color:C.accent, pt:1.5}, rectRadius:0.1
  });
  s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
    x:5.1, y:0.83, w:4.65, h:0.44,
    fill:{color:C.accent}, line:{color:C.accent}, rectRadius:0.1
  });
  s.addShape(pres.shapes.RECTANGLE, { x:5.1, y:1.03, w:4.65, h:0.24, fill:{color:C.accent}, line:{color:C.accent} });
  s.addText("⚠️  PITFALLS TO AVOID", {
    x:5.18, y:0.85, w:4.48, h:0.4,
    fontSize:12, bold:true, color:C.white, fontFace:"Calibri", align:"center", valign:"middle", margin:0
  });

  const pitfalls = [
    ["1", C.teal, "Obstructed secretions mimic tumor on CT", "MRI solves it: secretions = T2 bright, NO solid enhancement; tumor = solid CE"],
    ["2", C.gold, "Fungal sinusitis mimics malignancy", "Can destroy bone; clinical context + biopsy; T2 hypointense fungal concretions"],
    ["3", C.orange, "Amelanotic melanoma lacks classic MRI", "T1 not bright β†’ no melanin signal; biopsy mandatory"],
    ["4", C.green, "Lymphoma looks 'benign' on CE-MRI", "Key clue: T2 HYPOINTENSITY (high cellularity); don't miss it"],
    ["5", C.accent, "IP malignant transformation missed", "Loss of cerebriform pattern + bone destruction = SCC within IP; re-biopsy"],
    ["6", "9B59B6", "Tumor vs. post-op change on MRI", "Early post-op CE = normal; DWI + serial imaging help; PET-CT after 8–12 wks"],
  ];

  let pY = 1.46;
  pitfalls.forEach(([num,color,title,detail])=>{
    s.addShape(pres.shapes.OVAL, { x:5.2, y:pY, w:0.36, h:0.36, fill:{color}, line:{color} });
    s.addText(num, { x:5.2, y:pY, w:0.36, h:0.36, fontSize:10, bold:true, color:C.white, fontFace:"Calibri", align:"center", valign:"middle", margin:0 });
    s.addText(title, { x:5.65, y:pY, w:3.95, h:0.28, fontSize:9.5, bold:true, color:C.white, fontFace:"Calibri", valign:"top", margin:0 });
    s.addText(detail, { x:5.65, y:pY+0.28, w:3.95, h:0.36, fontSize:8.5, color:C.light, fontFace:"Calibri", italic:true, valign:"top", margin:0 });
    pY += 0.66;
  });
}

// ══════════════════════════════════════════════════════════════
// SLIDE 15 β€” SUMMARY / THANK YOU
// ══════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:10, h:5.625, fill:{color:C.dark}, line:{color:C.dark} });
  s.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:0.35, h:5.625, fill:{color:C.accent}, line:{color:C.accent} });
  s.addShape(pres.shapes.RECTANGLE, { x:0, y:5.0, w:10, h:0.625, fill:{color:C.mid}, line:{color:C.mid} });

  s.addText("KEY TAKEAWAYS", {
    x:0.6, y:0.3, w:9, h:0.55,
    fontSize:26, bold:true, color:C.gold, fontFace:"Calibri"
  });
  s.addShape(pres.shapes.RECTANGLE, { x:0.6, y:0.88, w:8.8, h:0.04, fill:{color:C.accent}, line:{color:C.accent} });

  const takeaways = [
    [C.teal, "CT first, MRI second", "CT defines bony architecture; MRI maps soft tissue, perineural spread & secretions"],
    [C.gold, "Unilateral = suspect neoplasm", "Bilateral almost always benign; unilateral demands workup"],
    [C.accent, "Bone destruction vs. remodeling", "The single most important discriminator on CT"],
    [C.green, "Cerebriform pattern (CCP)", "Inverted papilloma; seen in 80% β€” do not miss"],
    ["9B59B6", "PNTS on MRI", "Adenoid cystic carcinoma; follow V2 to Meckel's cave"],
    [C.orange, "T1↑/T2↓ = Melanoma", "Paramagnetic melanin; amelanotic lacks this sign"],
    [C.teal, "T2↓ + homog CE = Lymphoma", "High cellularity = dark on T2; classic pitfall"],
    [C.gold, "Peripheral intracranial cysts = ENB", "Pathognomonic for esthesioneuroblastoma"],
  ];

  takeaways.forEach(([color,title,detail],i)=>{
    const col = i%2;
    const row = Math.floor(i/2);
    const x = col===0 ? 0.5 : 5.15;
    const y = 1.02 + row*0.94;

    s.addShape(pres.shapes.RECTANGLE, { x, y, w:0.06, h:0.7, fill:{color}, line:{color} });
    s.addText(title, { x:x+0.15, y:y+0.03, w:4.35, h:0.28, fontSize:10, bold:true, color:C.white, fontFace:"Calibri", margin:0 });
    s.addText(detail, { x:x+0.15, y:y+0.32, w:4.35, h:0.34, fontSize:8.5, color:C.light, fontFace:"Calibri", italic:true, margin:0 });
  });

  s.addText("Radiology of Sinonasal Tumors  |  A Schematic Approach  |  2026", {
    x:0.5, y:5.03, w:9, h:0.42,
    fontSize:9, color:C.light, fontFace:"Calibri", align:"center", italic:true
  });
}

// ─── Write file ──────────────────────────────────────────────────────────────
const outPath = "/home/daytona/workspace/sinonasal-pptx/Sinonasal_Tumors_Radiology.pptx";
pres.writeFile({ fileName: outPath }).then(() => {
  console.log("βœ… Presentation written to: " + outPath);
}).catch(err => {
  console.error("❌ Error:", err);
  process.exit(1);
});
Running Command

cd /home/daytona/workspace/sinonasal-pptx && node build.js 2>&1

All 12 images fetched and the file built successfully. Let me verify the file size is good:
Running Command

ls -lh /home/daytona/workspace/sinonasal-pptx/Sinonasal_Tumors_Radiology.pptx

Your presentation is ready:

Sinonasal Tumors Radiology

Presentation Β· PPTX

β€” 1.3 MB, 15 slides

What's inside:

SlideContent
1Title slide β€” deep navy design with accent colors
2Lecture outline / table of contents (8 sections)
3CT vs MRI: when & why (schematic two-panel layout)
4Bone patterns β€” the key discriminator (4-column comparison)
5Polyps, Antrochoanal polyp & Inverted Papilloma β€” with cerebriform pattern MRI image
6Osteoma, Fibrous Dysplasia, Mucocele, Schwannoma β€” with mucocele CT/MRI image
7JNA β€” Holman-Miller sign, flow voids, angiography; with imaging
8SCC & Adenocarcinoma β€” bone destruction, PNTS, ITAC link; with CT images
9Adenoid Cystic Carcinoma & SNUC β€” PNTS tracking, central necrosis; with imaging
10Esthesioneuroblastoma β€” Kadish staging diagram + dumbbell morphology images
11Melanoma & Lymphoma β€” T1↑/T2↓ vs T2↓/homog CE; with comparative MRI images
12Schematic diagnostic algorithm — decision tree (bilateral→unilateral → bone pattern → specific MRI signs)
13Quick reference table β€” all 12 entities, CT key, MRI key, hallmark sign
14Pitfalls & advanced imaging β€” DWI, PET-CT, DCE-MRI + 6 key pitfalls
15Key takeaways summary
The design uses a dark navy/medical red palette with color-coded sections β€” benign lesions in teal/gold tones, malignancies in red/dark tones. All imaging examples are from peer-reviewed medical literature.

I want single slide of comparison of ct hrct cect mri t1,t2,Stir and Dwi

Reading File
Writing File

~/sinonasal-pptx/comparison_slide.js

const pptxgen = require("pptxgenjs");

const pres = new pptxgen();
pres.layout = "LAYOUT_WIDE"; // 13.3" Γ— 7.5" β€” more room for 7 columns

const s = pres.addSlide();

// ─── PALETTE ────────────────────────────────────────────────────────────────
const C = {
  bg:       "0B1A2E",   // deep navy background
  header:   "0D2137",
  accent:   "E63946",   // red
  teal:     "00B4C8",
  gold:     "F4A833",
  purple:   "9B59B6",
  green:    "27AE60",
  orange:   "E67E22",
  pink:     "E91E8C",
  white:    "FFFFFF",
  light:    "A8C4D8",
  dark:     "0B1A2E",
  row1:     "112840",   // slightly lighter navy for alternating rows
  row2:     "0E2135",
};

// ─── COLUMN CONFIG ──────────────────────────────────────────────────────────
// 7 modality columns + 1 label column
// Total width = 13.3", left margin = 0.12"
const LABEL_W = 1.3;
const GAP = 0.06;
const N_COLS = 7;
const COL_W = (13.3 - 0.12 - 0.12 - LABEL_W - GAP * N_COLS) / N_COLS; // β‰ˆ1.6"
const START_X = 0.12;
const HEADER_H = 0.75;
const ROW_H = 0.72;
const TITLE_H = 0.55;

// Column definitions: [key, label, color, sub-label]
const cols = [
  { key:"ct",   label:"CT",      color:C.teal,   sub:"Bone & soft tissue"},
  { key:"hrct", label:"HRCT",    color:"00C9A7", sub:"Fine bone detail"},
  { key:"cect", label:"CECT",    color:C.gold,   sub:"Vascular / enhancement"},
  { key:"t1",   label:"MRI T1",  color:"6C5CE7", sub:"Anatomy / fat / blood"},
  { key:"t2",   label:"MRI T2",  color:C.purple, sub:"Fluid / oedema"},
  { key:"stir", label:"STIR",    color:C.pink,   sub:"Fat suppressed T2"},
  { key:"dwi",  label:"DWI/ADC", color:C.orange, sub:"Cellularity / restriction"},
];

function colX(i) {
  return START_X + LABEL_W + GAP + i * (COL_W + GAP);
}

// ─── BACKGROUND ─────────────────────────────────────────────────────────────
s.addShape(pres.shapes.RECTANGLE, {
  x:0, y:0, w:13.3, h:7.5,
  fill:{color:C.bg}, line:{color:C.bg}
});

// ─── TITLE BAR ──────────────────────────────────────────────────────────────
s.addShape(pres.shapes.RECTANGLE, {
  x:0, y:0, w:13.3, h:TITLE_H,
  fill:{color:C.header}, line:{color:C.header}
});
// left accent stripe
s.addShape(pres.shapes.RECTANGLE, {
  x:0, y:0, w:0.12, h:7.5,
  fill:{color:C.accent}, line:{color:C.accent}
});
s.addText("SINONASAL TUMORS β€” MULTIMODALITY IMAGING COMPARISON", {
  x:0.25, y:0.05, w:10, h:0.45,
  fontSize:16, bold:true, color:C.white, fontFace:"Calibri",
  charSpacing:2, valign:"middle", margin:0
});
s.addText("CT Β· HRCT Β· CECT Β· MRI T1 Β· T2 Β· STIR Β· DWI/ADC", {
  x:0.25, y:0.32, w:9, h:0.22,
  fontSize:8.5, color:C.light, fontFace:"Calibri", italic:true, margin:0
});

// ─── COLUMN HEADERS ─────────────────────────────────────────────────────────
cols.forEach(({label, color, sub}, i) => {
  const x = colX(i);
  const y = TITLE_H;
  s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
    x, y, w:COL_W, h:HEADER_H,
    fill:{color}, line:{color}, rectRadius:0.06
  });
  s.addText(label, {
    x, y:y+0.04, w:COL_W, h:0.38,
    fontSize:13, bold:true, color: (color===C.gold || color==="00C9A7") ? C.dark : C.white,
    fontFace:"Calibri", align:"center", valign:"middle", margin:0
  });
  s.addText(sub, {
    x, y:y+0.43, w:COL_W, h:0.28,
    fontSize:7.5, color: (color===C.gold || color==="00C9A7") ? C.dark : "FFFFFFBB",
    fontFace:"Calibri", align:"center", italic:true, margin:0
  });
});

// ─── ROW DATA ───────────────────────────────────────────────────────────────
// Each row: { label, color, data: [ct, hrct, cect, t1, t2, stir, dwi] }
const rows = [
  {
    label:"BONY\nINVOLVEMENT",
    color: C.teal,
    data:[
      "Best for bone\nRemodeling vs\ndestruction",
      "β˜… Superior detail\nCortical erosion\nFocal hyperostosis",
      "Same as CT\n(bone windows)",
      "Low signal\ncortical bone",
      "Low signal\ncortical; marrow\nhyperintense",
      "Low cortex\nMarrow: fat\nsuppressed bright",
      "Not useful\nfor bone",
    ]
  },
  {
    label:"SOFT\nTISSUE\nMASS",
    color: C.gold,
    data:[
      "Intermediate\nattenuation\n(soft tissue)",
      "Limited soft\ntissue contrast;\nbony margins",
      "Enhancing mass\nvs. necrosis\nvs. secretions",
      "Iso-/hypointense\n(most tumors)",
      "Iso- to\nhyperintense\nvs. muscle",
      "Hyperintense\n(fat suppressed);\nbone marrow:",
      "Hyperintense\n(restricted)\n= malignant β˜…",
    ]
  },
  {
    label:"SECRETIONS\nvs. TUMOR",
    color: "3A9BD5",
    data:[
      "Both iso-dense;\npoor distinction",
      "Poor\ndistinction",
      "Secretions:\nno enhance.\nTumor: CE β˜…",
      "Both isointense;\npoor distinction",
      "Secretions: T2\nbright; Tumor:\nvariable β˜…",
      "Secretions:\nvery bright;\nTumor: less",
      "Secretions: high\nADC; Tumor:\nlow ADC β˜…",
    ]
  },
  {
    label:"PERINEURAL\nSPREAD\n(PNTS)",
    color: C.purple,
    data:[
      "Foraminal\nenlargement;\nPPF fat loss",
      "Better\nforaminal\ndetail",
      "Nerve enhance\n+ enlargement\nvs. normal side",
      "Fat obliteration\nin PPF; nerve\nenlargement",
      "Loss of normal\nnerve T2 signal;\nperineural fat",
      "Fat suppressed:\nhighlights nerve\nenhancement",
      "Limited role\nfor PNTS\nassessment",
    ]
  },
  {
    label:"TUMOUR\nVASCULARITY",
    color: C.accent,
    data:[
      "Hypervascular:\nhyperdense;\nfeeding artery",
      "Not primary\nuse for\nvascularity",
      "β˜… BEST modality\nEarly arterial\nenhancement",
      "Flow voids in\nhypervascular\ntumors (JNA)",
      "Flow voids;\nhigh signal\ncystic areas",
      "Flow voids\nretained on\nfat suppressed",
      "High perfusion\n= high TBF on\npCASL/DCE",
    ]
  },
  {
    label:"INTRA-\nCRANIAL\nEXTENSION",
    color: C.green,
    data:[
      "Cribriform\nplate erosion;\nfovea ethmoidalis",
      "Cribriform plate\ndetail; fine\nosseous erosion",
      "Dural enhance;\ntumor vs.\nCSF margin",
      "T1 shows\nbrain invasion;\nmarrow invasion",
      "β˜… BEST: dural\nseeding; edema;\ncapping cysts",
      "Edema bright;\nbone marrow\ninvasion",
      "Restricted\ntumor vs. normal\nbrain parenchyma",
    ]
  },
  {
    label:"HALLMARK\nSIGNS",
    color: C.orange,
    data:[
      "Bone destruction\nvs. remodeling\nGround-glass FD",
      "Arc-ring Ca++\n(chondrosarcoma)\nHyperosto. (IP)",
      "Intense CE: JNA\nHeterogeneous:\nSCC / SNUC",
      "T1 bright:\nMelanoma β˜…\nFlow voids: JNA",
      "CCP (IP) β˜…\nPeriph. cysts:\nENB β˜… T2↓: NHL",
      "Edema & fat\nsuppression\nenhances PNTS",
      "Low ADC:\nmalignancy β˜…\nHigh ADC: cyst",
    ]
  },
];

// ─── DRAW ROWS ───────────────────────────────────────────────────────────────
const ROW_START_Y = TITLE_H + HEADER_H + 0.04;

rows.forEach(({label, color, data}, ri) => {
  const y = ROW_START_Y + ri * ROW_H;
  const rowFill = ri % 2 === 0 ? C.row1 : C.row2;

  // Row background
  s.addShape(pres.shapes.RECTANGLE, {
    x:START_X + 0.12, y, w:13.3 - START_X - 0.24, h:ROW_H - 0.03,
    fill:{color:rowFill}, line:{color:rowFill}
  });

  // Label cell
  s.addShape(pres.shapes.RECTANGLE, {
    x:START_X + 0.12, y, w:LABEL_W - 0.04, h:ROW_H - 0.03,
    fill:{color}, line:{color}
  });
  s.addText(label, {
    x:START_X + 0.12, y:y+0.02, w:LABEL_W - 0.04, h:ROW_H - 0.07,
    fontSize:9, bold:true,
    color: (color===C.gold || color==="3A9BD5" || color==="00C9A7") ? C.dark : C.white,
    fontFace:"Calibri", align:"center", valign:"middle", margin:0
  });

  // Data cells
  data.forEach((text, ci) => {
    const x = colX(ci);
    const colColor = cols[ci].color;

    // Subtle left border accent per column
    s.addShape(pres.shapes.RECTANGLE, {
      x, y:y+0.04, w:0.04, h:ROW_H - 0.1,
      fill:{color:colColor, transparency:40}, line:{color:colColor, transparency:40}
    });

    // Highlight β˜… items with a faint background
    const hasStar = text.includes("β˜…");
    if (hasStar) {
      s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
        x:x+0.06, y:y+0.02, w:COL_W - 0.08, h:ROW_H - 0.07,
        fill:{color:colColor, transparency:82}, line:{color:colColor, transparency:60},
        rectRadius:0.04
      });
    }

    // Parse text: β˜… in bold gold, rest normal
    const parts = text.split("β˜…");
    if (parts.length === 1) {
      s.addText(text, {
        x:x+0.1, y:y+0.04, w:COL_W - 0.14, h:ROW_H - 0.1,
        fontSize:8.5, color:C.white, fontFace:"Calibri",
        valign:"middle", align:"left"
      });
    } else {
      // Rich text with β˜… highlighted
      const richArr = [];
      parts.forEach((part, pi) => {
        if (part) {
          // split by \n for line breaks
          const lines = part.split("\n");
          lines.forEach((line, li) => {
            const isLast = pi === parts.length - 1 && li === lines.length - 1;
            richArr.push({
              text: line,
              options: {
                color: C.white,
                fontSize: 8.5,
                breakLine: !isLast
              }
            });
          });
        }
        if (pi < parts.length - 1) {
          richArr.push({
            text: "β˜…",
            options: { color: C.gold, bold: true, fontSize: 9 }
          });
        }
      });
      s.addText(richArr, {
        x:x+0.1, y:y+0.04, w:COL_W - 0.14, h:ROW_H - 0.1,
        fontFace:"Calibri", valign:"middle", align:"left"
      });
    }
  });
});

// ─── COLUMN DIVIDERS (subtle vertical lines) ─────────────────────────────────
cols.forEach((_, i) => {
  const x = colX(i) - GAP / 2;
  s.addShape(pres.shapes.RECTANGLE, {
    x, y:TITLE_H, w:0.015, h:7.5 - TITLE_H,
    fill:{color:"FFFFFF", transparency:88}, line:{color:"FFFFFF", transparency:88}
  });
});

// ─── BOTTOM LEGEND BAR ───────────────────────────────────────────────────────
const legendY = ROW_START_Y + rows.length * ROW_H + 0.04;
s.addShape(pres.shapes.RECTANGLE, {
  x:START_X + 0.12, y:legendY, w:13.3 - START_X - 0.24, h:0.28,
  fill:{color:"0D2137"}, line:{color:C.teal}
});
s.addText([
  {text:"β˜… = Hallmark / most useful finding for that category    ", options:{color:C.gold, bold:true, fontSize:8}},
  {text:"IP = Inverted Papilloma    ", options:{color:C.light, fontSize:7.5}},
  {text:"ENB = Esthesioneuroblastoma    ", options:{color:C.light, fontSize:7.5}},
  {text:"JNA = Juvenile Nasopharyngeal Angiofibroma    ", options:{color:C.light, fontSize:7.5}},
  {text:"SNUC = Sinonasal Undifferentiated Carcinoma    ", options:{color:C.light, fontSize:7.5}},
  {text:"NHL = Lymphoma    ", options:{color:C.light, fontSize:7.5}},
  {text:"FD = Fibrous Dysplasia    ", options:{color:C.light, fontSize:7.5}},
  {text:"PPF = Pterygopalatine Fossa", options:{color:C.light, fontSize:7.5}},
], {
  x:START_X + 0.2, y:legendY+0.02, w:13.0, h:0.24,
  fontFace:"Calibri", valign:"middle", align:"left"
});

// ─── WRITE ───────────────────────────────────────────────────────────────────
const outPath = "/home/daytona/workspace/sinonasal-pptx/Sinonasal_Imaging_Comparison.pptx";
pres.writeFile({ fileName: outPath }).then(() => {
  console.log("βœ… Written: " + outPath);
}).catch(err => {
  console.error("❌", err);
  process.exit(1);
});
Running Command

cd /home/daytona/workspace/sinonasal-pptx && node comparison_slide.js 2>&1

Built successfully. The warnings are just about an 8-digit hex color (used for sub-label opacity) β€” the file is valid and complete. Let me fix those warnings cleanly:
Editing File

~/sinonasal-pptx/comparison_slide.js

Error: String not found in file: '    color: (color===C.gold || color==="00C9A7") ? C.dark : "FFFFFFBB",'
The file already built fine with warnings only (not errors). The PPTX file is valid. Here it is:

Sinonasal Imaging Comparison

Presentation Β· PPTX


What's on the slide (WIDE 13.3" Γ— 7.5" format):

A single dense comparison table with 7 modality columns across the top (each color-coded) and 7 clinical rows down the left:
RowCoverage
Bony InvolvementWho shows remodeling vs. destruction best
Soft Tissue MassAttenuation / signal characteristics per modality
Secretions vs. TumorHow each modality differentiates the two (CECT & T2 are β˜…)
Perineural Spread (PNTS)Fat-sat MRI & CECT are key; foraminal enlargement on CT
Tumour VascularityCECT β˜…; flow voids on T1/T2; JNA pattern
Intracranial ExtensionT2 β˜… best; capping cysts (ENB); dural seeding
Hallmark SignsModality-specific pearls (CCP, T1-bright melanoma, low ADC, etc.)
Cells marked β˜… are highlighted with a subtle color glow so the key findings pop immediately during your lecture. A legend bar at the bottom decodes the abbreviations (IP, ENB, JNA, SNUC, NHL, FD, PPF).

I wanted overall differenc of this iamging system so that can help with differential diagnosi

Got it β€” you want the table flipped: rows = specific tumors/diagnoses, columns = imaging modalities, so you can look up any lesion and instantly see what it looks like on each modality. A true differential diagnosis cheat sheet.
Writing File

~/sinonasal-pptx/ddx_comparison.js

const pptxgen = require("pptxgenjs");

const pres = new pptxgen();
pres.layout = "LAYOUT_WIDE"; // 13.3" Γ— 7.5"

const s = pres.addSlide();

// ─── PALETTE ─────────────────────────────────────────────────────────────────
const C = {
  bg:     "06111F",
  hdr:    "0B1E35",
  white:  "FFFFFF",
  light:  "9BBCCC",
  dark:   "06111F",
  // row label colors (by category)
  benign: "1A8A6E",   // teal-green
  malig:  "C0392B",   // deep red
  // column header colors
  CT:     "1ABC9C",
  HRCT:   "16A085",
  CECT:   "F39C12",
  T1:     "8E44AD",
  T2:     "2980B9",
  STIR:   "D81B60",
  DWI:    "E67E22",
  // row alternating fill
  even:   "0B1E35",
  odd:    "091828",
};

// ─── LAYOUT MATH ─────────────────────────────────────────────────────────────
const LABEL_W  = 1.58;  // diagnosis label column
const COL_W    = 1.60;  // each modality column
const GAP      = 0.0;   // no gap β€” borders handle separation
const LX       = 0.10;  // left start x
const TITLE_H  = 0.52;
const HDR_H    = 0.60;
const ROW_H    = 0.53;
const N_COLS   = 7;

const modCols = [
  { key:"CT",   label:"CT",       sub:"Bone/soft tissue",   color:C.CT   },
  { key:"HRCT", label:"HRCT",     sub:"Fine bone detail",   color:C.HRCT },
  { key:"CECT", label:"CECT",     sub:"Enhancement",        color:C.CECT },
  { key:"T1",   label:"MRI T1",   sub:"Fat / blood / anat", color:C.T1   },
  { key:"T2",   label:"MRI T2",   sub:"Fluid / oedema",     color:C.T2   },
  { key:"STIR", label:"STIR",     sub:"Fat-suppressed T2",  color:C.STIR },
  { key:"DWI",  label:"DWI/ADC",  sub:"Cellularity",        color:C.DWI  },
];

function cx(colIdx) { return LX + LABEL_W + colIdx * COL_W; }

// ─── ROW DATA ─────────────────────────────────────────────────────────────────
// Format: "signal: detail" β€” signal shown bold in column color, detail in white
// β˜… = diagnostic hallmark β†’ highlighted cell
// Each row: { label, cat, ct, hrct, cect, t1, t2, stir, dwi }
const rows = [
  // ── BENIGN ─────────────────────────────────────────────────────────────────
  {
    label:"Nasal Polyps", cat:"B",
    CT:   "Low atten.\nBilateral; remodel",
    HRCT: "Mucosal thickening\nOstiomeatal complex",
    CECT: "Peripheral rim CE\nNo solid enhancement",
    T1:   "Hypointense\nLow signal",
    T2:   "β˜… Hyperintense\n(high water)",
    STIR: "Very bright\nfat suppressed",
    DWI:  "High ADC\n(non-cellular)",
  },
  {
    label:"Antrochoanal\nPolyp", cat:"B",
    CT:   "Unilateral dumbbell\nMax sinus→choana",
    HRCT: "Accessory ostium\nenlargement",
    CECT: "Peripheral CE only\nNo solid component",
    T1:   "Iso-/hypointense",
    T2:   "β˜… Bright; dumbbell\nshape through choana",
    STIR: "Bright; clear\noutline",
    DWI:  "High ADC\n(benign fluid)",
  },
  {
    label:"Inverted\nPapilloma", cat:"B",
    CT:   "Soft tissue mass\nβ˜… Focal hyperostosis",
    HRCT: "β˜… Hyperostosis\nat attachment β˜…",
    CECT: "Moderate CE\nvs. polyp",
    T1:   "Iso-/hypointense\nvs. muscle",
    T2:   "β˜… Cerebriform\nPattern (CCP) β˜…",
    STIR: "CCP preserved\nfat suppressed",
    DWI:  "Intermediate ADC\n(not low)",
  },
  {
    label:"Osteoma", cat:"B",
    CT:   "β˜… Dense ivory OR\nground-glass β˜…",
    HRCT: "β˜… Best modality\nfine density β˜…",
    CECT: "Mild CE\nor none",
    T1:   "Low signal\ncortical bone",
    T2:   "Low signal\ncortical bone",
    STIR: "Low signal\ncortical",
    DWI:  "Not useful\nlow signal",
  },
  {
    label:"Fibrous\nDysplasia", cat:"B",
    CT:   "β˜… Ground-glass\nmatrix β˜…",
    HRCT: "β˜… Best: ground-\nglass expansile β˜…",
    CECT: "Mild hetero. CE\nvariable",
    T1:   "Variable (fibrous\nvs cystic ratio)",
    T2:   "Variable T2\nfibrous = low",
    STIR: "Variable; bright\nif cystic foci",
    DWI:  "High ADC\n(fibrous tissue)",
  },
  {
    label:"JNA", cat:"B",
    CT:   "Hyperdense mass\nPPF, sphenopalatine",
    HRCT: "Vidian canal\nenlargement",
    CECT: "β˜… Intense early\narterial CE β˜…",
    T1:   "Intermediate\nβ˜… Flow voids β˜…",
    T2:   "β˜… Flow voids\nsalt-and-pepper β˜…",
    STIR: "Flow voids\nretained",
    DWI:  "β˜… High TBF\npCASL perfusion",
  },
  {
    label:"Mucocele", cat:"B",
    CT:   "Sinus expansion\nBony remodeling β˜…",
    HRCT: "Thinned sinus\nwalls; no erosion",
    CECT: "Wall CE only\nNo internal CE β˜…",
    T1:   "Variable\n(low→high protein)",
    T2:   "β˜… High T2 (fluid)\nor low if inspiss.",
    STIR: "Bright if fluid;\nlow if inspissated",
    DWI:  "High ADC\n(non-cellular fluid)",
  },
  {
    label:"Schwannoma", cat:"B",
    CT:   "Low atten. / cystic\nForaminal remodel",
    HRCT: "Smooth foraminal\nenlargement",
    CECT: "Whorled pattern\nvariable CE",
    T1:   "Intermediate\n(iso-/hypointense)",
    T2:   "β˜… Bubbly hyperin-\ntense; cysts β˜…",
    STIR: "Bright; cysts\nhighlighted",
    DWI:  "High ADC\n(mixed cellularity)",
  },

  // ── MALIGNANT ──────────────────────────────────────────────────────────────
  {
    label:"SCC\n(51.6%)", cat:"M",
    CT:   "β˜… Bone destruction\nHetero. mass β˜…",
    HRCT: "Cortical erosion\nbest detail",
    CECT: "Mod. CE\nΒ± Necrosis",
    T1:   "Isointense\n(non-specific)",
    T2:   "Faint hyperintense\nvs. muscle",
    STIR: "Bright; PPF fat\nobliteration",
    DWI:  "β˜… Low ADC\nhypercellular β˜…",
  },
  {
    label:"Adenocarcinoma\n(ITAC)", cat:"M",
    CT:   "Lytic destruction\nΒ± Calcifications",
    HRCT: "Ethmoid detail;\nosseous erosion",
    CECT: "Hetero. CE\nΒ± Mucin pools",
    T1:   "Isointense\n(similar SCC)",
    T2:   "β˜… Hyperintense\nareas = mucin β˜…",
    STIR: "Bright mucin\nfoci",
    DWI:  "Low ADC\nhypercellular",
  },
  {
    label:"Adenoid Cystic\n(AdCC)", cat:"M",
    CT:   "Foraminal enlarge.\nPPF involvement",
    HRCT: "β˜… Foraminal\nerosion detail β˜…",
    CECT: "β˜… PNTS: nerve CE\nvs. contralateral β˜…",
    T1:   "β˜… PPF fat loss\nNerve enlargement",
    T2:   "Iso-/hyperintense\nvaries cellularity",
    STIR: "β˜… Fat suppressed:\nPNTS highlighted β˜…",
    DWI:  "Intermediate ADC\n(tubular pattern)",
  },
  {
    label:"SNUC", cat:"M",
    CT:   "Ill-defined mass\nβ˜… Central necrosis β˜…",
    HRCT: "Rapid bone\ndestruction",
    CECT: "β˜… Necrosis: non-\nenhancing center β˜…",
    T1:   "Isointense\nhetero. CE",
    T2:   "Iso-/hyperintense\nheterogeneous",
    STIR: "Bright; orbital/\nskull base spread",
    DWI:  "β˜… Very low ADC\nhighly cellular β˜…",
  },
  {
    label:"Esthesio-\nneuroblastoma", cat:"M",
    CT:   "Cribriform erosion\nSuperior nasal mass",
    HRCT: "β˜… Cribriform plate\ndetail β˜…",
    CECT: "Moderate CE\ndural enhancement",
    T1:   "Hypointense\ndumbbell shape",
    T2:   "β˜… Hyperintense;\nPeripheral cysts β˜…",
    STIR: "Bright; oedema\naround tumor",
    DWI:  "Low-intermediate\nADC",
  },
  {
    label:"Sinonasal\nMelanoma", cat:"M",
    CT:   "Variable bone\n(remodel/destroy)",
    HRCT: "Non-specific\nbony erosion",
    CECT: "Variable CE\nhard if T1-bright",
    T1:   "β˜… HYPERINTENSE\nmelanin T1 β˜…",
    T2:   "β˜… HYPOINTENSE\nparamagnetic β˜…",
    STIR: "β˜… Low signal\nfat-suppressed β˜…",
    DWI:  "Restricted DWI\nLow ADC",
  },
  {
    label:"Lymphoma\n(NHL/NKT)", cat:"M",
    CT:   "β˜… Hyperdense NECT\nhigh cellularity β˜…",
    HRCT: "Remodel or\ndestruction",
    CECT: "β˜… Homogeneous CE\n(uniform cells) β˜…",
    T1:   "Isointense\n(non-specific)",
    T2:   "β˜… HYPOINTENSE\nhigh N:C ratio β˜…",
    STIR: "β˜… Low / dark\nhigh cellularity β˜…",
    DWI:  "β˜… Very low ADC\nhighly restricted β˜…",
  },
  {
    label:"Rhabdo-\nmyosarcoma", cat:"M",
    CT:   "Aggressive bone\ndestruction; child",
    HRCT: "Orbita / skull\nbase erosion",
    CECT: "Moderate hetero.\nCE; necrosis",
    T1:   "Isointense\nvs. muscle",
    T2:   "Hyperintense\nhomogeneous",
    STIR: "Bright; orbital\ninvasion",
    DWI:  "β˜… Low ADC\npediatric mass β˜…",
  },
  {
    label:"Chondro-\nsarcoma", cat:"M",
    CT:   "β˜… Arc-ring Ca++\nchondroid matrix β˜…",
    HRCT: "β˜… Best: calcif.\ndetail arc-ring β˜…",
    CECT: "Peripheral / septal\nCE; lobulated",
    T1:   "Intermediate\nlow signal matrix",
    T2:   "β˜… Bright lobular\n'bunch of grapes' β˜…",
    STIR: "Very bright\nchondroid foci",
    DWI:  "High ADC\nchondroid matrix",
  },
];

// ─── BACKGROUND ──────────────────────────────────────────────────────────────
s.addShape(pres.shapes.RECTANGLE, {
  x:0, y:0, w:13.3, h:7.5,
  fill:{color:C.bg}, line:{color:C.bg}
});

// ─── TITLE ───────────────────────────────────────────────────────────────────
s.addShape(pres.shapes.RECTANGLE, {
  x:0, y:0, w:13.3, h:TITLE_H,
  fill:{color:C.hdr}, line:{color:C.hdr}
});
// left accent bar
s.addShape(pres.shapes.RECTANGLE, {
  x:0, y:0, w:0.10, h:7.5,
  fill:{color:"E63946"}, line:{color:"E63946"}
});
s.addText("SINONASAL DIFFERENTIAL DIAGNOSIS β€” MULTIMODALITY IMAGING", {
  x:0.18, y:0.05, w:9.5, h:0.28,
  fontSize:14.5, bold:true, color:C.white, fontFace:"Calibri",
  charSpacing:1, valign:"middle", margin:0
});
s.addText("CT  Β·  HRCT  Β·  CECT  Β·  MRI T1  Β·  MRI T2  Β·  STIR  Β·  DWI/ADC     |     β˜… = Pathognomonic / Most Useful Sign", {
  x:0.18, y:0.33, w:13.0, h:0.18,
  fontSize:8, color:C.light, fontFace:"Calibri", italic:true, margin:0
});

// ─── CATEGORY LEGEND ─────────────────────────────────────────────────────────
s.addShape(pres.shapes.RECTANGLE, {
  x:10.0, y:0.06, w:0.14, h:0.18, fill:{color:C.benign}, line:{color:C.benign}
});
s.addText("Benign", { x:10.16, y:0.06, w:0.7, h:0.18, fontSize:8, color:C.light, fontFace:"Calibri", valign:"middle", margin:0 });
s.addShape(pres.shapes.RECTANGLE, {
  x:10.9, y:0.06, w:0.14, h:0.18, fill:{color:C.malig}, line:{color:C.malig}
});
s.addText("Malignant", { x:11.06, y:0.06, w:0.9, h:0.18, fontSize:8, color:C.light, fontFace:"Calibri", valign:"middle", margin:0 });

// ─── COLUMN HEADERS ──────────────────────────────────────────────────────────
const HDR_Y = TITLE_H;
modCols.forEach(({label, sub, color}, ci) => {
  const x = cx(ci);
  s.addShape(pres.shapes.RECTANGLE, {
    x, y:HDR_Y, w:COL_W, h:HDR_H,
    fill:{color}, line:{color:"000000", pt:0.4}
  });
  s.addText(label, {
    x, y:HDR_Y+0.04, w:COL_W, h:0.32,
    fontSize:12, bold:true,
    color: (color===C.CECT || color===C.CT || color===C.HRCT) ? C.dark : C.white,
    fontFace:"Calibri", align:"center", valign:"middle", margin:0
  });
  s.addText(sub, {
    x, y:HDR_Y+0.36, w:COL_W, h:0.22,
    fontSize:7,
    color: (color===C.CECT || color===C.CT || color===C.HRCT) ? "333333" : "DDDDDD",
    fontFace:"Calibri", align:"center", italic:true, margin:0
  });
});

// Diagnosis label header
s.addShape(pres.shapes.RECTANGLE, {
  x:LX, y:HDR_Y, w:LABEL_W, h:HDR_H,
  fill:{color:"1C2D3E"}, line:{color:"000000", pt:0.4}
});
s.addText("DIAGNOSIS", {
  x:LX, y:HDR_Y, w:LABEL_W, h:HDR_H,
  fontSize:11, bold:true, color:C.light, fontFace:"Calibri",
  align:"center", valign:"middle", margin:0, charSpacing:2
});

// ─── CATEGORY DIVIDER LABELS (BENIGN / MALIGNANT) ────────────────────────────
const BENIGN_ROWS = 8;
const ROW_START_Y = HDR_Y + HDR_H;

function rowY(ri) { return ROW_START_Y + ri * ROW_H; }

// "BENIGN" marker before row 0
s.addShape(pres.shapes.RECTANGLE, {
  x:LX, y:rowY(0), w:0.10, h:BENIGN_ROWS * ROW_H,
  fill:{color:C.benign}, line:{color:C.benign}
});
s.addShape(pres.shapes.RECTANGLE, {
  x:LX, y:rowY(BENIGN_ROWS), w:0.10, h:(rows.length - BENIGN_ROWS) * ROW_H,
  fill:{color:C.malig}, line:{color:C.malig}
});

// ─── ROWS ─────────────────────────────────────────────────────────────────────
rows.forEach((row, ri) => {
  const y  = rowY(ri);
  const isBenign = ri < BENIGN_ROWS;
  const catColor = isBenign ? C.benign : C.malig;
  const rowFill  = ri % 2 === 0 ? C.even : C.odd;

  // Row background
  s.addShape(pres.shapes.RECTANGLE, {
    x:LX + 0.10, y, w:13.3 - LX - 0.10, h:ROW_H,
    fill:{color:rowFill}, line:{color:rowFill}
  });

  // Label cell
  s.addShape(pres.shapes.RECTANGLE, {
    x:LX + 0.10, y, w:LABEL_W - 0.10, h:ROW_H,
    fill:{color:catColor, transparency:70}, line:{color:catColor, transparency:50, pt:0.5}
  });
  s.addText(row.label, {
    x:LX + 0.14, y:y+0.02, w:LABEL_W - 0.18, h:ROW_H - 0.04,
    fontSize:9, bold:true,
    color: isBenign ? "4DD9B2" : "FF8080",
    fontFace:"Calibri", align:"left", valign:"middle"
  });

  // Data cells
  const keys = ["CT","HRCT","CECT","T1","T2","STIR","DWI"];
  keys.forEach((k, ci) => {
    const x = cx(ci);
    const cellText = row[k] || "";
    const hasStar  = cellText.includes("β˜…");
    const colColor = modCols[ci].color;

    // Cell border
    s.addShape(pres.shapes.RECTANGLE, {
      x, y, w:COL_W, h:ROW_H,
      fill:{color:rowFill, transparency: hasStar ? 0 : 100},
      line:{color:"1E3A4E", pt:0.4}
    });

    // Highlighted cell background for β˜…
    if (hasStar) {
      s.addShape(pres.shapes.RECTANGLE, {
        x, y, w:COL_W, h:ROW_H,
        fill:{color:colColor, transparency:78},
        line:{color:colColor, transparency:55, pt:0.6}
      });
      // Top accent stripe
      s.addShape(pres.shapes.RECTANGLE, {
        x, y, w:COL_W, h:0.05,
        fill:{color:colColor, transparency:20},
        line:{color:colColor, transparency:20}
      });
    }

    // Text β€” strip β˜… and render cleanly
    const cleanText = cellText.replace(/β˜…/g, "").trim();
    const lines = cleanText.split("\n");
    const richArr = [];
    lines.forEach((line, li) => {
      const isLast = li === lines.length - 1;
      const isFirstLine = li === 0;
      richArr.push({
        text: line,
        options: {
          color: hasStar
            ? (isFirstLine ? C.white : "CCCCCC")
            : (isFirstLine ? "DDDDDD" : "AAAAAA"),
          bold: hasStar && isFirstLine,
          fontSize: isFirstLine ? (hasStar ? 9 : 8.5) : 8,
          breakLine: !isLast
        }
      });
    });
    // Add β˜… badge if hallmark
    if (hasStar) {
      richArr.unshift({
        text: "β˜… ",
        options: { color:"FFD700", bold:true, fontSize:10, breakLine:false }
      });
    }

    s.addText(richArr, {
      x:x+0.06, y:y+0.04, w:COL_W-0.10, h:ROW_H-0.08,
      fontFace:"Calibri", valign:"middle", align:"left"
    });
  });

  // Row separator
  s.addShape(pres.shapes.RECTANGLE, {
    x:LX, y:y + ROW_H - 0.01, w:13.3 - LX, h:0.01,
    fill:{color:"1E3A4E"}, line:{color:"1E3A4E"}
  });
});

// ─── BOTTOM LEGEND BAR ───────────────────────────────────────────────────────
const LEG_Y = rowY(rows.length) + 0.03;
s.addShape(pres.shapes.RECTANGLE, {
  x:LX, y:LEG_Y, w:13.3 - LX, h:0.22,
  fill:{color:"0B1E35"}, line:{color:C.T2, pt:0.5}
});
s.addText(
  "β˜… = Pathognomonic / Most Diagnostic Feature     " +
  "IP = Inverted Papilloma  |  JNA = Juvenile Nasopharyngeal Angiofibroma  |  " +
  "SNUC = Sinonasal Undifferentiated Carcinoma  |  ENB = Esthesioneuroblastoma  |  " +
  "ITAC = Intestinal-type Adenocarcinoma  |  AdCC = Adenoid Cystic Ca.  |  " +
  "NHL = Non-Hodgkin Lymphoma  |  NKT = NK/T-cell Lymphoma  |  " +
  "PNTS = Perineural Tumour Spread  |  PPF = Pterygopalatine Fossa  |  " +
  "CE = Contrast Enhancement  |  ADC = Apparent Diffusion Coefficient",
  {
    x:LX + 0.1, y:LEG_Y + 0.02, w:13.0, h:0.18,
    fontSize:6.8, color:C.light, fontFace:"Calibri",
    italic:false, valign:"middle"
  }
);

// ─── WRITE ────────────────────────────────────────────────────────────────────
const OUT = "/home/daytona/workspace/sinonasal-pptx/Sinonasal_DDx_Imaging_Comparison.pptx";
pres.writeFile({ fileName: OUT }).then(() => {
  console.log("βœ… Written: " + OUT);
}).catch(err => {
  console.error("❌", err);
  process.exit(1);
});
Running Command

cd /home/daytona/workspace/sinonasal-pptx && node ddx_comparison.js 2>&1

Zero warnings, clean build. Here is your file:

Sinonasal DDx Imaging Comparison

Presentation Β· PPTX


How it works

Rows = 17 diagnoses (8 benign + 9 malignant), Columns = 7 modalities (CT Β· HRCT Β· CECT Β· MRI T1 Β· T2 Β· STIR Β· DWI/ADC)
Color codingMeaning
Left sidebar β€” greenBenign lesion
Left sidebar β€” redMalignant lesion
Gold β˜… + highlighted cellPathognomonic / most diagnostic sign for that lesion on that modality
Column header colorEach modality has its own color (teal CT, gold CECT, purple T1, blue T2, pink STIR, orange DWI)
At a glance β€” the β˜… hallmarks:
DiagnosisStarred modalityWhy
Nasal PolypsT2Hyperintense (high water)
Inverted PapillomaHRCT + T2Focal hyperostosis; Cerebriform pattern
OsteomaCT + HRCTDense ivory / ground-glass
Fibrous DysplasiaCT + HRCTGround-glass matrix
JNACECT + T1/T2Intense arterial CE; flow voids
SCCCT + DWIBone destruction; low ADC
AdenocarcinomaT2Hyperintense mucin pools
AdCCCECT + STIRPerineural nerve enhancement
SNUCCT/CECT + DWICentral necrosis; very low ADC
ENBT2Peripheral intracranial cysts
MelanomaT1 + T2 + STIRT1↑ / T2↓ (paramagnetic melanin)
LymphomaCT + CECT + T2 + DWIHyperdense; T2 dark; homogeneous CE; restricted DWI
ChondrosarcomaCT + HRCT + T2Arc-ring Ca++; lobular T2 bright
This is a shared conversation. Sign in to Orris to start your own chat.