i am a radiology resident...i am presenting a short case series on spinal dysraphisms including occult dysraphism, lipomyelocele, meningomyelocele, can u prepare 7-8 slide summary on spinal dysraphisms predominantly with images, referring from the rsna article attached below

Reading File
Reading File
Reading File
Running Command

cd /tmp/workspace/attachments/b39a6238-da25-4853-a416-0769e8300cde/ && python3 -c " import pdfplumber with pdfplumber.open('A-Practical-Approach-to-Diagnosis-of-Spinal-Dysraphism.pdf') as pdf: print(f'Total pages: {len(pdf.pages)}') # Extract text from first 5 pages to understand structure for i, page in enumerate(pdf.pages[:6]): print(f'--- PAGE {i+1} ---') text = page.extract_text() if text: print(text[:2000]) print() "

Running Command

cd /tmp/workspace/attachments/b39a6238-da25-4853-a416-0769e8300cde/ && python3 -c " import pdfplumber with pdfplumber.open('A-Practical-Approach-to-Diagnosis-of-Spinal-Dysraphism.pdf') as pdf: # Extract pages 6-17 for the rest of the content for i, page in enumerate(pdf.pages[6:], 7): print(f'--- PAGE {i} ---') text = page.extract_text() if text: print(text[:2500]) print() "

Running Command

cd /tmp/workspace/attachments/b39a6238-da25-4853-a416-0769e8300cde/ && python3 -c " import pdfplumber, os # Extract images from the PDF using pdfplumber with pdfplumber.open('A-Practical-Approach-to-Diagnosis-of-Spinal-Dysraphism.pdf') as pdf: print(f'Total pages: {len(pdf.pages)}') for i, page in enumerate(pdf.pages): imgs = page.images if imgs: print(f'Page {i+1}: {len(imgs)} images') for j, img in enumerate(imgs[:3]): print(f' img {j}: {img.get(\"name\",\"\")} size={img.get(\"width\",0)}x{img.get(\"height\",0)} srcsize={img.get(\"srcsize\",\"?\")}') "

Running Command

mkdir -p /tmp/workspace/spinal-dysraphism-pptx/images && cd /tmp/workspace/attachments/b39a6238-da25-4853-a416-0769e8300cde/ && python3 -c " import pdfplumber, base64, os out_dir = '/tmp/workspace/spinal-dysraphism-pptx/images/' with pdfplumber.open('A-Practical-Approach-to-Diagnosis-of-Spinal-Dysraphism.pdf') as pdf: pages_with_images = [3,4,6,7,9,10,11,13,14,15] # 0-indexed: pages 4,5,7,8,10,11,12,14,15,16 for pg_idx in pages_with_images: page = pdf.pages[pg_idx] for j, img in enumerate(page.images): name = f'page{pg_idx+1}_img{j}.png' # Try to get image data using the page crop try: # Use bbox to crop the image region bbox = (img['x0'], img['top'], img['x1'], img['bottom']) cropped = page.crop(bbox) pil_img = cropped.to_image(resolution=150) path = os.path.join(out_dir, name) pil_img.save(path) print(f'Saved {name} ({img.get(\"srcsize\",\"?\")})') except Exception as e: print(f'Error {name}: {e}') "

Writing File

~/spinal-dysraphism-pptx/build_pptx.py

"""
Build Spinal Dysraphism 8-slide presentation
Source: Trapp et al., RadioGraphics 2021; 41:559-575
"""

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.oxml.ns import qn
from pptx.oxml import parse_xml
from lxml import etree
import os, copy
from io import BytesIO

IMG_DIR = "/tmp/workspace/spinal-dysraphism-pptx/images/"

# ── Color palette (dark navy / teal / white) ─────────────────────
NAVY     = RGBColor(0x0A, 0x29, 0x4E)   # dark navy background
TEAL     = RGBColor(0x00, 0x7B, 0x8A)   # accent
GOLD     = RGBColor(0xE8, 0xA8, 0x00)   # second accent
WHITE    = RGBColor(0xFF, 0xFF, 0xFF)
LT_GREY  = RGBColor(0xE8, 0xF0, 0xF5)
DK_GREY  = RGBColor(0x22, 0x22, 0x22)

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

# ── Helpers ───────────────────────────────────────────────────────

def add_rect(slide, x, y, w, h, fill_rgb=None, alpha=None):
    shape = slide.shapes.add_shape(1, x, y, w, h)
    shape.line.fill.background()
    if fill_rgb:
        shape.fill.solid()
        shape.fill.fore_color.rgb = fill_rgb
    else:
        shape.fill.background()
    return shape

def add_textbox(slide, x, y, w, h, text, size=18, bold=False,
                color=WHITE, align=PP_ALIGN.LEFT, wrap=True,
                italic=False, anchor=MSO_ANCHOR.TOP):
    tb = slide.shapes.add_textbox(x, y, w, h)
    tf = tb.text_frame
    tf.word_wrap = wrap
    tf.vertical_anchor = anchor
    tf.margin_left = Pt(2)
    tf.margin_right = Pt(2)
    tf.margin_top = Pt(2)
    tf.margin_bottom = Pt(2)
    p = tf.paragraphs[0]
    p.alignment = align
    run = p.add_run()
    run.text = text
    run.font.size = Pt(size)
    run.font.bold = bold
    run.font.italic = italic
    run.font.color.rgb = color
    run.font.name = "Calibri"
    return tb

def add_multiline_textbox(slide, x, y, w, h, lines, base_size=13,
                          color=WHITE, bold_first=False):
    """lines = list of (text, bold, size_override or None)"""
    tb = slide.shapes.add_textbox(x, y, w, h)
    tf = tb.text_frame
    tf.word_wrap = True
    tf.margin_left = Pt(4)
    tf.margin_right = Pt(4)
    tf.margin_top = Pt(3)
    tf.margin_bottom = Pt(3)
    first = True
    for (text, bold, sz) in lines:
        if first:
            p = tf.paragraphs[0]
            first = False
        else:
            p = tf.add_paragraph()
        p.space_before = Pt(2)
        run = p.add_run()
        run.text = text
        run.font.size = Pt(sz if sz else base_size)
        run.font.bold = bold
        run.font.color.rgb = color
        run.font.name = "Calibri"
    return tb

def add_image(slide, path, x, y, w, h):
    if os.path.exists(path):
        slide.shapes.add_picture(path, x, y, w, h)
    else:
        print(f"WARNING: image not found: {path}")

def header_bar(slide, title_text, subtitle=None):
    """Dark navy bar at top with title."""
    add_rect(slide, 0, 0, W, Inches(1.1), fill_rgb=NAVY)
    add_textbox(slide, Inches(0.35), Inches(0.08), Inches(10), Inches(0.6),
                title_text, size=28, bold=True, color=WHITE)
    if subtitle:
        add_textbox(slide, Inches(0.35), Inches(0.68), Inches(10), Inches(0.38),
                    subtitle, size=14, bold=False, color=RGBColor(0xB0,0xD4,0xE8))
    # Source tag bottom-right of header
    add_textbox(slide, Inches(10.5), Inches(0.78), Inches(2.7), Inches(0.3),
                "Trapp et al. RadioGraphics 2021", size=8,
                color=RGBColor(0xB0,0xD4,0xE8), align=PP_ALIGN.RIGHT)

def footer(slide):
    add_rect(slide, 0, Inches(7.18), W, Inches(0.32), fill_rgb=TEAL)
    add_textbox(slide, Inches(0.2), Inches(7.19), Inches(13), Inches(0.28),
                "Spinal Dysraphisms  |  Radiology Case Series  |  Source: RadioGraphics 2021;41:559-575",
                size=8, color=WHITE, align=PP_ALIGN.CENTER)

def bullet_lines(slide, x, y, w, h, header, bullets, header_color=GOLD,
                 bullet_color=DK_GREY, header_size=14, bullet_size=12):
    tb = slide.shapes.add_textbox(x, y, w, h)
    tf = tb.text_frame
    tf.word_wrap = True
    tf.margin_left = Pt(6)
    tf.margin_right = Pt(4)
    tf.margin_top = Pt(4)
    tf.margin_bottom = Pt(2)
    p = tf.paragraphs[0]
    r = p.add_run()
    r.text = header
    r.font.bold = True
    r.font.size = Pt(header_size)
    r.font.color.rgb = header_color
    r.font.name = "Calibri"
    for b in bullets:
        p2 = tf.add_paragraph()
        p2.space_before = Pt(3)
        r2 = p2.add_run()
        r2.text = "▸  " + b
        r2.font.size = Pt(bullet_size)
        r2.font.color.rgb = bullet_color
        r2.font.name = "Calibri"
    return tb

# ─────────────────────────────────────────────────────────────────
# SLIDE 1 — Title slide
# ─────────────────────────────────────────────────────────────────
s1 = prs.slides.add_slide(blank)
add_rect(s1, 0, 0, W, H, fill_rgb=NAVY)

# Teal accent stripe
add_rect(s1, 0, Inches(2.5), W, Inches(0.06), fill_rgb=TEAL)
add_rect(s1, 0, Inches(5.4), W, Inches(0.06), fill_rgb=TEAL)

# Central content
add_textbox(s1, Inches(1), Inches(0.5), Inches(11.3), Inches(0.6),
            "RADIOLOGY CASE SERIES", size=16, bold=True,
            color=TEAL, align=PP_ALIGN.CENTER)

add_textbox(s1, Inches(0.8), Inches(1.1), Inches(11.7), Inches(1.3),
            "SPINAL DYSRAPHISMS", size=44, bold=True,
            color=WHITE, align=PP_ALIGN.CENTER)

add_textbox(s1, Inches(0.8), Inches(2.6), Inches(11.7), Inches(0.55),
            "A Practical Imaging Approach", size=22,
            color=RGBColor(0xB0,0xD4,0xE8), align=PP_ALIGN.CENTER)

# Three topic boxes
box_y = Inches(3.3)
box_h = Inches(1.0)
topics = [
    ("OCCULT\nDYSRAPHISM", Inches(1.2)),
    ("LIPOMYELOCELE\n& LIPOMYELOMENINGOCELE", Inches(4.8)),
    ("MYELOMENING-\nOCELE", Inches(8.9)),
]
for (label, bx) in topics:
    add_rect(s1, bx, box_y, Inches(3.2), box_h, fill_rgb=TEAL)
    add_textbox(s1, bx+Inches(0.1), box_y+Inches(0.1),
                Inches(3.0), box_h-Inches(0.2),
                label, size=15, bold=True, color=WHITE,
                align=PP_ALIGN.CENTER, anchor=MSO_ANCHOR.MIDDLE)

add_textbox(s1, Inches(1), Inches(4.55), Inches(11.3), Inches(0.45),
            "Classification  ·  Embryology  ·  MRI Findings  ·  Key Distinguishing Features",
            size=13, color=RGBColor(0xB0,0xD4,0xE8), align=PP_ALIGN.CENTER)

# source box
src_box = add_rect(s1, Inches(3.5), Inches(5.5), Inches(6.33), Inches(0.7),
                   fill_rgb=RGBColor(0x05, 0x1A, 0x33))
add_textbox(s1, Inches(3.6), Inches(5.55), Inches(6.1), Inches(0.6),
            "Source: Trapp B et al.  RadioGraphics 2021;41:559-575  |  DOI: 10.1148/rg.2021200103",
            size=10, color=RGBColor(0xB0,0xD4,0xE8), align=PP_ALIGN.CENTER)

add_textbox(s1, Inches(0.5), Inches(6.5), Inches(12.3), Inches(0.5),
            "Radiology Residency  |  Neuroradiology Teaching File  |  2024",
            size=12, color=RGBColor(0x66,0x99,0xBB), align=PP_ALIGN.CENTER)

# ─────────────────────────────────────────────────────────────────
# SLIDE 2 — Classification & Embryology
# ─────────────────────────────────────────────────────────────────
s2 = prs.slides.add_slide(blank)
add_rect(s2, 0, 0, W, H, fill_rgb=LT_GREY)
header_bar(s2, "Classification of Spinal Dysraphisms",
           "Clinical-Radiologic & Embryologic Framework")
footer(s2)

# Classification tree image (page5_img0 = Fig 4 classification diagram)
add_image(s2, IMG_DIR+"page5_img0.png",
          Inches(0.35), Inches(1.2), Inches(6.2), Inches(2.2))

# Embryology image (page4_img1 = primary neurulation Fig 2)
add_image(s2, IMG_DIR+"page4_img1.png",
          Inches(0.35), Inches(3.5), Inches(6.2), Inches(3.3))

# Right panel text
add_rect(s2, Inches(6.7), Inches(1.2), Inches(6.3), Inches(5.9),
         fill_rgb=NAVY)

bullet_lines(s2, Inches(6.85), Inches(1.3), Inches(6.0), Inches(2.7),
             "Clinical-Radiologic Classification",
             ["OPEN SDs: neural placode exposed to environment (skin defect present)",
              "CLOSED SDs: covered by skin/subcutaneous tissue; no placode exposure",
              "Closed further divided: with or without subcutaneous mass"],
             header_color=GOLD, bullet_color=WHITE, header_size=15, bullet_size=12)

bullet_lines(s2, Inches(6.85), Inches(3.6), Inches(6.0), Inches(3.3),
             "Embryologic Stages → Resultant SDs",
             ["Gastrulation (wk 2-3): Diastematomyelia, Caudal Regression Syndrome",
              "Primary neurulation (wk 3-4): MMC, Myelocele, Lipomyelocele, LDD, Dermal sinus",
              "Secondary neurulation (wk 4-6): Terminal myelocystocele, Tight filum, Filum lipoma"],
             header_color=GOLD, bullet_color=WHITE, header_size=15, bullet_size=12)

add_textbox(s2, Inches(0.35), Inches(1.15), Inches(6.2), Inches(0.3),
            "Fig 4 - Classification diagram & Fig 2 - Primary neurulation",
            size=8, color=RGBColor(0x44,0x44,0x44))

# ─────────────────────────────────────────────────────────────────
# SLIDE 3 — Myelomeningocele
# ─────────────────────────────────────────────────────────────────
s3 = prs.slides.add_slide(blank)
add_rect(s3, 0, 0, W, H, fill_rgb=LT_GREY)
header_bar(s3, "Myelomeningocele (MMC)",
           "Most Common Open Spinal Dysraphism (>98% of Open SDs)")
footer(s3)

# MMC fetal MRI image (page7_img0 = Fig 5)
add_image(s3, IMG_DIR+"page7_img0.png",
          Inches(0.35), Inches(1.2), Inches(7.1), Inches(3.5))

add_textbox(s3, Inches(0.35), Inches(4.75), Inches(7.1), Inches(0.25),
            "Fig 5 - Fetal MRI: MMC with Chiari II malformation (sagittal + axial T2 + schematic drawing)",
            size=8, color=RGBColor(0x44,0x44,0x44))

# Right panel
add_rect(s3, Inches(7.65), Inches(1.2), Inches(5.4), Inches(5.9),
         fill_rgb=NAVY)

bullet_lines(s3, Inches(7.8), Inches(1.3), Inches(5.1), Inches(2.2),
             "Definition & Epidemiology",
             ["Placode exposed to environment + elevated above skin by CSF expansion",
              "Prevalence: 0.6-1.0 per 1000 live births; females slightly > males",
              "80-98% involve lower lumbar / upper sacral spine"],
             header_color=GOLD, bullet_color=WHITE, header_size=14, bullet_size=11)

bullet_lines(s3, Inches(7.8), Inches(3.3), Inches(5.1), Inches(1.8),
             "Imaging (Fetal MRI — modality of choice)",
             ["Discontinuity of skin/subcutaneous tissue at lumbosacral level",
              "Neural placode exposed + elevated above skin surface",
              "Subarachnoid space expansion (meningocele component)"],
             header_color=GOLD, bullet_color=WHITE, header_size=14, bullet_size=11)

bullet_lines(s3, Inches(7.8), Inches(4.9), Inches(5.1), Inches(1.3),
             "Associated: Chiari II Malformation",
             ["Small posterior fossa, slit-like 4th ventricle",
              "Herniation of cerebellar tonsils/vermis through foramen magnum",
              "Tectal beaking, callosal dysgenesis, supratentorial hydrocephalus"],
             header_color=GOLD, bullet_color=WHITE, header_size=14, bullet_size=11)

# ─────────────────────────────────────────────────────────────────
# SLIDE 4 — Myelocele & Hemimyelomeningocele
# ─────────────────────────────────────────────────────────────────
s4 = prs.slides.add_slide(blank)
add_rect(s4, 0, 0, W, H, fill_rgb=LT_GREY)
header_bar(s4, "Myelocele / Myeloschisis  &  Hemimyelomeningocele",
           "Open Spinal Dysraphisms — Rare Variants")
footer(s4)

# Myelocele image page8_img0 = Fig 6
add_image(s4, IMG_DIR+"page8_img0.png",
          Inches(0.35), Inches(1.2), Inches(6.7), Inches(3.5))
add_textbox(s4, Inches(0.35), Inches(4.75), Inches(6.7), Inches(0.25),
            "Fig 6 - Fetal MRI: Myelocele with Chiari II — placode flush with skin, no CSF expansion",
            size=8, color=RGBColor(0x44,0x44,0x44))

# Hemimyelomeningocele drawing page8_img1 = Fig 7
add_image(s4, IMG_DIR+"page8_img1.png",
          Inches(7.1), Inches(1.2), Inches(2.5), Inches(3.5))
add_textbox(s4, Inches(7.1), Inches(4.75), Inches(2.5), Inches(0.25),
            "Fig 7 - Hemimyelomeningocele schematic",
            size=8, color=RGBColor(0x44,0x44,0x44))

# Right text panel
add_rect(s4, Inches(9.8), Inches(1.2), Inches(3.2), Inches(5.9),
         fill_rgb=NAVY)

bullet_lines(s4, Inches(9.9), Inches(1.3), Inches(3.0), Inches(2.2),
             "Myelocele / Myeloschisis",
             ["Placode FLAT or DEPRESSED below skin",
              "No expansion of subarachnoid space (cf. MMC)",
              "Placode is posterior wall of spina bifida"],
             header_color=GOLD, bullet_color=WHITE, header_size=13, bullet_size=11)

bullet_lines(s4, Inches(9.9), Inches(3.45), Inches(3.0), Inches(3.0),
             "Hemimyelo(meningo)cele",
             ["Extremely rare; diastematomyelia + unilateral open SD",
              "One hemicord fails to neurulate",
              "MRI: split cord at level of spina bifida",
              "Neurologic deficits markedly asymmetric"],
             header_color=GOLD, bullet_color=WHITE, header_size=13, bullet_size=11)

# ─────────────────────────────────────────────────────────────────
# SLIDE 5 — Lipomyelocele & Lipomyelomeningocele (Closed SDs WITH mass)
# ─────────────────────────────────────────────────────────────────
s5 = prs.slides.add_slide(blank)
add_rect(s5, 0, 0, W, H, fill_rgb=LT_GREY)
header_bar(s5, "Lipomyelocele  &  Lipomyelomeningocele",
           "Closed SDs with Subcutaneous Mass — Lipomas with Dural Defect (LDD)")
footer(s5)

# LDD images
# page10_img0 = Fig 8 (lipomyelomeningocele)
add_image(s5, IMG_DIR+"page10_img0.png",
          Inches(0.35), Inches(1.2), Inches(6.2), Inches(2.5))
add_textbox(s5, Inches(0.35), Inches(3.75), Inches(6.2), Inches(0.25),
            "Fig 8 - Lipomyelomeningocele: cord-lipoma interface OUTSIDE spinal canal (T1/T2 axial + drawing)",
            size=8, color=RGBColor(0x44,0x44,0x44))

# page10_img1 = Fig 9 (lipomyelocele)
add_image(s5, IMG_DIR+"page10_img1.png",
          Inches(0.35), Inches(4.1), Inches(6.2), Inches(2.75))
add_textbox(s5, Inches(0.35), Inches(6.85), Inches(6.2), Inches(0.25),
            "Fig 9 - Lipomyelocele: cord-lipoma interface at LEVEL OF NEURAL ARCHES, no CSF expansion",
            size=8, color=RGBColor(0x44,0x44,0x44))

# Right panel
add_rect(s5, Inches(6.7), Inches(1.2), Inches(6.3), Inches(5.9),
         fill_rgb=NAVY)

bullet_lines(s5, Inches(6.85), Inches(1.3), Inches(6.0), Inches(2.2),
             "Pathogenesis (Common to all LDDs)",
             ["Early premature disjunction of cutaneous & neuroectoderm",
              "Mesenchymal tissue enters neural tube → lipomatous mass",
              "Prevents successful neurulation; fat grows with body adiposity"],
             header_color=GOLD, bullet_color=WHITE, header_size=14, bullet_size=11)

bullet_lines(s5, Inches(6.85), Inches(3.3), Inches(6.0), Inches(1.6),
             "Lipomyelomeningocele (KEY FEATURE)",
             ["Cord-lipoma interface OUTSIDE vertebral canal (off midline)",
              "Expansion of subarachnoid space herniates through spina bifida",
              "Placode anchored to subcutaneous lipoma asymmetrically"],
             header_color=GOLD, bullet_color=WHITE, header_size=14, bullet_size=11)

bullet_lines(s5, Inches(6.85), Inches(4.7), Inches(6.0), Inches(1.6),
             "Lipomyelocele (KEY FEATURE)",
             ["Cord-lipoma interface AT LEVEL OF NEURAL ARCHES",
              "No expansion of subarachnoid space (no meningocele component)",
              "Lipoma insinuates canal; communicates with subcutaneous fat posteriorly"],
             header_color=GOLD, bullet_color=WHITE, header_size=14, bullet_size=11)

add_textbox(s5, Inches(6.85), Inches(6.05), Inches(6.0), Inches(0.7),
            "⚡ KEY DIFFERENTIATOR: Position of cord-lipoma interface\n"
            "  Lipomyelocele = at neural arches  |  Lipomyelomeningocele = outside canal",
            size=11, bold=True, color=GOLD)

# ─────────────────────────────────────────────────────────────────
# SLIDE 6 — Occult Dysraphisms: Dermal Sinus Tract & Limited Dorsal Myeloschisis
# ─────────────────────────────────────────────────────────────────
s6 = prs.slides.add_slide(blank)
add_rect(s6, 0, 0, W, H, fill_rgb=LT_GREY)
header_bar(s6, "Occult Dysraphisms: Dermal Sinus Tract (DST)  &  Limited Dorsal Myeloschisis (LDM)",
           "Closed SDs without Subcutaneous Mass")
footer(s6)

# Use page14_img0 = Fig 12 Diastematomyelia T1 — repurpose to show type I
# Use page14_img1 = Fig 13 Type II diastematomyelia
# For this slide, show page11_img0 = Fig 11 myelocystocele (for visual interest)
# and page12_img0 = Fig 12 meningocele
# Actually best images for this topic are not in available extractions
# Let's use page14_img0 = type I diastematomyelia and page14_img1 = type II for Slide 7
# For slide 6 let's use page11_img0 (myelocystocele) and page12_img0 (meningocele drawing)

# Use page12_img0 (meningocele / Fig 10) on left for occult/closed
add_image(s6, IMG_DIR+"page12_img0.png",
          Inches(0.35), Inches(1.2), Inches(3.0), Inches(5.5))
add_textbox(s6, Inches(0.35), Inches(6.75), Inches(3.0), Inches(0.25),
            "Fig 10 - Meningocele: CSF-filled sac, normal spinal cord",
            size=8, color=RGBColor(0x44,0x44,0x44))

# Right 2/3 of slide
add_rect(s6, Inches(3.5), Inches(1.2), Inches(9.5), Inches(5.9),
         fill_rgb=NAVY)

bullet_lines(s6, Inches(3.65), Inches(1.3), Inches(9.2), Inches(2.5),
             "Dermal Sinus Tract (DST)",
             ["Focal failure of disjunction of neuroectoderm from ectoderm (primary neurulation)",
              "1:2500 live births; lumbosacral most common (last site of neural fold fusion)",
              "Connects skin ostium to any level of subpial space — infection risk (meningitis/abscess)",
              "MRI: thin tract from skin dimple tracking to cord; include DWI for dermoid/epidermoid",
              "Cutaneous stigma: midline dimple/ostium, hairy nevus, capillary angioma at S2 level"],
             header_color=GOLD, bullet_color=WHITE, header_size=14, bullet_size=11)

bullet_lines(s6, Inches(3.65), Inches(3.85), Inches(9.2), Inches(2.0),
             "Limited Dorsal Myeloschisis (LDM)",
             ["Incomplete disjunction of neural & cutaneous ectoderm",
              "Fibroneural stalk connects dorsal cord to skin — tethers cord",
              "Saccular vs. non-saccular forms; lumbar spine most common",
              "MRI: stalk from dorsal cord to skin; characteristic trapezoid cord in axial plane",
              "Non-saccular: subtle skin lesion; saccular: outpouching resembles meningocele"],
             header_color=GOLD, bullet_color=WHITE, header_size=14, bullet_size=11)

bullet_lines(s6, Inches(3.65), Inches(5.75), Inches(9.2), Inches(1.25),
             "Meningocele (Closed SD with mass)",
             ["CSF-filled sac only — NO neural tissue inside",
              "Spinal cord structurally NORMAL; usually mild neurologic symptoms",
              "MRI: extraspinal CSF sac through posterior spina bifida"],
             header_color=GOLD, bullet_color=WHITE, header_size=14, bullet_size=11)

# ─────────────────────────────────────────────────────────────────
# SLIDE 7 — Diastematomyelia & Caudal Regression Syndrome
# ─────────────────────────────────────────────────────────────────
s7 = prs.slides.add_slide(blank)
add_rect(s7, 0, 0, W, H, fill_rgb=LT_GREY)
header_bar(s7, "Complex Dysraphic States: Diastematomyelia  &  Caudal Regression Syndrome",
           "Closed SDs without Subcutaneous Mass — Gastrulation-Stage Errors")
footer(s7)

# page14_img0 = Type I diastematomyelia (Fig 12)
add_image(s7, IMG_DIR+"page14_img0.png",
          Inches(0.35), Inches(1.2), Inches(6.2), Inches(2.8))
add_textbox(s7, Inches(0.35), Inches(4.05), Inches(6.2), Inches(0.28),
            "Fig 12 - Type I Diastematomyelia: two hemicords, separate dural sacs + bony spur (arrowhead)",
            size=8, color=RGBColor(0x44,0x44,0x44))

# page14_img1 = Type II diastematomyelia (Fig 13)
add_image(s7, IMG_DIR+"page14_img1.png",
          Inches(0.35), Inches(4.45), Inches(6.2), Inches(2.4))
add_textbox(s7, Inches(0.35), Inches(6.9), Inches(6.2), Inches(0.25),
            "Fig 13 - Type II Diastematomyelia: both hemicords in single dural sac, no bony spur",
            size=8, color=RGBColor(0x44,0x44,0x44))

# CRS image page15_img0 = Fig 14
add_rect(s7, Inches(6.7), Inches(1.2), Inches(6.3), Inches(5.9),
         fill_rgb=NAVY)

bullet_lines(s7, Inches(6.85), Inches(1.3), Inches(6.0), Inches(2.5),
             "Diastematomyelia (Split Cord Malformation)",
             ["Failure of midline notochordal integration during gastrulation",
              "Type I: TWO dural sacs + osteocartilaginous/bony spur (tethers cord)",
              "Type II: SINGLE dural sac, fibrous septum or no spur",
              "MRI: lumbar most common; associated syringomyelia, tethered cord",
              "Orthopedic: foot deformity, scoliosis, neurogenic bladder"],
             header_color=GOLD, bullet_color=WHITE, header_size=14, bullet_size=11)

bullet_lines(s7, Inches(6.85), Inches(3.95), Inches(6.0), Inches(3.0),
             "Caudal Regression Syndrome (CRS)",
             ["Abnormal tail bud development at gastrulation-secondary neurulation interface (<wk 4)",
              "1.3 per 10,000 births; 170-400x higher risk in pregestational DM mothers",
              "Type I: hypoplastic/absent sacrum; abrupt conus at T12 (wedge-shaped)",
              "MRI: sacrococcygeal agenesis, high conus, 'double bundle' nerve root sign",
              "Type II: partial sacral agenesis, low tethered cord (better prognosis)",
              "Associations: VACTERL, Currarino triad, anorectal/GU/cardiac anomalies"],
             header_color=GOLD, bullet_color=WHITE, header_size=14, bullet_size=11)

# ─────────────────────────────────────────────────────────────────
# SLIDE 8 — Summary / Differential Approach
# ─────────────────────────────────────────────────────────────────
s8 = prs.slides.add_slide(blank)
add_rect(s8, 0, 0, W, H, fill_rgb=NAVY)
header_bar(s8, "Summary: Practical MRI Approach to Spinal Dysraphisms",
           "Step-by-step differential diagnosis framework")
footer(s8)

# 2 column summary table
# Left column boxes
left_boxes = [
    ("STEP 1: Is there a SKIN DEFECT?",
     ["YES → OPEN SD (Myelomeningocele, Myelocele, Hemimyelo...)",
      "NO  → CLOSED SD (proceed to step 2)"]),
    ("STEP 2 (Closed): Is there a SUBCUTANEOUS MASS?",
     ["YES → LDD spectrum (Lipomyelocele, Lipomyelomeningocele) or Meningocele / Myelocystocele",
      "NO  → Simple or Complex dysraphic states"]),
    ("STEP 3: Locate the CORD-LIPOMA INTERFACE (LDD)",
     ["At neural arches = Lipomyelocele",
      "Outside canal = Lipomyelomeningocele",
      "Intradural only = Intradural lipoma"]),
]

right_boxes = [
    ("KEY IMAGING SEQUENCES FOR SD",
     ["Sagittal T1 + T2: cord position, lipoma, conus level",
      "Axial T2: cord-lipoma interface, hemicords, spur",
      "Fetal MRI: SSFSE/HASTE; CISS/FIESTA for DST",
      "DWI: dermoid vs. epidermoid inclusion cysts",
      "T1 fat-sat: confirm fat signal in lipomatous lesions"]),
    ("CHIARI II — Always look for in Open SDs",
     ["Small posterior fossa, slit 4th ventricle",
      "Hindbrain herniation through foramen magnum",
      "Supratentorial hydrocephalus, tectal beaking"]),
    ("TETHERED CORD — Common Association",
     ["Low conus (<L2-3 in neonates, <L1-2 in adults)",
      "Thickened filum terminale (>2mm) → tight filum",
      "Fatty filum (≤2mm) = FFT — usually not clinically relevant"]),
]

box_h_each = Inches(1.7)
for i, (title, bullets) in enumerate(left_boxes):
    by = Inches(1.2) + i * (box_h_each + Inches(0.08))
    add_rect(s8, Inches(0.3), by, Inches(6.2), box_h_each,
             fill_rgb=RGBColor(0x05, 0x1A, 0x33))
    add_rect(s8, Inches(0.3), by, Inches(0.08), box_h_each, fill_rgb=TEAL)
    bullet_lines(s8, Inches(0.5), by+Inches(0.05), Inches(6.0), box_h_each-Inches(0.1),
                 title, bullets,
                 header_color=TEAL, bullet_color=RGBColor(0xCC,0xEE,0xFF),
                 header_size=13, bullet_size=11)

for i, (title, bullets) in enumerate(right_boxes):
    by = Inches(1.2) + i * (box_h_each + Inches(0.08))
    add_rect(s8, Inches(6.85), by, Inches(6.2), box_h_each,
             fill_rgb=RGBColor(0x05, 0x1A, 0x33))
    add_rect(s8, Inches(6.85), by, Inches(0.08), box_h_each, fill_rgb=GOLD)
    bullet_lines(s8, Inches(7.05), by+Inches(0.05), Inches(6.0), box_h_each-Inches(0.1),
                 title, bullets,
                 header_color=GOLD, bullet_color=RGBColor(0xCC,0xEE,0xFF),
                 header_size=13, bullet_size=11)

# Bottom citation
add_textbox(s8, Inches(0.3), Inches(6.85), Inches(12.7), Inches(0.28),
            "Reference: Trapp B et al. A Practical Approach to Diagnosis of Spinal Dysraphism. "
            "RadioGraphics 2021;41(2):559-575. https://doi.org/10.1148/rg.2021200103",
            size=9, color=RGBColor(0x88,0xBB,0xDD), align=PP_ALIGN.CENTER)


# ── Save ──────────────────────────────────────────────────────────
out_path = "/tmp/workspace/spinal-dysraphism-pptx/Spinal_Dysraphisms_Case_Series.pptx"
buf = BytesIO()
prs.save(buf)
with open(out_path, "wb") as f:
    f.write(buf.getvalue())

print(f"DONE — saved to {out_path}")
print(f"Slides: {len(prs.slides)}")
Running Command

cd /tmp/workspace/spinal-dysraphism-pptx && python3 build_pptx.py

Running Command

ls -lh /tmp/workspace/spinal-dysraphism-pptx/Spinal_Dysraphisms_Case_Series.pptx && python3 -c " from pptx import Presentation prs = Presentation('/tmp/workspace/spinal-dysraphism-pptx/Spinal_Dysraphisms_Case_Series.pptx') print(f'Total slides: {len(prs.slides)}') for i, slide in enumerate(prs.slides, 1): shapes = len(slide.shapes) print(f' Slide {i}: {shapes} shapes') "

Your 8-slide presentation is ready:

Spinal Dysraphisms Case Series

Presentation · PPTX


Here is what each slide covers, directly drawn from the Trapp et al. RadioGraphics 2021 article:

Slide 1 - Title slide "Spinal Dysraphisms: A Practical Imaging Approach" with three highlighted topic boxes (Occult Dysraphism, Lipomyelocele/Lipomyelomeningocele, Myelomeningocele), source citation, and your case series header.
Slide 2 - Classification & Embryology The clinical-radiologic classification tree (Fig 4 from the article) alongside the primary neurulation diagram (Fig 2), with the three embryologic stages and their resultant SDs summarized on the right.
Slide 3 - Myelomeningocele Fetal MRI images (Fig 5 - sagittal + axial SSFSE T2 + schematic drawing) showing the exposed placode, skin discontinuity, and Chiari II features. Key facts: prevalence, lumbosacral predominance, and the Chiari II association checklist.
Slide 4 - Myelocele / Myeloschisis & Hemimyelomeningocele Fig 6 (fetal MRI of myelocele - placode flat/flush with skin, no CSF expansion) and Fig 7 (hemimyelomeningocele schematic). Side-by-side comparison of these rare open SD variants with the key differentiating feature (presence/absence of meningocele component).
Slide 5 - Lipomyelocele & Lipomyelomeningocele Both Fig 8 (lipomyelomeningocele - cord-lipoma interface outside canal) and Fig 9 (lipomyelocele - interface at neural arches) displayed together. The KEY DIFFERENTIATOR is highlighted: position of the cord-lipoma interface.
Slide 6 - Occult Dysraphisms: DST & LDM Dermal Sinus Tract (DST) and Limited Dorsal Myeloschisis (LDM) with Fig 10 (meningocele) as a visual anchor. Covers skin ostium, infection risk, MRI protocol (include DWI for dermoid/epidermoid), and the fibroneural stalk of LDM.
Slide 7 - Diastematomyelia & Caudal Regression Syndrome Fig 12 (Type I - two dural sacs + bony spur) and Fig 13 (Type II - single dural sac, no spur) side by side. CRS section covers maternal DM association, Type I/II distinction, the wedge-shaped conus, and VACTERL associations.
Slide 8 - Summary / Practical MRI Approach A 3-step diagnostic algorithm (skin defect? → subcutaneous mass? → cord-lipoma interface position?), plus key MRI sequences, Chiari II checklist, and tethered cord criteria - all in a two-column dark-theme format.

Design: Dark navy + teal + gold color scheme, 16:9 widescreen format, with actual extracted figures from the RSNA article embedded throughout. Footer cites the source on every slide.
This is a shared conversation. Sign in to Orris to start your own chat.