Make a seminar presentation from above notes with clear cut images

Reading File
Reading File
Reading File
Reading File
Running Command

cd /tmp/workspace/attachments/b4f9ce7b-c40a-4b8f-b58e-22422063c361/ && ls -la

Running Command

python3 -c " import pdfplumber pdf_path = '/tmp/workspace/attachments/b4f9ce7b-c40a-4b8f-b58e-22422063c361/I now have comprehensive content Let me read the n.pdf' with pdfplumber.open(pdf_path) as pdf: print(f'Total pages: {len(pdf.pages)}') for i, page in enumerate(pdf.pages[:5]): text = page.extract_text() if text: print(f'--- PAGE {i+1} ---') print(text[:2000]) print() "

Running Command

python3 -c " import pdfplumber pdf_path = '/tmp/workspace/attachments/b4f9ce7b-c40a-4b8f-b58e-22422063c361/I now have comprehensive content Let me read the n.pdf' with pdfplumber.open(pdf_path) as pdf: for i, page in enumerate(pdf.pages[5:]): text = page.extract_text() if text: print(f'--- PAGE {i+6} ---') print(text[:3000]) print() "

Searching Images

nasopharynx anatomy lateral wall torus tubarius Eustachian tube

This clinical diagnostic image is a high-definition endoscopic view of the right lateral nasopharynx in a healthy adult. The image clearly demonstrates the anatomical landmarks of the pharyngeal orifice of the Eustachian tube. Key structures labeled include the Eustachian tube opening appearing as a dark slit, the Rosenmüller fossa (pharyngeal recess) located posteriorly, and the torus tubarius. The muscular anatomy is delineated, showing the tensor veli palatini anteriorly and the levator veli palatini inferiorly. The salpingopharyngeus muscle is visible as a vertical fold of mucosa. Other landmarks include the soft palate forming the inferior boundary, the nasopharyngeal wall, and the posterior edge of the nasal septum. The mucosa appears healthy, pink, and well-vascularized without signs of inflammation, lymphoid hyperplasia, or obstruction. This image serves as a reference for normal nasopharyngeal anatomy and the study of peritubal muscle relationships relevant to Middle Ear Myoclonus (MEM) and Eustachian tube dysfunction.

This clinical diagnostic image is a high-definition endoscopic view of the right lateral nasopharynx in a healthy adult. The image clearly demonstrates the anatomical landmarks of the pharyngeal orifice of the Eustachian tube. Key structures labeled include the Eustachian tube opening appearing as a dark slit, the Rosenmüller fossa (pharyngeal recess) located posteriorly, and the torus tubarius. The muscular anatomy is delineated, showing the tensor veli palatini anteriorly and the levator veli palatini inferiorly. The salpingopharyngeus muscle is visible as a vertical fold of mucosa. Other landmarks include the soft palate forming the inferior boundary, the nasopharyngeal wall, and the posterior edge of the nasal septum. The mucosa appears healthy, pink, and well-vascularized without signs of inflammation, lymphoid hyperplasia, or obstruction. This image serves as a reference for normal nasopharyngeal anatomy and the study of peritubal muscle relationships relevant to Middle Ear Myoclonus (MEM) and Eustachian tube dysfunction.

This endoscopic clinical photograph demonstrates an intraoperative view of the posterior nasal cavity and nasopharynx during the harvest of a pedicled posteriorly-based inferior turbinate flap (PPITF). A prominent vertical mucosal incision is visible, serving as the posterior limb of the flap harvest. This incision is strategically positioned anterior to the torus tubarius and the Eustachian tube orifice. The surgical site shows expected post-procedural findings, including localized mucosal erythema, mild edema, and spots of fresh blood. Areas of brownish discoloration are visible along the incision margins, consistent with the use of needle-tipped monopolar cautery for hemostasis and precise tissue dissection. The surrounding anatomy includes the fleshy contours of the lateral nasal wall and the transition to the nasopharyngeal mucosa. This image is used to teach surgical landmarks for endoscopic endonasal skull base reconstruction and flap harvesting techniques, emphasizing the preservation of the Eustachian tube while ensuring adequate flap dimensions.

This endoscopic clinical photograph demonstrates an intraoperative view of the posterior nasal cavity and nasopharynx during the harvest of a pedicled posteriorly-based inferior turbinate flap (PPITF). A prominent vertical mucosal incision is visible, serving as the posterior limb of the flap harvest. This incision is strategically positioned anterior to the torus tubarius and the Eustachian tube orifice. The surgical site shows expected post-procedural findings, including localized mucosal erythema, mild edema, and spots of fresh blood. Areas of brownish discoloration are visible along the incision margins, consistent with the use of needle-tipped monopolar cautery for hemostasis and precise tissue dissection. The surrounding anatomy includes the fleshy contours of the lateral nasal wall and the transition to the nasopharyngeal mucosa. This image is used to teach surgical landmarks for endoscopic endonasal skull base reconstruction and flap harvesting techniques, emphasizing the preservation of the Eustachian tube while ensuring adequate flap dimensions.

Searching Images

pharynx boundaries walls sagittal section nasopharynx oropharynx laryngopharynx

Searching Images

nasopharyngeal carcinoma fossa of Rosenmuller tumor

A series of four endoscopically captured clinical photographs (A-D) demonstrating the nasopharyngeal cavity in a patient with nasopharyngeal carcinoma (NPC) during a nasopharyngeal lavage procedure. Images A and B show the posterior nasopharyngeal wall and lateral recesses with visible mucosal erythema and irregular, pale leucoplakic patches alongside hyperemic, inflamed tissue. The surface texture appears granular and uneven. Image C highlights a deep diagnostic view of the fossa of Rosenmüller, showing significant mucosal thickening and inflammatory exudate. Image D reveals a prominent, exophytic, or submucosal mass lesion with a deeper violaceous hue, characteristic of tumor progression or bulk in the nasopharynx. The series illustrates the anatomical landmarks and pathological mucosal changes relevant to otolaryngology and oncological assessment of NPC. Key educational concepts include endoscopic recognition of nasopharyngeal malignancies, tissue inflammation, and the visualization of tumor masses within the pharyngeal space.

A series of four endoscopically captured clinical photographs (A-D) demonstrating the nasopharyngeal cavity in a patient with nasopharyngeal carcinoma (NPC) during a nasopharyngeal lavage procedure. Images A and B show the posterior nasopharyngeal wall and lateral recesses with visible mucosal erythema and irregular, pale leucoplakic patches alongside hyperemic, inflamed tissue. The surface texture appears granular and uneven. Image C highlights a deep diagnostic view of the fossa of Rosenmüller, showing significant mucosal thickening and inflammatory exudate. Image D reveals a prominent, exophytic, or submucosal mass lesion with a deeper violaceous hue, characteristic of tumor progression or bulk in the nasopharynx. The series illustrates the anatomical landmarks and pathological mucosal changes relevant to otolaryngology and oncological assessment of NPC. Key educational concepts include endoscopic recognition of nasopharyngeal malignancies, tissue inflammation, and the visualization of tumor masses within the pharyngeal space.

This diagnostic image displays three axial MRI slices of the head and neck at the level of the nasopharynx, illustrating the presentation and manual segmentation of nasopharyngeal carcinoma (NPC). The slices show key anatomical structures including the nasal cavity, sphenoid bone, parapharyngeal spaces, and the base of the skull. Each slice features a red outline representing manual segmentation of the tumor volume. The first image on the left demonstrates a large, centrally located mass with heterogeneous signal intensity that appears to occupy the nasopharyngeal space and potentially invade adjacent structures. The middle image shows a more localized, smaller lesion in the left lateral nasopharyngeal wall near the fossa of Rosenmüller. The third image on the right depicts an irregularly shaped, infiltrative tumor extending across the mucosal surfaces. These slices highlight the challenging clinical task of delineating NPC boundaries due to the primary tumor's proximity to normal soft tissues and its tendency for subtle infiltration, which is a critical step in radiotherapy planning and diagnostic oncology.

This diagnostic image displays three axial MRI slices of the head and neck at the level of the nasopharynx, illustrating the presentation and manual segmentation of nasopharyngeal carcinoma (NPC). The slices show key anatomical structures including the nasal cavity, sphenoid bone, parapharyngeal spaces, and the base of the skull. Each slice features a red outline representing manual segmentation of the tumor volume. The first image on the left demonstrates a large, centrally located mass with heterogeneous signal intensity that appears to occupy the nasopharyngeal space and potentially invade adjacent structures. The middle image shows a more localized, smaller lesion in the left lateral nasopharyngeal wall near the fossa of Rosenmüller. The third image on the right depicts an irregularly shaped, infiltrative tumor extending across the mucosal surfaces. These slices highlight the challenging clinical task of delineating NPC boundaries due to the primary tumor's proximity to normal soft tissues and its tendency for subtle infiltration, which is a critical step in radiotherapy planning and diagnostic oncology.

Axial contrast-enhanced T1-weighted Magnetic Resonance Imaging (MRI) comparison of a normal nasopharynx versus nasopharyngeal carcinoma (NPC). Image (A) displays a normal control featuring symmetrical anatomical structures, including the fossa of Rosenmüller, parapharyngeal space, and clear boundaries of the skull base. Image set (B) contains three scans from different patients showing a progression of NPC severity. Red arrows indicate hyperintense, contrast-enhancing masses within the nasopharynx. The pathological findings demonstrate varying degrees of tumor size, irregular margins, and structural distortion. In more advanced stages, the imaging reveals significant asymmetry, obliteration of the parapharyngeal fat planes, and invasion into adjacent soft tissues and intracranial regions. These images serve as a diagnostic reference for identifying NPC extension, perineural spread, and the characteristic loss of tissue differentiation associated with malignant nasopharyngeal lesions.

Axial contrast-enhanced T1-weighted Magnetic Resonance Imaging (MRI) comparison of a normal nasopharynx versus nasopharyngeal carcinoma (NPC). Image (A) displays a normal control featuring symmetrical anatomical structures, including the fossa of Rosenmüller, parapharyngeal space, and clear boundaries of the skull base. Image set (B) contains three scans from different patients showing a progression of NPC severity. Red arrows indicate hyperintense, contrast-enhancing masses within the nasopharynx. The pathological findings demonstrate varying degrees of tumor size, irregular margins, and structural distortion. In more advanced stages, the imaging reveals significant asymmetry, obliteration of the parapharyngeal fat planes, and invasion into adjacent soft tissues and intracranial regions. These images serve as a diagnostic reference for identifying NPC extension, perineural spread, and the characteristic loss of tissue differentiation associated with malignant nasopharyngeal lesions.

Searching Images

adenoids enlarged pharyngeal tonsil children nasal obstruction

Running Command

mkdir -p /tmp/workspace/nasopharynx-seminar && ls /tmp/workspace/nasopharynx-seminar/

Writing File

~/nasopharynx-seminar/build_pptx.py

import json, subprocess, base64, os
from io import BytesIO
from pptx import Presentation
from pptx.util import Inches, Pt, Emu
from pptx.dml.color import RGBColor
from pptx.enum.text import PP_ALIGN, MSO_ANCHOR
from pptx.util import Inches, Pt
import pptx.oxml.ns as nsmap
from lxml import etree

# ── colour palette ──────────────────────────────────────────────
DARK_BLUE   = RGBColor(0x0D, 0x3B, 0x66)   # deep navy
MID_BLUE    = RGBColor(0x1A, 0x73, 0xAA)   # accent blue
LIGHT_BLUE  = RGBColor(0xD6, 0xEC, 0xFA)   # slide bg tint
WHITE       = RGBColor(0xFF, 0xFF, 0xFF)
GOLD        = RGBColor(0xF5, 0xA6, 0x23)
DARK_TEXT   = RGBColor(0x1A, 0x1A, 0x2E)
LIGHT_GRAY  = RGBColor(0xF0, 0xF4, 0xF8)
RED_ACCENT  = RGBColor(0xC0, 0x39, 0x2B)

W = Inches(13.333)
H = Inches(7.5)

prs = Presentation()
prs.slide_width  = W
prs.slide_height = H
blank = prs.slide_layouts[6]   # fully blank

# ── helper: solid background ────────────────────────────────────
def set_bg(slide, color: RGBColor):
    bg = slide.background
    fill = bg.fill
    fill.solid()
    fill.fore_color.rgb = color

# ── helper: add text box ────────────────────────────────────────
def tb(slide, text, x, y, w, h, size=18, bold=False, color=DARK_TEXT,
       align=PP_ALIGN.LEFT, italic=False, wrap=True, font="Calibri"):
    shape = slide.shapes.add_textbox(x, y, w, h)
    tf = shape.text_frame
    tf.word_wrap = wrap
    tf.margin_left = 0; tf.margin_right = 0
    tf.margin_top = 0;  tf.margin_bottom = 0
    p = tf.paragraphs[0]
    p.alignment = align
    run = p.add_run()
    run.text = text
    run.font.name = font
    run.font.size = Pt(size)
    run.font.bold = bold
    run.font.italic = italic
    run.font.color.rgb = color
    return shape

# ── helper: add rectangle ───────────────────────────────────────
def rect(slide, x, y, w, h, fill_color, line_color=None, line_width=Pt(0)):
    shape = slide.shapes.add_shape(1, x, y, w, h)   # MSO_SHAPE_TYPE.RECTANGLE = 1
    shape.fill.solid()
    shape.fill.fore_color.rgb = fill_color
    if line_color:
        shape.line.color.rgb = line_color
        shape.line.width = line_width
    else:
        shape.line.fill.background()
    return shape

# ── helper: add image from URL ──────────────────────────────────
def add_image_url(slide, url, x, y, w, h):
    try:
        result = json.loads(subprocess.check_output(
            ["python", "/tmp/skills/shared/scripts/fetch_images.py", url],
            timeout=30
        ))
        if result and result[0].get("base64"):
            raw = base64.b64decode(result[0]["base64"].split(",", 1)[-1])
            slide.shapes.add_picture(BytesIO(raw), x, y, w, h)
            return True
    except Exception as e:
        print(f"Image fetch failed for {url}: {e}")
    return False

# ── helper: multi-line text box ─────────────────────────────────
def multi_tb(slide, lines, x, y, w, h, size=15, color=DARK_TEXT,
             bold_first=False, bullet=True, line_spacing=1.15, font="Calibri"):
    shape = slide.shapes.add_textbox(x, y, w, h)
    tf = shape.text_frame
    tf.word_wrap = True
    tf.margin_left = Inches(0.05)
    tf.margin_right = 0
    tf.margin_top = 0
    tf.margin_bottom = 0
    for i, line in enumerate(lines):
        if i == 0:
            p = tf.paragraphs[0]
        else:
            p = tf.add_paragraph()
        p.space_before = Pt(3)
        prefix = "• " if bullet else ""
        run = p.add_run()
        run.text = prefix + line
        run.font.name = font
        run.font.size = Pt(size)
        run.font.color.rgb = color
        run.font.bold = (bold_first and i == 0)
    return shape

# ═══════════════════════════════════════════════════════════════
# SLIDE 1 – TITLE SLIDE
# ═══════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
set_bg(slide, DARK_BLUE)

# top accent bar
rect(slide, 0, 0, W, Inches(0.08), GOLD)
# bottom accent bar
rect(slide, 0, H - Inches(0.08), W, Inches(0.08), GOLD)

# central white card
card_y = Inches(1.2)
card_h = Inches(5.1)
rect(slide, Inches(1.5), card_y, Inches(10.3), card_h, WHITE)

# title
tb(slide, "NASOPHARYNX", Inches(1.7), Inches(1.6), Inches(9.9), Inches(1.4),
   size=52, bold=True, color=DARK_BLUE, align=PP_ALIGN.CENTER, font="Calibri")

# subtitle line
rect(slide, Inches(4.5), Inches(3.05), Inches(4.3), Inches(0.05), MID_BLUE)

tb(slide, "Anatomy, Applied Anatomy & Clinical Significance",
   Inches(1.7), Inches(3.2), Inches(9.9), Inches(0.8),
   size=20, bold=False, color=MID_BLUE, align=PP_ALIGN.CENTER, font="Calibri")

tb(slide, "Based on Gray's Anatomy for Students & Scott-Brown's Otorhinolaryngology",
   Inches(1.7), Inches(4.05), Inches(9.9), Inches(0.5),
   size=14, italic=True, color=RGBColor(0x66, 0x66, 0x66), align=PP_ALIGN.CENTER)

tb(slide, "Seminar Presentation  |  Head & Neck Anatomy",
   Inches(1.7), Inches(5.6), Inches(9.9), Inches(0.5),
   size=13, color=RGBColor(0x88, 0x88, 0x88), align=PP_ALIGN.CENTER)

# ═══════════════════════════════════════════════════════════════
# SLIDE 2 – OVERVIEW / TABLE OF CONTENTS
# ═══════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
set_bg(slide, LIGHT_GRAY)

# header bar
rect(slide, 0, 0, W, Inches(1.15), DARK_BLUE)
tb(slide, "OVERVIEW", Inches(0.5), Inches(0.25), Inches(12), Inches(0.7),
   size=32, bold=True, color=WHITE, align=PP_ALIGN.LEFT)

topics = [
    ("1", "Introduction & Definition"),
    ("2", "Boundaries & Walls"),
    ("3", "Lateral Wall – Key Features"),
    ("4", "Pharyngeal Tonsil (Adenoids)"),
    ("5", "Fascia of the Nasopharynx"),
    ("6", "Blood Supply & Venous Drainage"),
    ("7", "Lymphatic Drainage"),
    ("8", "Nerve Supply"),
    ("9", "Histology / Epithelium"),
    ("10", "Clinical Significance"),
]

cols = [topics[:5], topics[5:]]
col_xs = [Inches(0.7), Inches(7.0)]
for ci, col in enumerate(cols):
    cx = col_xs[ci]
    for ri, (num, topic) in enumerate(col):
        y = Inches(1.5) + ri * Inches(1.0)
        rect(slide, cx, y, Inches(0.55), Inches(0.55), MID_BLUE)
        tb(slide, num, cx, y, Inches(0.55), Inches(0.55),
           size=18, bold=True, color=WHITE, align=PP_ALIGN.CENTER)
        tb(slide, topic, cx + Inches(0.65), y + Inches(0.05),
           Inches(5.5), Inches(0.5), size=17, color=DARK_TEXT, bold=False)

# ═══════════════════════════════════════════════════════════════
# SLIDE 3 – WHAT IS THE NASOPHARYNX?
# ═══════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
set_bg(slide, WHITE)

rect(slide, 0, 0, W, Inches(1.1), DARK_BLUE)
tb(slide, "WHAT IS THE NASOPHARYNX?", Inches(0.5), Inches(0.2), Inches(12), Inches(0.75),
   size=28, bold=True, color=WHITE)

# left panel text
points = [
    "The uppermost part of the pharynx",
    "Lies purely in the RESPIRATORY pathway (not digestive)",
    "Located: behind the posterior choanae of nasal cavities",
    "Located: above the level of the soft palate",
    "Always OPEN - never collapses during breathing",
    "Unlike oropharynx & laryngopharynx which can collapse",
]
multi_tb(slide, points, Inches(0.4), Inches(1.3), Inches(6.8), Inches(5.5),
         size=17, color=DARK_TEXT, bullet=True)

# key box
rect(slide, Inches(0.4), Inches(5.5), Inches(6.8), Inches(1.3), LIGHT_BLUE)
tb(slide, "Key Fact: The nasopharynx is the only part of the pharynx that is EXCLUSIVELY respiratory — it has no role in swallowing or voice production.",
   Inches(0.55), Inches(5.6), Inches(6.5), Inches(1.1),
   size=14, italic=True, color=DARK_BLUE)

# right: endoscopic image
tb(slide, "Endoscopic view – Normal Nasopharynx", Inches(7.5), Inches(1.2), Inches(5.3), Inches(0.4),
   size=13, bold=True, color=MID_BLUE, align=PP_ALIGN.CENTER)
add_image_url(slide,
    "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_5d15b9839cb4f55b5b80d22c96d09cb347430cd23335462a612461efb1a81926.jpg",
    Inches(7.5), Inches(1.65), Inches(5.3), Inches(4.8))

# ═══════════════════════════════════════════════════════════════
# SLIDE 4 – BOUNDARIES & WALLS
# ═══════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
set_bg(slide, WHITE)

rect(slide, 0, 0, W, Inches(1.1), MID_BLUE)
tb(slide, "BOUNDARIES & WALLS", Inches(0.5), Inches(0.2), Inches(12), Inches(0.75),
   size=28, bold=True, color=WHITE)

walls = [
    ("ROOF & POSTERIOR WALL", [
        "Formed by base of skull (sloping)",
        "Posterior body of sphenoid bone (floor of sphenoid sinus)",
        "Basal occipital bone (clivus)",
        "Together form a domed vault at top of pharynx",
    ]),
    ("ANTERIOR WALL", [
        "Communicates with nasal cavities via CHOANAE",
        "(Posterior nasal apertures)",
    ]),
    ("INFERIOR BOUNDARY", [
        "Pharyngeal isthmus",
        "Caused by palatopharyngeal sphincter (superior constrictor)",
        "Closed during swallowing → prevents nasal regurgitation",
        "Closed during phonation → separates nasal from oral cavity",
    ]),
    ("LATERAL WALLS", [
        "Eustachian tube opening + torus tubarius",
        "Fossa of Rosenmüller (pharyngeal recess)",
        "Salpingopharyngeal fold",
        "Torus levatorius",
    ]),
]

colors_wall = [DARK_BLUE, MID_BLUE, RGBColor(0x22, 0x86, 0x50), RED_ACCENT]
xs = [Inches(0.3), Inches(3.55), Inches(6.8), Inches(10.05)]
for i, (title, pts) in enumerate(walls):
    x = xs[i]
    rect(slide, x, Inches(1.2), Inches(3.0), Inches(0.5), colors_wall[i])
    tb(slide, title, x + Inches(0.08), Inches(1.25), Inches(2.85), Inches(0.45),
       size=11, bold=True, color=WHITE, align=PP_ALIGN.CENTER, wrap=True)
    rect(slide, x, Inches(1.7), Inches(3.0), Inches(5.0), LIGHT_BLUE)
    multi_tb(slide, pts, x + Inches(0.1), Inches(1.8), Inches(2.8), Inches(4.7),
             size=14, color=DARK_TEXT, bullet=True)

# ═══════════════════════════════════════════════════════════════
# SLIDE 5 – LATERAL WALL KEY FEATURES
# ═══════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
set_bg(slide, LIGHT_GRAY)

rect(slide, 0, 0, W, Inches(1.1), DARK_BLUE)
tb(slide, "LATERAL WALL – KEY FEATURES", Inches(0.5), Inches(0.2), Inches(12), Inches(0.75),
   size=28, bold=True, color=WHITE)

# Left text panel
features = [
    ("A. Pharyngotympanic (Eustachian) Tube Opening", [
        "Located posterior to & slightly above level of hard palate",
        "Projects into nasopharynx from posterolateral direction",
        "Posterior rim forms TORUS TUBARIUS (tubal elevation)",
        "Behind torus tubarius → PHARYNGEAL RECESS (Fossa of Rosenmüller)",
        "⚠ Fossa of Rosenmüller = most common site of nasopharyngeal carcinoma",
    ]),
    ("B. Mucosal Folds", [
        "Salpingopharyngeal fold – vertical fold, overlies salpingopharyngeus muscle",
        "Torus levatorius – broad elevation, overlies levator veli palatini",
    ]),
]

y_off = Inches(1.25)
for feat_title, feat_pts in features:
    rect(slide, Inches(0.4), y_off, Inches(7.2), Inches(0.45), MID_BLUE)
    tb(slide, feat_title, Inches(0.5), y_off + Inches(0.04), Inches(7.0), Inches(0.4),
       size=13, bold=True, color=WHITE)
    y_off += Inches(0.5)
    multi_tb(slide, feat_pts, Inches(0.4), y_off, Inches(7.2), Inches(len(feat_pts) * 0.42 + 0.2),
             size=14, color=DARK_TEXT, bullet=True)
    y_off += Inches(len(feat_pts) * 0.42 + 0.35)

# right: endoscopic image
tb(slide, "Endoscopic View – Lateral Nasopharynx", Inches(8.0), Inches(1.2), Inches(5.0), Inches(0.4),
   size=13, bold=True, color=MID_BLUE, align=PP_ALIGN.CENTER)
add_image_url(slide,
    "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_0efdfd1926403a0bb5cfd79fadad2e7c6d8c615f37fbe7e38cd7c26a8f2964d9.jpg",
    Inches(8.0), Inches(1.65), Inches(5.0), Inches(5.0))

# caption box
rect(slide, Inches(8.0), Inches(6.7), Inches(5.0), Inches(0.6), RGBColor(0xFF, 0xF3, 0xCD))
tb(slide, "Torus tubarius, Eustachian tube orifice & salpingopharyngeus fold visible",
   Inches(8.1), Inches(6.75), Inches(4.8), Inches(0.5),
   size=11, italic=True, color=DARK_TEXT)

# ═══════════════════════════════════════════════════════════════
# SLIDE 6 – PHARYNGEAL TONSIL / ADENOIDS
# ═══════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
set_bg(slide, WHITE)

rect(slide, 0, 0, W, Inches(1.1), RGBColor(0x22, 0x86, 0x50))
tb(slide, "PHARYNGEAL TONSIL (ADENOIDS)", Inches(0.5), Inches(0.2), Inches(12), Inches(0.75),
   size=28, bold=True, color=WHITE)

left_pts = [
    "Large collection of lymphoid tissue in the roof & posterior wall",
    "Part of WALDEYER'S TONSILLAR RING",
    "In children → may enlarge significantly (Adenoids)",
    "",
    "WHEN ENLARGED:",
    "• Obstructs the nasopharynx",
    "• Forces child to breathe through mouth",
    "• One of the most common causes of chronic nasal obstruction in children",
    "• Blocks pharyngotympanic tube → Otitis Media with Effusion (glue ear)",
    "• Can cause snoring, sleep-disordered breathing",
    "",
    "WALDEYER'S RING COMPONENTS:",
    "• Pharyngeal tonsil (adenoids) — roof",
    "• Tubal tonsils — near Eustachian tube opening",
    "• Palatine tonsils — lateral oropharynx",
    "• Lingual tonsil — base of tongue",
]

multi_tb(slide, left_pts, Inches(0.4), Inches(1.25), Inches(7.0), Inches(5.8),
         size=15, color=DARK_TEXT, bullet=False)

# right info box
rect(slide, Inches(7.8), Inches(1.3), Inches(5.0), Inches(5.5), LIGHT_BLUE)
tb(slide, "Clinical Pearl", Inches(7.9), Inches(1.4), Inches(4.8), Inches(0.45),
   size=16, bold=True, color=DARK_BLUE)
rect(slide, Inches(7.9), Inches(1.85), Inches(4.6), Inches(0.04), GOLD)

clinical_pts = [
    "Adenoid hypertrophy is most common in children aged 3–8 years.",
    "",
    "Signs & symptoms include:",
    "• Persistent nasal congestion / mouth breathing",
    "• Snoring",
    "• Hyponasal voice ('muffled' speech)",
    "• Recurrent otitis media",
    "• 'Adenoid facies' (open-mouth posture, elongated face)",
    "",
    "Treatment: Adenoidectomy in symptomatic cases",
]
multi_tb(slide, clinical_pts, Inches(7.9), Inches(1.95), Inches(4.7), Inches(4.7),
         size=14, color=DARK_TEXT, bullet=False)

# ═══════════════════════════════════════════════════════════════
# SLIDE 7 – FASCIA
# ═══════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
set_bg(slide, LIGHT_GRAY)

rect(slide, 0, 0, W, Inches(1.1), DARK_BLUE)
tb(slide, "FASCIA OF THE NASOPHARYNX", Inches(0.5), Inches(0.2), Inches(12), Inches(0.75),
   size=28, bold=True, color=WHITE)

# table
headers = ["FASCIA", "LOCATION", "ROLE"]
rows = [
    ["Buccopharyngeal fascia", "OUTSIDE the muscular wall", "Part of pretracheal cervical fascia"],
    ["Pharyngobasilar fascia", "Lines the INNER surface (thick)", "Reinforces wall where muscle is deficient"],
]
col_ws = [Inches(3.5), Inches(4.5), Inches(4.5)]
col_xs2 = [Inches(0.4), Inches(3.9), Inches(8.4)]
row_h = Inches(0.7)
# header row
for ci, hdr in enumerate(headers):
    rect(slide, col_xs2[ci], Inches(1.3), col_ws[ci], row_h, DARK_BLUE)
    tb(slide, hdr, col_xs2[ci] + Inches(0.1), Inches(1.35), col_ws[ci] - Inches(0.2), row_h,
       size=15, bold=True, color=WHITE, align=PP_ALIGN.CENTER)
for ri, row in enumerate(rows):
    bg = WHITE if ri % 2 == 0 else LIGHT_BLUE
    for ci, cell in enumerate(row):
        rect(slide, col_xs2[ci], Inches(1.3) + (ri+1)*row_h, col_ws[ci], row_h, bg,
             line_color=RGBColor(0xCC, 0xCC, 0xCC), line_width=Pt(0.5))
        tb(slide, cell, col_xs2[ci]+Inches(0.1), Inches(1.35)+(ri+1)*row_h,
           col_ws[ci]-Inches(0.2), row_h, size=14, color=DARK_TEXT, wrap=True)

# note on pharyngobasilar fascia
y2 = Inches(3.25)
rect(slide, Inches(0.4), y2, Inches(12.5), Inches(3.9), WHITE)
tb(slide, "About the Pharyngobasilar Fascia", Inches(0.5), y2 + Inches(0.1), Inches(12), Inches(0.45),
   size=17, bold=True, color=MID_BLUE)
pts2 = [
    "At the upper part (roof & posterior wall), the superior constrictor muscle is ABSENT",
    "Here the pharyngeal wall consists almost entirely of the pharyngobasilar fascia",
    "Reinforced externally by levator veli palatini and tensor veli palatini (soft palate muscles)",
    "Anteriorly, this fascia attaches to the medial pterygoid plates on both sides",
    "This 'weak area' at the top of the pharynx allows for pathological spread (e.g. NPC skull base invasion)",
]
multi_tb(slide, pts2, Inches(0.5), y2 + Inches(0.6), Inches(12.3), Inches(3.1),
         size=15, color=DARK_TEXT, bullet=True)

# ═══════════════════════════════════════════════════════════════
# SLIDE 8 – BLOOD SUPPLY & VENOUS DRAINAGE
# ═══════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
set_bg(slide, WHITE)

rect(slide, 0, 0, W, Inches(1.1), MID_BLUE)
tb(slide, "BLOOD SUPPLY & VENOUS DRAINAGE", Inches(0.5), Inches(0.2), Inches(12), Inches(0.75),
   size=28, bold=True, color=WHITE)

# Arterial panel
rect(slide, Inches(0.4), Inches(1.25), Inches(6.0), Inches(5.6), LIGHT_BLUE)
tb(slide, "⬛ ARTERIAL SUPPLY", Inches(0.5), Inches(1.35), Inches(5.8), Inches(0.5),
   size=17, bold=True, color=DARK_BLUE)
art_pts = [
    "All branches of the EXTERNAL CAROTID ARTERY:",
    "",
    "• Ascending pharyngeal artery — MAIN supply to nasopharynx",
    "• Ascending palatine artery (from facial artery)",
    "• Tonsillar branches of facial artery",
    "• Branches of maxillary artery",
    "• Branches of lingual artery",
]
multi_tb(slide, art_pts, Inches(0.5), Inches(1.9), Inches(5.7), Inches(3.5),
         size=15, color=DARK_TEXT, bullet=False)

# Venous panel
rect(slide, Inches(0.4), Inches(5.1), Inches(6.0), Inches(1.6), RGBColor(0xFF, 0xF0, 0xE0))
tb(slide, "⬛ VENOUS DRAINAGE", Inches(0.5), Inches(5.2), Inches(5.8), Inches(0.45),
   size=17, bold=True, color=RED_ACCENT)
ven_pts = [
    "Pharyngeal venous plexus drains:",
    "• Superiorly → Pterygoid plexus (infratemporal fossa)",
    "• Inferiorly → Facial vein & Internal jugular vein",
]
multi_tb(slide, ven_pts, Inches(0.5), Inches(5.65), Inches(5.7), Inches(1.0),
         size=14, color=DARK_TEXT, bullet=False)

# Right: mnemonic box
rect(slide, Inches(6.8), Inches(1.25), Inches(6.0), Inches(5.6), DARK_BLUE)
tb(slide, "Memory Aid", Inches(6.9), Inches(1.4), Inches(5.7), Inches(0.5),
   size=17, bold=True, color=GOLD)
rect(slide, Inches(6.9), Inches(1.9), Inches(5.6), Inches(0.04), GOLD)
mem_pts = [
    '"A Pharynx Needs Ample Fluid, May Leak"',
    "",
    "A  – Ascending pharyngeal (MAIN)",
    "P  – Palatine ascending (facial a.)",
    "N  – Nasal branches / maxillary a.",
    "A  – Adjacent tonsillar (facial a.)",
    "F  – Facial artery branches",
    "M  – Maxillary a. (multiple branches)",
    "L  – Lingual artery branches",
    "",
    "Source: Gray's Anatomy for Students,",
    "p. 1034",
]
multi_tb(slide, mem_pts, Inches(6.9), Inches(2.0), Inches(5.7), Inches(4.6),
         size=14, color=WHITE, bullet=False)

# ═══════════════════════════════════════════════════════════════
# SLIDE 9 – LYMPHATIC DRAINAGE
# ═══════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
set_bg(slide, LIGHT_GRAY)

rect(slide, 0, 0, W, Inches(1.1), DARK_BLUE)
tb(slide, "LYMPHATIC DRAINAGE", Inches(0.5), Inches(0.2), Inches(12), Inches(0.75),
   size=28, bold=True, color=WHITE)

# flow diagram
steps = [
    ("Nasopharyngeal mucosa\n(Primary lymphatics)", DARK_BLUE),
    ("Retropharyngeal lymph nodes\n(Nodes of Rouvière)\n1st echelon nodes\nbetween nasopharynx &\nvertebral column", MID_BLUE),
    ("Upper deep cervical nodes\n(Jugulodigastric)", RGBColor(0x22, 0x86, 0x50)),
    ("Lower cervical nodes\n(Step-wise progression)", RGBColor(0x7D, 0x3C, 0x98)),
]

arrow_x = Inches(0.4)
for i, (label, col) in enumerate(steps):
    bx = arrow_x + i * Inches(3.3)
    rect(slide, bx, Inches(1.5), Inches(3.0), Inches(2.5), col)
    tb(slide, label, bx + Inches(0.1), Inches(1.6), Inches(2.8), Inches(2.3),
       size=14, bold=False, color=WHITE, align=PP_ALIGN.CENTER)
    if i < len(steps) - 1:
        tb(slide, "▶", bx + Inches(3.0), Inches(2.25), Inches(0.4), Inches(0.5),
           size=24, bold=True, color=DARK_BLUE)

# clinical note
rect(slide, Inches(0.4), Inches(4.3), Inches(12.5), Inches(2.7), WHITE)
tb(slide, "Clinical Importance of Bilateral Drainage", Inches(0.5), Inches(4.4), Inches(12), Inches(0.45),
   size=17, bold=True, color=RED_ACCENT)
clin_pts = [
    "Lymphatics from the nasopharynx drain BILATERALLY into retropharyngeal nodes",
    "This explains why nasopharyngeal carcinoma frequently presents with BILATERAL cervical lymphadenopathy",
    "Nodes of Rouvière (retropharyngeal) = first-echelon nodes → cannot be palpated clinically",
    "NPC classically presents as a painless NECK LUMP — often the first clinical sign",
    "The bilateral drainage pattern means even unilateral NPC can cause bilateral neck node enlargement",
]
multi_tb(slide, clin_pts, Inches(0.5), Inches(4.9), Inches(12.3), Inches(2.0),
         size=14, color=DARK_TEXT, bullet=True)

# ═══════════════════════════════════════════════════════════════
# SLIDE 10 – NERVE SUPPLY
# ═══════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
set_bg(slide, WHITE)

rect(slide, 0, 0, W, Inches(1.1), RGBColor(0x7D, 0x3C, 0x98))
tb(slide, "NERVE SUPPLY", Inches(0.5), Inches(0.2), Inches(12), Inches(0.75),
   size=28, bold=True, color=WHITE)

# Motor
rect(slide, Inches(0.4), Inches(1.25), Inches(12.5), Inches(3.0), LIGHT_BLUE)
tb(slide, "MOTOR INNERVATION", Inches(0.5), Inches(1.35), Inches(12), Inches(0.45),
   size=17, bold=True, color=DARK_BLUE)
mot_pts = [
    "ALL pharyngeal muscles → VAGUS NERVE [X] via the PHARYNGEAL PLEXUS",
    "EXCEPTION: Stylopharyngeus → GLOSSOPHARYNGEAL NERVE [IX] (directly)",
    "Pharyngeal plexus is formed by: Pharyngeal branch of Vagus [X] (major motor) + External laryngeal nerve (from Vagus) + Pharyngeal branches of Glossopharyngeal [IX]",
]
multi_tb(slide, mot_pts, Inches(0.5), Inches(1.85), Inches(12.3), Inches(1.2),
         size=15, color=DARK_TEXT, bullet=True)

# Sensory table
rect(slide, Inches(0.4), Inches(4.4), Inches(12.5), Inches(2.85), LIGHT_GRAY)
tb(slide, "SENSORY INNERVATION — Each region has DIFFERENT sensory supply",
   Inches(0.5), Inches(4.5), Inches(12.3), Inches(0.45),
   size=17, bold=True, color=RGBColor(0x7D, 0x3C, 0x98))

sens_rows = [
    ("NASOPHARYNX", "Pharyngeal branch of Maxillary nerve [V2]", "Via palatovaginal canal in sphenoid bone → originates in pterygopalatine fossa"),
    ("OROPHARYNX",  "Glossopharyngeal nerve [IX]",                "Main sensory nerve of oropharynx"),
    ("LARYNGOPHARYNX", "Vagus [X] — internal branch of superior laryngeal nerve", "Sensory from vallecula to vocal folds"),
]
scol_ws = [Inches(2.2), Inches(4.5), Inches(5.5)]
scol_xs = [Inches(0.4), Inches(2.65), Inches(7.2)]
for ri, (reg, nerve, note) in enumerate(sens_rows):
    bg2 = WHITE if ri % 2 == 0 else LIGHT_BLUE
    ry = Inches(5.0) + ri * Inches(0.65)
    for ci, (cell, cw, cx) in enumerate(zip([reg, nerve, note], scol_ws, scol_xs)):
        rect(slide, cx, ry, cw, Inches(0.65), bg2,
             line_color=RGBColor(0xCC, 0xCC, 0xCC), line_width=Pt(0.5))
        tb(slide, cell, cx + Inches(0.05), ry + Inches(0.05), cw - Inches(0.1), Inches(0.55),
           size=13, color=DARK_TEXT, wrap=True)

# header row
for ci, (hdr, cw, cx) in enumerate(zip(["REGION", "SENSORY NERVE", "NOTES"], scol_ws, scol_xs)):
    rect(slide, cx, Inches(4.95), cw, Inches(0.5), RGBColor(0x7D, 0x3C, 0x98),
         line_color=RGBColor(0x60, 0x30, 0x70), line_width=Pt(0.5))
    tb(slide, hdr, cx + Inches(0.05), Inches(4.98), cw - Inches(0.1), Inches(0.44),
       size=13, bold=True, color=WHITE, align=PP_ALIGN.CENTER)

# ═══════════════════════════════════════════════════════════════
# SLIDE 11 – HISTOLOGY
# ═══════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
set_bg(slide, WHITE)

rect(slide, 0, 0, W, Inches(1.1), RGBColor(0x22, 0x86, 0x50))
tb(slide, "HISTOLOGY / EPITHELIUM", Inches(0.5), Inches(0.2), Inches(12), Inches(0.75),
   size=28, bold=True, color=WHITE)

# comparison table
regions_hist = [
    ("NASOPHARYNX\n(Upper)", "Pseudostratified\nCiliated Columnar\n(RESPIRATORY)\nepithelium",
     "Same as nasal\ncavities &\nparanasal sinuses",
     RGBColor(0x1A, 0x73, 0xAA)),
    ("OROPHARYNX\n(Middle)", "Stratified\nSquamous\nepithelium\n(non-keratinised)",
     "Withstands\nmechanical\nstress of food",
     RGBColor(0x22, 0x86, 0x50)),
    ("LARYNGOPHARYNX\n(Lower)", "Stratified\nSquamous\nepithelium\n(non-keratinised)",
     "Same as\noropharynx\n(food passage)",
     RGBColor(0x7D, 0x3C, 0x98)),
]
card_w = Inches(3.8)
for i, (reg, epi, reason, col) in enumerate(regions_hist):
    cx2 = Inches(0.4) + i * Inches(4.2)
    rect(slide, cx2, Inches(1.3), card_w, Inches(0.6), col)
    tb(slide, reg, cx2, Inches(1.3), card_w, Inches(0.6),
       size=15, bold=True, color=WHITE, align=PP_ALIGN.CENTER)
    rect(slide, cx2, Inches(1.9), card_w, Inches(2.0), LIGHT_BLUE if i == 0 else LIGHT_GRAY)
    tb(slide, epi, cx2 + Inches(0.1), Inches(1.95), card_w - Inches(0.2), Inches(1.9),
       size=16, bold=True, color=col, align=PP_ALIGN.CENTER)
    rect(slide, cx2, Inches(3.9), card_w, Inches(1.2), WHITE)
    tb(slide, reason, cx2 + Inches(0.1), Inches(3.95), card_w - Inches(0.2), Inches(1.1),
       size=13, italic=True, color=DARK_TEXT, align=PP_ALIGN.CENTER)

# Key point
rect(slide, Inches(0.4), Inches(5.3), Inches(12.5), Inches(1.8), DARK_BLUE)
tb(slide, "KEY EXAM POINT", Inches(0.55), Inches(5.4), Inches(12), Inches(0.45),
   size=16, bold=True, color=GOLD)
tb(slide, "The nasopharynx is the ONLY part of the pharynx lined by RESPIRATORY (pseudostratified ciliated columnar) epithelium. The oropharynx and laryngopharynx are both lined by stratified squamous epithelium because they are shared with the digestive tract.",
   Inches(0.55), Inches(5.88), Inches(12.3), Inches(1.1),
   size=15, color=WHITE, wrap=True)

# ═══════════════════════════════════════════════════════════════
# SLIDE 12 – CLINICAL SIGNIFICANCE (NPC + others)
# ═══════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
set_bg(slide, WHITE)

rect(slide, 0, 0, W, Inches(1.1), RED_ACCENT)
tb(slide, "CLINICAL SIGNIFICANCE", Inches(0.5), Inches(0.2), Inches(12), Inches(0.75),
   size=28, bold=True, color=WHITE)

clin_items = [
    ("Adenoids\n(Enlarged\nPharyngeal Tonsil)", 
     "Blocks choanae → nasal obstruction, mouth breathing, snoring\nBlocks Eustachian tube → Otitis media with effusion (Glue ear)",
     MID_BLUE),
    ("Nasopharyngeal\nCarcinoma (NPC)",
     "Arises from fossa of Rosenmüller\nAssociated with EBV infection\nInvades parapharyngeal space & skull base via sphenoid\nPresentswith painless bilateral neck lymphadenopathy\nMRI shows mass in nasopharynx with skull base invasion",
     RED_ACCENT),
    ("Eustachian Tube\nDysfunction",
     "Inflammation of nasopharyngeal mucosa (e.g. in URTI)\nObstructs tube opening → ear pain, hearing loss, otitis media",
     RGBColor(0x22, 0x86, 0x50)),
    ("Regurgitation\nThrough Nose",
     "Damaged soft palate / pharyngeal isthmus incompetence\nFood/liquid enters nasopharynx during swallowing",
     RGBColor(0xF5, 0xA6, 0x23)),
]

card_w2 = Inches(3.0)
for i, (cond, mech, col) in enumerate(clin_items):
    cx3 = Inches(0.4) + i * Inches(3.2)
    rect(slide, cx3, Inches(1.3), card_w2, Inches(0.9), col)
    tb(slide, cond, cx3 + Inches(0.05), Inches(1.35), card_w2 - Inches(0.1), Inches(0.85),
       size=13, bold=True, color=WHITE, align=PP_ALIGN.CENTER)
    rect(slide, cx3, Inches(2.2), card_w2, Inches(3.4), LIGHT_BLUE if i % 2 == 0 else LIGHT_GRAY)
    multi_tb(slide, mech.split("\n"), cx3 + Inches(0.1), Inches(2.3),
             card_w2 - Inches(0.2), Inches(3.1), size=13, color=DARK_TEXT, bullet=True)

# NPC MRI image
tb(slide, "MRI – Nasopharyngeal Carcinoma", Inches(0.4), Inches(5.75), Inches(12.5), Inches(0.4),
   size=13, bold=True, color=RED_ACCENT, align=PP_ALIGN.CENTER)
add_image_url(slide,
    "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_2e8cc8b844827bb1146446f9d609cdef6b73af91be91aee9ae2df4bdea7f7d5c.jpg",
    Inches(3.5), Inches(6.15), Inches(6.3), Inches(1.15))

# ═══════════════════════════════════════════════════════════════
# SLIDE 13 – NPC DETAILED
# ═══════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
set_bg(slide, LIGHT_GRAY)

rect(slide, 0, 0, W, Inches(1.1), RED_ACCENT)
tb(slide, "NASOPHARYNGEAL CARCINOMA (NPC) — IN DETAIL", Inches(0.5), Inches(0.2), Inches(12), Inches(0.75),
   size=24, bold=True, color=WHITE)

# left text
npc_pts = [
    "ORIGIN: Fossa of Rosenmüller (pharyngeal recess) — lateral wall of nasopharynx",
    "ASSOCIATION: Epstein-Barr Virus (EBV) infection — strong aetiological link",
    "SPREAD: ",
    "  • Parapharyngeal space invasion",
    "  • Skull base invasion via sphenoid (via pharyngobasilar fascia deficiency)",
    "  • Perineural spread along cranial nerves",
    "  • Lymphatic spread — bilateral retropharyngeal & cervical nodes",
    "PRESENTATION:",
    "  • Painless bilateral neck lump (often FIRST sign)",
    "  • Unilateral nasal blockage / epistaxis",
    "  • Unilateral hearing loss / otitis media (Eustachian tube blockage)",
    "  • Cranial nerve palsies (advanced disease)",
    "IMAGING: MRI of nasopharynx → tumour at fossa of Rosenmüller with skull base extension",
    "STAGING: TNM staging system (UICC/AJCC)",
    "TREATMENT: Radiotherapy ± chemotherapy (surgery rarely performed)",
]
multi_tb(slide, npc_pts, Inches(0.4), Inches(1.25), Inches(7.0), Inches(5.8),
         size=14, color=DARK_TEXT, bullet=False)

# right: NPC endoscopy image
tb(slide, "Endoscopy – NPC in Nasopharynx", Inches(7.7), Inches(1.2), Inches(5.2), Inches(0.4),
   size=13, bold=True, color=RED_ACCENT, align=PP_ALIGN.CENTER)
add_image_url(slide,
    "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_27b350be7c2a4f5073d4cb6eee54fb74669b9bd4488d93d40dfad503d21c6f4a.jpg",
    Inches(7.7), Inches(1.65), Inches(5.2), Inches(4.5))

rect(slide, Inches(7.7), Inches(6.2), Inches(5.2), Inches(0.6), RGBColor(0xFF, 0xDD, 0xDD))
tb(slide, "Mucosal irregularity, exophytic mass in fossa of Rosenmüller",
   Inches(7.8), Inches(6.25), Inches(5.0), Inches(0.5),
   size=11, italic=True, color=RED_ACCENT)

# ═══════════════════════════════════════════════════════════════
# SLIDE 14 – EXAM SUMMARY
# ═══════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
set_bg(slide, DARK_BLUE)

rect(slide, 0, 0, W, Inches(0.08), GOLD)
rect(slide, 0, H - Inches(0.08), W, Inches(0.08), GOLD)

tb(slide, "KEY EXAM POINTS — SUMMARY", Inches(0.5), Inches(0.2), Inches(12.3), Inches(0.7),
   size=26, bold=True, color=GOLD, align=PP_ALIGN.CENTER)

summary_pts = [
    ("1", "Location", "Behind choanae, above soft palate — purely RESPIRATORY part of pharynx"),
    ("2", "Roof", "Sphenoid body + basal occipital (clivus) — always patent / open"),
    ("3", "Inferior boundary", "Pharyngeal isthmus (closed by soft palate during swallowing/phonation)"),
    ("4", "Lateral wall landmark", "Torus tubarius (Eustachian tube elevation) + Pharyngeal recess (Fossa of Rosenmüller)"),
    ("5", "Folds", "Salpingopharyngeal fold (salpingopharyngeus) + Torus levatorius (levator palatini)"),
    ("6", "Lymphoid tissue", "Pharyngeal tonsil = Adenoids (part of Waldeyer's ring)"),
    ("7", "Arterial supply", "Ascending pharyngeal artery (MAIN) — branch of External Carotid Artery"),
    ("8", "Sensory nerve", "Maxillary nerve V2 (pharyngeal branch via palatovaginal canal)"),
    ("9", "Motor nerve", "Vagus [X] via pharyngeal plexus (ALL muscles except stylopharyngeus → CN IX)"),
    ("10", "Lymphatics", "→ Retropharyngeal nodes (Rouvière) → Upper deep cervical nodes (bilateral)"),
    ("11", "Epithelium", "Pseudostratified ciliated COLUMNAR (respiratory type)"),
]

rows_per_col = 6
col_xs3 = [Inches(0.3), Inches(6.8)]
for ci in range(2):
    rows = summary_pts[ci*rows_per_col : (ci+1)*rows_per_col]
    for ri, (num, topic, detail) in enumerate(rows):
        y3 = Inches(1.05) + ri * Inches(1.03)
        cx4 = col_xs3[ci]
        rect(slide, cx4, y3, Inches(0.5), Inches(0.5), GOLD)
        tb(slide, num, cx4, y3, Inches(0.5), Inches(0.5),
           size=14, bold=True, color=DARK_BLUE, align=PP_ALIGN.CENTER)
        tb(slide, topic.upper(), cx4 + Inches(0.55), y3, Inches(5.9), Inches(0.28),
           size=12, bold=True, color=GOLD)
        tb(slide, detail, cx4 + Inches(0.55), y3 + Inches(0.28), Inches(5.9), Inches(0.65),
           size=13, color=WHITE, wrap=True)

# source footer
rect(slide, 0, H - Inches(0.5), W, Inches(0.42), RGBColor(0x06, 0x22, 0x3C))
tb(slide, "Source: Gray's Anatomy for Students (pp. 1031–1036) | Scott-Brown's Otorhinolaryngology Head & Neck Surgery",
   Inches(0.5), H - Inches(0.46), Inches(12.3), Inches(0.38),
   size=11, italic=True, color=RGBColor(0xAA, 0xCC, 0xEE), align=PP_ALIGN.CENTER)

# ─── SAVE ───────────────────────────────────────────────────────
out = "/tmp/workspace/nasopharynx-seminar/Nasopharynx_Seminar.pptx"
prs.save(out)
print(f"Saved: {out}")
print(f"Slides: {len(prs.slides)}")
Running Command

cd /tmp/workspace/nasopharynx-seminar && python3 build_pptx.py 2>&1

Running Command

ls /tmp/skills/pptx/scripts/ 2>/dev/null || echo "no scripts dir"; ls /tmp/skills/ 2>/dev/null

Running Command

# Download all 4 images using requests python3 -c " import requests, os imgs = { 'img1_lateral_nasopharynx.jpg': 'https://cdn.orris.care/cdss_images/pmc_clinical_VQA_5d15b9839cb4f55b5b80d22c96d09cb347430cd23335462a612461efb1a81926.jpg', 'img2_eustachian_surgery.jpg': 'https://cdn.orris.care/cdss_images/pmc_clinical_VQA_0efdfd1926403a0bb5cfd79fadad2e7c6d8c615f37fbe7e38cd7c26a8f2964d9.jpg', 'img3_npc_mri.jpg': 'https://cdn.orris.care/cdss_images/pmc_clinical_VQA_2e8cc8b844827bb1146446f9d609cdef6b73af91be91aee9ae2df4bdea7f7d5c.jpg', 'img4_npc_endoscopy.jpg': 'https://cdn.orris.care/cdss_images/pmc_clinical_VQA_27b350be7c2a4f5073d4cb6eee54fb74669b9bd4488d93d40dfad503d21c6f4a.jpg', } outdir = '/tmp/workspace/nasopharynx-seminar/' for fname, url in imgs.items(): r = requests.get(url, timeout=20) if r.status_code == 200: with open(outdir + fname, 'wb') as f: f.write(r.content) print(f'OK {fname} ({len(r.content)} bytes)') else: print(f'FAIL {fname} status={r.status_code}') "

Editing File

~/nasopharynx-seminar/build_pptx.py

Successfully replaced 1 instance(s) of the string in '/tmp/workspace/nasopharynx-seminar/build_pptx.py'
Running Command

cd /tmp/workspace/nasopharynx-seminar && python3 build_pptx.py 2>&1

Your credits are exhausted. You can purchase a top-up or subscribe to a plan to continue using Orris. If you're already subscribed, your daily credits will reset tomorrow.
This is a shared conversation. Sign in to Orris to start your own chat.