What is headache? create ppt on it

Reading File
Reading File
Finding Sources
Reading File
Reading File
Reading File
Reading File
Finding Sources
Reading File
Finding Sources
Reading File
Reading File
Reading File
Searching Images

headache types migraine tension cluster diagram

This composite educational graphic consists of a side-by-side comparison between a clinical bar chart and neuroimaging statistical maps. On the left, a grouped bar graph illustrates the distribution of headache types—Tension-Type Headache (TTH), Migraine (MiG), and No Headache (None)—in cancer patients categorized by their pathological complete response (pCR) to neoadjuvant chemotherapy (NAC). The pCR group shows a predominance of Migraine (57%), while the non-pCR group shows a higher prevalence of TTH (48%). On the right, a statistical map overlay on a T1-weighted MRI template displays regions of altered brain metabolism in sagittal, coronal, and axial views. Yellow-red clusters indicate a positive test statistic (intensity scale 0 to 4) localized predominantly in the bilateral anterior medial frontal cortex. The visual highlights a specific neuro-oncological correlation between chemotherapy response clinical outcomes and functional brain imaging biomarkers, specifically targeting metabolic variations in patients suffering from different primary headache disorders.

This composite educational graphic consists of a side-by-side comparison between a clinical bar chart and neuroimaging statistical maps. On the left, a grouped bar graph illustrates the distribution of headache types—Tension-Type Headache (TTH), Migraine (MiG), and No Headache (None)—in cancer patients categorized by their pathological complete response (pCR) to neoadjuvant chemotherapy (NAC). The pCR group shows a predominance of Migraine (57%), while the non-pCR group shows a higher prevalence of TTH (48%). On the right, a statistical map overlay on a T1-weighted MRI template displays regions of altered brain metabolism in sagittal, coronal, and axial views. Yellow-red clusters indicate a positive test statistic (intensity scale 0 to 4) localized predominantly in the bilateral anterior medial frontal cortex. The visual highlights a specific neuro-oncological correlation between chemotherapy response clinical outcomes and functional brain imaging biomarkers, specifically targeting metabolic variations in patients suffering from different primary headache disorders.

An anatomical diagram illustrating two schematic views of the human brain—a medial sagittal section (left) and a coronal section (right)—mapping the neuroanatomical targets for headache treatments. The illustration utilizes a color-coded system to link specific brain regions to their clinical relevance in migraine, cluster headache, and medication overuse headache management. Key areas identified in the sagittal view include the prefrontal cortex, somatosensory cortex, cuneus/precuneus, occipital cortex, hypothalamus, periaqueductal gray (PAG), spinal trigeminal nucleus, and cerebellum. The coronal view highlights the cingulate gyrus, thalamus, insula, temporal cortex, hippocampus, and amygdala. Each region is associated with specific therapeutic modalities mentioned in clinical literature, such as NSAIDs, monoclonal antibodies (Erenumab, Galcanezumab), onabotulinum toxin A, neuromodulation, and deep brain stimulation. This infographic serves as a pedagogical summary of the central nervous system structures involved in headache pathophysiology and the spatial distribution of pharmacological and interventional treatment targets.

An anatomical diagram illustrating two schematic views of the human brain—a medial sagittal section (left) and a coronal section (right)—mapping the neuroanatomical targets for headache treatments. The illustration utilizes a color-coded system to link specific brain regions to their clinical relevance in migraine, cluster headache, and medication overuse headache management. Key areas identified in the sagittal view include the prefrontal cortex, somatosensory cortex, cuneus/precuneus, occipital cortex, hypothalamus, periaqueductal gray (PAG), spinal trigeminal nucleus, and cerebellum. The coronal view highlights the cingulate gyrus, thalamus, insula, temporal cortex, hippocampus, and amygdala. Each region is associated with specific therapeutic modalities mentioned in clinical literature, such as NSAIDs, monoclonal antibodies (Erenumab, Galcanezumab), onabotulinum toxin A, neuromodulation, and deep brain stimulation. This infographic serves as a pedagogical summary of the central nervous system structures involved in headache pathophysiology and the spatial distribution of pharmacological and interventional treatment targets.

VA/DoD Clinical Practice Guideline for Management of Headache
<table><thead><tr><th>#</th><th>Recommendation</th><th>2020 Strength of Recommendation</th><th>Evidence</th><th>2023 Strength of Recommendation</th><th>2023 Recommendation Category</th></tr></thead><tbody><tr><td>50.</td><td>There is insufficient evidence to recommend for or against any specific medication over another for the acute treatment of migraine.</td><td>NA</td><td>(273, 362-366)</td><td>Neither for nor against</td><td>Reviewed, New-added</td></tr><tr><td>51.</td><td>There is insufficient evidence to recommend for or against any specific medication over another for the prevention of migraine headache, tension headache, or cluster headache.</td><td>NA</td><td>(114, 140, 165, 245, 368-374)</td><td>Neither for nor against</td><td>Reviewed, New-added</td></tr><tr><td>52.</td><td>There is insufficient evidence to recommend for or against any specific combination of therapies for the prevention of headache.</td><td>Neither for nor against</td><td>(271, 375-382)</td><td>Neither for nor against</td><td>Reviewed, New-replaced</td></tr></tbody></table>

VA/DoD Clinical Practice Guideline for Management of Headache <table><thead><tr><th>#</th><th>Recommendation</th><th>2020 Strength of Recommendation</th><th>Evidence</th><th>2023 Strength of Recommendation</th><th>2023 Recommendation Category</th></tr></thead><tbody><tr><td>50.</td><td>There is insufficient evidence to recommend for or against any specific medication over another for the acute treatment of migraine.</td><td>NA</td><td>(273, 362-366)</td><td>Neither for nor against</td><td>Reviewed, New-added</td></tr><tr><td>51.</td><td>There is insufficient evidence to recommend for or against any specific medication over another for the prevention of migraine headache, tension headache, or cluster headache.</td><td>NA</td><td>(114, 140, 165, 245, 368-374)</td><td>Neither for nor against</td><td>Reviewed, New-added</td></tr><tr><td>52.</td><td>There is insufficient evidence to recommend for or against any specific combination of therapies for the prevention of headache.</td><td>Neither for nor against</td><td>(271, 375-382)</td><td>Neither for nor against</td><td>Reviewed, New-replaced</td></tr></tbody></table>

This diagnostic image displays voxel-based morphometry (VBM) results from a post-hoc 2x2 ANCOVA analysis comparing gray matter (GM) volume in patients with tension-type headache (TTH) and migraine (MIG). The visualization includes lateral cortical surface maps and sequential axial slices of the brain, divided into 'Episodic' and 'Chronic' rows. In the Episodic comparison, TTH shows significantly higher GM volume (indicated by red-yellow heat maps) in the bilateral putamen, right caudate, right middle frontal gyrus, and right cerebellum, while lower GM volume (indicated by blue-cyan) is visible in the right lateral occipital cortex compared to episodic migraine. In the Chronic comparison, significantly higher GM volume in TTH is localized only to the left cerebellum, with no significant regions of lower GM volume relative to chronic migraine. These findings illustrate neuroanatomical differences in pain processing and inhibitory regions between primary headache types, highlighting a reduction in structural divergence as the conditions transition from episodic to chronic forms.

This diagnostic image displays voxel-based morphometry (VBM) results from a post-hoc 2x2 ANCOVA analysis comparing gray matter (GM) volume in patients with tension-type headache (TTH) and migraine (MIG). The visualization includes lateral cortical surface maps and sequential axial slices of the brain, divided into 'Episodic' and 'Chronic' rows. In the Episodic comparison, TTH shows significantly higher GM volume (indicated by red-yellow heat maps) in the bilateral putamen, right caudate, right middle frontal gyrus, and right cerebellum, while lower GM volume (indicated by blue-cyan) is visible in the right lateral occipital cortex compared to episodic migraine. In the Chronic comparison, significantly higher GM volume in TTH is localized only to the left cerebellum, with no significant regions of lower GM volume relative to chronic migraine. These findings illustrate neuroanatomical differences in pain processing and inhibitory regions between primary headache types, highlighting a reduction in structural divergence as the conditions transition from episodic to chronic forms.

Running Command

mkdir -p /tmp/workspace/headache-ppt && ls /tmp/workspace/headache-ppt/

Writing File

~/headache-ppt/create_headache_ppt.py

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
from io import BytesIO

# ── Color palette ──────────────────────────────────────────────────────────────
DARK_BLUE   = RGBColor(0x1A, 0x37, 0x6C)   # deep navy
MED_BLUE    = RGBColor(0x2E, 0x6D, 0xB4)   # accent blue
LIGHT_BLUE  = RGBColor(0xD6, 0xE8, 0xF7)   # pale blue bg
TEAL        = RGBColor(0x00, 0x8B, 0x8B)   # teal accent
WHITE       = RGBColor(0xFF, 0xFF, 0xFF)
DARK_GRAY   = RGBColor(0x2C, 0x2C, 0x2C)
MED_GRAY    = RGBColor(0x55, 0x55, 0x55)
LIGHT_GRAY  = RGBColor(0xF4, 0xF4, 0xF4)
ORANGE      = RGBColor(0xE8, 0x60, 0x20)
RED         = RGBColor(0xCC, 0x00, 0x00)
GREEN       = RGBColor(0x1E, 0x7A, 0x3C)

prs = Presentation()
prs.slide_width  = Inches(13.333)
prs.slide_height = Inches(7.5)
blank = prs.slide_layouts[6]


# ── Helpers ────────────────────────────────────────────────────────────────────
def add_rect(slide, x, y, w, h, fill_color=None, line_color=None, line_width=0):
    shape = slide.shapes.add_shape(1, Inches(x), Inches(y), Inches(w), Inches(h))
    if fill_color:
        shape.fill.solid()
        shape.fill.fore_color.rgb = fill_color
    else:
        shape.fill.background()
    if line_color and line_width:
        shape.line.color.rgb = line_color
        shape.line.width = Pt(line_width)
    else:
        shape.line.fill.background()
    return shape

def add_text(slide, text, x, y, w, h, font_size=18, bold=False, italic=False,
             color=DARK_GRAY, align=PP_ALIGN.LEFT, v_anchor=MSO_ANCHOR.TOP,
             wrap=True, font_name="Calibri"):
    tb = slide.shapes.add_textbox(Inches(x), Inches(y), Inches(w), Inches(h))
    tf = tb.text_frame
    tf.word_wrap = wrap
    tf.vertical_anchor = v_anchor
    tf.margin_left = Pt(0)
    tf.margin_right = Pt(0)
    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.name = font_name
    run.font.size = Pt(font_size)
    run.font.bold = bold
    run.font.italic = italic
    run.font.color.rgb = color
    return tb

def add_bullet_box(slide, title, bullets, x, y, w, h,
                   title_bg=MED_BLUE, title_color=WHITE,
                   body_bg=LIGHT_GRAY, bullet_color=DARK_GRAY,
                   title_size=15, bullet_size=12):
    # title bar
    add_rect(slide, x, y, w, 0.42, fill_color=title_bg)
    add_text(slide, title, x+0.12, y+0.02, w-0.2, 0.38,
             font_size=title_size, bold=True, color=title_color,
             align=PP_ALIGN.LEFT, v_anchor=MSO_ANCHOR.MIDDLE)
    # body
    body_h = h - 0.42
    add_rect(slide, x, y+0.42, w, body_h, fill_color=body_bg)
    tb = slide.shapes.add_textbox(Inches(x+0.15), Inches(y+0.5), Inches(w-0.3), Inches(body_h-0.15))
    tf = tb.text_frame
    tf.word_wrap = True
    for i, b in enumerate(bullets):
        p = tf.paragraphs[0] if i == 0 else tf.add_paragraph()
        p.space_before = Pt(3)
        run = p.add_run()
        run.text = u"\u2022 " + b
        run.font.name = "Calibri"
        run.font.size = Pt(bullet_size)
        run.font.color.rgb = bullet_color

def add_header_bar(slide, title, subtitle=None):
    # top bar
    add_rect(slide, 0, 0, 13.333, 1.1, fill_color=DARK_BLUE)
    add_text(slide, title, 0.4, 0.08, 12.5, 0.6,
             font_size=28, bold=True, color=WHITE,
             align=PP_ALIGN.LEFT, v_anchor=MSO_ANCHOR.MIDDLE)
    if subtitle:
        add_text(slide, subtitle, 0.4, 0.65, 12.5, 0.38,
                 font_size=14, italic=True, color=LIGHT_BLUE,
                 align=PP_ALIGN.LEFT, v_anchor=MSO_ANCHOR.MIDDLE)
    # bottom accent line
    add_rect(slide, 0, 1.1, 13.333, 0.06, fill_color=TEAL)
    # background
    add_rect(slide, 0, 1.16, 13.333, 6.34, fill_color=WHITE)

# ══════════════════════════════════════════════════════════════════════════════
# SLIDE 1 — Title
# ══════════════════════════════════════════════════════════════════════════════
s1 = prs.slides.add_slide(blank)
# gradient-style background
add_rect(s1, 0, 0, 13.333, 7.5, fill_color=DARK_BLUE)
add_rect(s1, 0, 3.0, 13.333, 4.5, fill_color=MED_BLUE)
add_rect(s1, 0, 5.5, 13.333, 2.0, fill_color=TEAL)

# decorative circles
for cx, cy, r, col in [(11.5,1.2,1.4,RGBColor(0x1E,0x5A,0x9E)),
                        (12.2,0.3,0.8,RGBColor(0x16,0x4D,0x8A)),
                        (0.8,6.5,0.7,RGBColor(0x00,0x70,0x70))]:
    c = s1.shapes.add_shape(9, Inches(cx-r/2), Inches(cy-r/2), Inches(r), Inches(r))
    c.fill.solid(); c.fill.fore_color.rgb = col
    c.line.fill.background()

add_text(s1, "HEADACHE", 1.0, 1.8, 11.0, 1.5,
         font_size=54, bold=True, color=WHITE,
         align=PP_ALIGN.CENTER, v_anchor=MSO_ANCHOR.MIDDLE)
add_text(s1, "A Comprehensive Clinical Overview", 1.0, 3.2, 11.0, 0.7,
         font_size=22, italic=True, color=LIGHT_BLUE,
         align=PP_ALIGN.CENTER, v_anchor=MSO_ANCHOR.MIDDLE)
add_text(s1, "Definition  |  Classification  |  Pathophysiology  |  Diagnosis  |  Management",
         1.0, 4.0, 11.0, 0.5, font_size=14, color=WHITE,
         align=PP_ALIGN.CENTER)
add_text(s1, "Source: Harrison's Principles of Internal Medicine 22E  |  Bradley & Daroff's Neurology  |  ROSEN's Emergency Medicine",
         0.5, 6.8, 12.3, 0.4, font_size=9, italic=True, color=RGBColor(0xCC,0xDD,0xEE),
         align=PP_ALIGN.CENTER)

# ══════════════════════════════════════════════════════════════════════════════
# SLIDE 2 — What is Headache?
# ══════════════════════════════════════════════════════════════════════════════
s2 = prs.slides.add_slide(blank)
add_header_bar(s2, "What is Headache?", "Definition and Epidemiology")

# Definition box
add_rect(s2, 0.4, 1.3, 8.2, 1.5, fill_color=LIGHT_BLUE,
         line_color=MED_BLUE, line_width=1.5)
add_text(s2, "Definition", 0.6, 1.32, 2.5, 0.38,
         font_size=13, bold=True, color=MED_BLUE)
add_text(s2,
    "Headache is pain or discomfort located in the head, scalp, or neck. "
    "It is one of the most prevalent symptoms in medicine and is consistently among the "
    "top reasons for visits to the emergency department.",
    0.6, 1.65, 7.8, 1.0, font_size=13, color=DARK_GRAY, wrap=True)

# Stat boxes
for i, (val, label, col) in enumerate([
    ("90%", "People affected at\nleast once per year", MED_BLUE),
    ("69%", "Tension-type\n(most common primary)", TEAL),
    ("16%", "Migraine\n(significant disability)", ORANGE),
    ("0.1%", "Cluster\n(most severe primary)", RED),
]):
    bx = 0.4 + i * 3.1
    add_rect(s2, bx, 3.0, 2.9, 1.6, fill_color=col)
    add_text(s2, val, bx, 3.05, 2.9, 0.75,
             font_size=34, bold=True, color=WHITE,
             align=PP_ALIGN.CENTER, v_anchor=MSO_ANCHOR.MIDDLE)
    add_text(s2, label, bx, 3.75, 2.9, 0.75,
             font_size=11, color=WHITE,
             align=PP_ALIGN.CENTER, v_anchor=MSO_ANCHOR.MIDDLE)

# Pain-sensitive structures note
add_rect(s2, 0.4, 4.85, 12.4, 1.0, fill_color=LIGHT_GRAY)
add_text(s2, "Pain-Sensitive Structures:", 0.6, 4.9, 3.0, 0.35, font_size=12, bold=True, color=DARK_BLUE)
add_text(s2,
    "The brain parenchyma itself is insensitive to pain. "
    "Pain-sensitive areas include the meninges, cerebral arteries and veins, "
    "and the tissues lining the skull cavities. Much of headache pain is "
    "mediated through the trigeminal nerve (CNV).",
    0.6, 5.22, 12.0, 0.55, font_size=11, color=MED_GRAY, wrap=True)

add_text(s2, "Source: Harrison's Principles of Internal Medicine 22E | ROSEN's Emergency Medicine",
         0.4, 7.0, 12.4, 0.3, font_size=8, italic=True, color=MED_GRAY)

# ══════════════════════════════════════════════════════════════════════════════
# SLIDE 3 — Classification
# ══════════════════════════════════════════════════════════════════════════════
s3 = prs.slides.add_slide(blank)
add_header_bar(s3, "Classification of Headache", "International Headache Society (IHS) — ICHD-3")

# Two main columns
add_rect(s3, 0.4, 1.3, 5.9, 5.5, fill_color=LIGHT_BLUE, line_color=MED_BLUE, line_width=1)
add_rect(s3, 0.4, 1.3, 5.9, 0.45, fill_color=MED_BLUE)
add_text(s3, "PRIMARY HEADACHES", 0.55, 1.32, 5.6, 0.4,
         font_size=14, bold=True, color=WHITE, align=PP_ALIGN.CENTER)

primary_items = [
    ("Tension-Type Headache", "69% of primary headaches — bilateral, band-like, mild to moderate"),
    ("Migraine", "16% — unilateral, pulsating, nausea, photo/phonophobia"),
    ("Cluster Headache", "0.1% — unilateral, severe, periorbital, autonomic features"),
    ("Other TACs", "Paroxysmal hemicrania, SUNCT, hemicrania continua"),
    ("Other Primary", "Idiopathic stabbing, exertional, hypnic, thunderclap"),
]
for i, (title, desc) in enumerate(primary_items):
    ty = 1.88 + i * 1.0
    add_rect(s3, 0.5, ty, 5.7, 0.9, fill_color=WHITE, line_color=LIGHT_BLUE, line_width=0.5)
    add_text(s3, title, 0.65, ty+0.04, 5.4, 0.3, font_size=12, bold=True, color=DARK_BLUE)
    add_text(s3, desc, 0.65, ty+0.35, 5.4, 0.5, font_size=10, color=MED_GRAY, wrap=True)

# Secondary column
add_rect(s3, 6.8, 1.3, 6.1, 5.5, fill_color=RGBColor(0xFF,0xF0,0xE8), line_color=ORANGE, line_width=1)
add_rect(s3, 6.8, 1.3, 6.1, 0.45, fill_color=ORANGE)
add_text(s3, "SECONDARY HEADACHES", 6.95, 1.32, 5.8, 0.4,
         font_size=14, bold=True, color=WHITE, align=PP_ALIGN.CENTER)

secondary_items = [
    ("Head Trauma", "Post-traumatic headache within 7 days"),
    ("Intracranial Disorders", "Subarachnoid/subdural hemorrhage, tumors, IIH"),
    ("Infections", "Meningitis, encephalitis, fever/sinusitis"),
    ("Vascular Disorders", "Stroke, cerebral venous thrombosis, arteritis"),
    ("Metabolic/Toxic Causes", "Hypertension, CO poisoning, medication overuse"),
    ("Cranial/Facial Disorders", "Cluster neuralgia, glaucoma, TMJ, dental"),
]
for i, (title, desc) in enumerate(secondary_items):
    ty = 1.88 + i * 0.83
    add_rect(s3, 6.9, ty, 5.9, 0.75, fill_color=WHITE, line_color=RGBColor(0xFF,0xD0,0xA0), line_width=0.5)
    add_text(s3, title, 7.05, ty+0.03, 5.6, 0.28, font_size=12, bold=True, color=ORANGE)
    add_text(s3, desc, 7.05, ty+0.3, 5.6, 0.4, font_size=10, color=MED_GRAY, wrap=True)

add_text(s3, "Source: ICHD-3 | Harrison's 22E | Kaplan & Sadock's Comprehensive Textbook of Psychiatry",
         0.4, 7.0, 12.4, 0.3, font_size=8, italic=True, color=MED_GRAY)

# ══════════════════════════════════════════════════════════════════════════════
# SLIDE 4 — Migraine
# ══════════════════════════════════════════════════════════════════════════════
s4 = prs.slides.add_slide(blank)
add_header_bar(s4, "Migraine Headache", "Most common disabling primary headache")

# Characteristics
add_bullet_box(s4, "Clinical Features", [
    "Recurrent attacks of moderate-to-severe unilateral pulsating pain",
    "Duration: 4-72 hours (untreated)",
    "Nausea and/or vomiting common",
    "Photophobia AND phonophobia",
    "Worsens with routine physical activity",
    "May have aura (visual, sensory, motor) preceding headache by 5-60 min",
], 0.4, 1.3, 5.8, 3.5, title_bg=MED_BLUE, body_bg=LIGHT_BLUE)

add_bullet_box(s4, "Pathophysiology", [
    "A brain disorder — NOT a pure vascular headache",
    "Trigeminovascular system activation is central",
    "CGRP (calcitonin gene-related peptide) plays key role",
    "Cortical spreading depression underlies aura",
    "Cranial autonomic symptoms from parasympathetic pathway activation",
    "Posterior hypothalamic and brainstem involvement",
], 6.6, 1.3, 6.3, 3.5, title_bg=TEAL, body_bg=RGBColor(0xE0,0xF7,0xF7))

# Triggers
add_rect(s4, 0.4, 5.0, 12.5, 0.38, fill_color=ORANGE)
add_text(s4, "Common Migraine Triggers", 0.55, 5.02, 8.0, 0.33,
         font_size=13, bold=True, color=WHITE)
triggers = ["Stress/anxiety", "Hormonal changes (menstruation)", "Irregular sleep",
            "Skipped meals", "Alcohol/caffeine", "Bright lights/noise",
            "Strong odors", "Weather changes"]
cols = 4
for i, t in enumerate(triggers):
    tx = 0.4 + (i % cols) * 3.1
    ty = 5.5 + (i // cols) * 0.45
    add_rect(s4, tx, ty, 2.9, 0.38, fill_color=RGBColor(0xFF,0xF0,0xE8), line_color=ORANGE, line_width=0.5)
    add_text(s4, u"\u26A0 " + t, tx+0.1, ty+0.04, 2.7, 0.3, font_size=10, color=ORANGE)

add_text(s4, "Source: Harrison's 22E | Neuroanatomy through Clinical Cases 3rd Ed",
         0.4, 7.1, 12.4, 0.3, font_size=8, italic=True, color=MED_GRAY)

# ══════════════════════════════════════════════════════════════════════════════
# SLIDE 5 — Tension & Cluster Headache
# ══════════════════════════════════════════════════════════════════════════════
s5 = prs.slides.add_slide(blank)
add_header_bar(s5, "Tension-Type & Cluster Headache", "Other Major Primary Headache Disorders")

# Tension
add_rect(s5, 0.4, 1.3, 6.0, 5.8, fill_color=LIGHT_GRAY, line_color=MED_BLUE, line_width=1)
add_rect(s5, 0.4, 1.3, 6.0, 0.45, fill_color=MED_BLUE)
add_text(s5, "TENSION-TYPE HEADACHE (TTH)", 0.55, 1.32, 5.7, 0.4,
         font_size=13, bold=True, color=WHITE, align=PP_ALIGN.CENTER)

tth_sections = [
    ("Prevalence", "Most common headache — 75% of individuals experience at some time"),
    ("Character", "Bilateral, pressing/tightening (band-like), mild-to-moderate intensity"),
    ("Duration", "30 minutes to several hours or days"),
    ("Associated Features", "No nausea; mild photo- OR phonophobia (not both)"),
    ("Chronic Form", ">15 days/month; associated with depression; overlaps with migraine"),
    ("Treatment", "NSAIDs, muscle relaxation, amitriptyline for chronic form"),
]
for i, (label, text) in enumerate(tth_sections):
    ty = 1.9 + i * 0.85
    add_text(s5, label + ":", 0.6, ty, 1.8, 0.3, font_size=11, bold=True, color=MED_BLUE)
    add_text(s5, text, 2.35, ty, 3.85, 0.55, font_size=10, color=DARK_GRAY, wrap=True)

# Cluster
add_rect(s5, 6.9, 1.3, 6.0, 5.8, fill_color=RGBColor(0xFF,0xF0,0xF0), line_color=RED, line_width=1)
add_rect(s5, 6.9, 1.3, 6.0, 0.45, fill_color=RED)
add_text(s5, "CLUSTER HEADACHE", 7.05, 1.32, 5.7, 0.4,
         font_size=13, bold=True, color=WHITE, align=PP_ALIGN.CENTER)

cluster_sections = [
    ("Prevalence", "0.1%; 4x more common in males; most severe primary headache"),
    ("Pattern", "Clusters of 1-8/day for weeks, then remission for months"),
    ("Character", "Extremely severe, steady boring pain behind one eye (unilateral)"),
    ("Duration", "30-90 minutes per attack"),
    ("Autonomic Features", "Ipsilateral: tearing, conjunctival injection, ptosis, miosis, nasal congestion (Horner's-like)"),
    ("Neuroimage Finding", "Posterior hypothalamic activation during attacks on fMRI"),
    ("Treatment", "Triptans, high-flow O2 (100%), verapamil for prevention"),
]
for i, (label, text) in enumerate(cluster_sections):
    ty = 1.9 + i * 0.73
    add_text(s5, label + ":", 7.1, ty, 1.8, 0.3, font_size=11, bold=True, color=RED)
    add_text(s5, text, 8.85, ty, 3.85, 0.65, font_size=10, color=DARK_GRAY, wrap=True)

add_text(s5, "Source: Neuroanatomy through Clinical Cases 3rd Ed | Harrison's 22E",
         0.4, 7.1, 12.4, 0.3, font_size=8, italic=True, color=MED_GRAY)

# ══════════════════════════════════════════════════════════════════════════════
# SLIDE 6 — Red Flags ("SNOOP" criteria)
# ══════════════════════════════════════════════════════════════════════════════
s6 = prs.slides.add_slide(blank)
add_header_bar(s6, "Red Flag Signs in Headache", "When to suspect a Serious (Secondary) Cause")

add_rect(s6, 0.4, 1.3, 12.5, 0.55, fill_color=RED)
add_text(s6, "\"SNOOP\" Mnemonic — Indicators requiring urgent evaluation",
         0.55, 1.33, 12.2, 0.46, font_size=14, bold=True, color=WHITE, align=PP_ALIGN.CENTER)

snoop = [
    ("S", "Systemic Symptoms / Signs", "Fever, meningism, weight loss, immune compromise; suspect meningitis, encephalitis, temporal arteritis"),
    ("N", "Neurologic Symptoms", "Altered consciousness, focal deficits, papilledema, cranial nerve abnormalities"),
    ("O", "Onset — Sudden/Thunderclap", "\"Worst headache of life\"; rapid peak within seconds; SAH until proven otherwise (missed >25% on first presentation)"),
    ("O", "Older Age Onset (>50)", "New headache after age 50 — suspect temporal arteritis, mass lesion, subdural hematoma"),
    ("P", "Progressive / Postural Change", "Worsening over days/weeks; positional component (worse lying flat or standing) — ICP or CSF pressure issue"),
]
cols_w = [0.6, 2.2, 9.0]
for i, (letter, title, detail) in enumerate(snoop):
    row_y = 2.05 + i * 0.98
    bg = LIGHT_BLUE if i % 2 == 0 else WHITE
    add_rect(s6, 0.4, row_y, 12.5, 0.9, fill_color=bg)
    # letter circle
    c = s6.shapes.add_shape(9, Inches(0.5), Inches(row_y+0.1), Inches(0.65), Inches(0.65))
    c.fill.solid(); c.fill.fore_color.rgb = RED
    c.line.fill.background()
    add_text(s6, letter, 0.5, row_y+0.1, 0.65, 0.65,
             font_size=22, bold=True, color=WHITE, align=PP_ALIGN.CENTER, v_anchor=MSO_ANCHOR.MIDDLE)
    add_text(s6, title, 1.3, row_y+0.06, 3.2, 0.35, font_size=12, bold=True, color=DARK_BLUE)
    add_text(s6, detail, 1.3, row_y+0.42, 11.3, 0.42, font_size=10, color=MED_GRAY, wrap=True)

add_text(s6, "Also: Carbon monoxide poisoning | Cerebral venous thrombosis | Preeclampsia | Increased ICP",
         0.4, 7.0, 12.4, 0.3, font_size=9, italic=True, color=RED)

# ══════════════════════════════════════════════════════════════════════════════
# SLIDE 7 — Diagnosis
# ══════════════════════════════════════════════════════════════════════════════
s7 = prs.slides.add_slide(blank)
add_header_bar(s7, "Diagnostic Approach", "History, Examination & Investigations")

# History box
add_bullet_box(s7, "Key History Points", [
    "Onset pattern: sudden vs. gradual; first-ever vs. recurrent",
    "Character: throbbing, pressing, stabbing, boring",
    "Location: unilateral, bilateral, frontal, occipital",
    "Severity (0-10 scale) and duration of each attack",
    "Associated symptoms: nausea, vomiting, visual/sensory aura",
    "Triggers: stress, food, sleep, hormones, activity",
    "Change in prior headache pattern (always worrisome)",
    "Medications used and response",
], 0.4, 1.3, 4.0, 5.9, title_bg=MED_BLUE, bullet_size=11)

# Exam box
add_bullet_box(s7, "Physical Examination", [
    "Vital signs: BP (hypertensive emergency?), fever",
    "Mental status assessment",
    "Fundoscopy: papilledema = raised ICP",
    "Meningeal signs: nuchal rigidity, Kernig, Brudzinski",
    "Cranial nerve exam (II, III, IV, VI especially)",
    "Focal neurologic deficits",
    "Temporal artery tenderness (arteritis)",
], 4.6, 1.3, 4.0, 5.9, title_bg=TEAL, bullet_size=11)

# Investigations box
add_bullet_box(s7, "Investigations", [
    "CT head (non-contrast): first-line for acute severe headache / suspected SAH",
    "MRI brain: more sensitive for structural lesions, posterior fossa",
    "Lumbar puncture: if CT negative but SAH still suspected (xanthochromia)",
    "CT/MR angiography: cervical artery dissection, aneurysm",
    "Blood tests: ESR/CRP (arteritis), CBC, metabolic panel",
    "Note: Most primary headaches do NOT require imaging",
], 8.8, 1.3, 4.1, 5.9, title_bg=ORANGE, bullet_size=11)

add_text(s7, "Source: ROSEN's Emergency Medicine | Harrison's 22E",
         0.4, 7.1, 12.4, 0.3, font_size=8, italic=True, color=MED_GRAY)

# ══════════════════════════════════════════════════════════════════════════════
# SLIDE 8 — Treatment
# ══════════════════════════════════════════════════════════════════════════════
s8 = prs.slides.add_slide(blank)
add_header_bar(s8, "Management of Headache", "Acute Treatment & Prophylaxis")

# Acute treatment
add_rect(s8, 0.4, 1.3, 12.5, 0.4, fill_color=MED_BLUE)
add_text(s8, "ACUTE / ABORTIVE TREATMENT", 0.55, 1.32, 12.2, 0.35,
         font_size=13, bold=True, color=WHITE, align=PP_ALIGN.CENTER)

acute_drugs = [
    ("NSAIDs", "Ibuprofen, Naproxen, Ketorolac IV/IM\nFirst-line for mild-moderate; also TTH"),
    ("Triptans\n(5-HT 1B/D agonists)", "Sumatriptan, Rizatriptan, Zolmitriptan\nMigraine & cluster-specific; contraindicated in CV disease"),
    ("Ditans\n(5-HT 1F agonists)", "Lasmiditan\nMigraine-specific; no vasoconstriction — safer in CV disease"),
    ("CGRP Antagonists\n(gepants)", "Ubrogepant, Rimegepant\nNovel migraine-specific; also useful in medication overuse"),
    ("Dopamine Antagonists", "Metoclopramide, Prochlorperazine IV\nEmergency dept first-line; also treats nausea"),
    ("Oxygen (100%)", "High-flow O2 via non-rebreather mask\nHighly effective for cluster headache attacks"),
]
for i, (drug, detail) in enumerate(acute_drugs):
    col = i % 3
    row = i // 3
    bx = 0.4 + col * 4.15
    by = 1.85 + row * 1.3
    add_rect(s8, bx, by, 4.0, 1.2, fill_color=LIGHT_BLUE, line_color=MED_BLUE, line_width=0.5)
    add_text(s8, drug, bx+0.12, by+0.06, 3.75, 0.38, font_size=11, bold=True, color=DARK_BLUE, wrap=True)
    add_text(s8, detail, bx+0.12, by+0.48, 3.75, 0.65, font_size=9, color=MED_GRAY, wrap=True)

# Prophylaxis section
add_rect(s8, 0.4, 4.55, 12.5, 0.38, fill_color=GREEN)
add_text(s8, "PROPHYLAXIS / PREVENTIVE THERAPY (for frequent or disabling headaches)",
         0.55, 4.57, 12.2, 0.33, font_size=12, bold=True, color=WHITE, align=PP_ALIGN.CENTER)

proph = [
    ("Beta-blockers", "Propranolol, Metoprolol", MED_BLUE),
    ("Ca-channel blockers", "Verapamil (especially cluster)", TEAL),
    ("Anticonvulsants", "Topiramate, Valproate", ORANGE),
    ("CGRP mAbs", "Erenumab, Galcanezumab, Fremanezumab", MED_BLUE),
    ("Tricyclic ADs", "Amitriptyline, Nortriptyline", TEAL),
    ("OnabotulinumA", "Botox — chronic migraine only", ORANGE),
]
for i, (cls, drug, col) in enumerate(proph):
    px = 0.4 + i * 2.06
    add_rect(s8, px, 5.05, 1.95, 1.2, fill_color=col)
    add_text(s8, cls, px+0.1, 5.08, 1.75, 0.42, font_size=9, bold=True, color=WHITE, wrap=True, align=PP_ALIGN.CENTER)
    add_text(s8, drug, px+0.1, 5.5, 1.75, 0.65, font_size=8, color=WHITE, wrap=True, align=PP_ALIGN.CENTER)

add_text(s8, "Source: Harrison's 22E | Neuroanatomy through Clinical Cases | ROSEN's Emergency Medicine",
         0.4, 7.1, 12.4, 0.3, font_size=8, italic=True, color=MED_GRAY)

# ══════════════════════════════════════════════════════════════════════════════
# SLIDE 9 — Non-Pharmacological & Special Situations
# ══════════════════════════════════════════════════════════════════════════════
s9 = prs.slides.add_slide(blank)
add_header_bar(s9, "Non-Pharmacological Management & Special Situations",
               "Behavioural Strategies | Pregnancy | Medication Overuse")

add_bullet_box(s9, "Non-Pharmacological Approaches", [
    "Cognitive behavioural therapy (CBT) — strong evidence for migraine",
    "Sleep hygiene and regular sleep schedule",
    "Dietary trigger avoidance (caffeine, alcohol, aged cheese, tyramine)",
    "Regular aerobic exercise (150 min/week moderate intensity)",
    "Stress management and biofeedback",
    "Moist heat, massage, physiotherapy for tension headache",
    "Acupuncture — modest evidence as preventive",
], 0.4, 1.3, 4.2, 5.8, title_bg=GREEN, bullet_size=11)

add_bullet_box(s9, "Headache in Pregnancy", [
    "Tension headache most common — usually safe to manage with paracetamol",
    "NSAIDs caution: avoid in 3rd trimester",
    "Migraine often improves in 2nd & 3rd trimester (>80% improve)",
    "Tricyclics (amitriptyline): no known embryopathy",
    "Migraine with aura: increased risk for preeclampsia and peripartum stroke",
    "NEW headache in pregnancy: always exclude preeclampsia, venous thrombosis",
    "Avoid ergotamines, valproate in pregnancy",
], 4.75, 1.3, 4.2, 5.8, title_bg=TEAL, bullet_size=11)

add_bullet_box(s9, "Medication Overuse Headache (MOH)", [
    "Occurs with >10 days/month use of triptans, ergots, opioids",
    "Or >15 days/month of simple analgesics / NSAIDs",
    "Creates a cycle of worsening rebound headache",
    "Treatment: gradual 10% dose reduction every 1-2 weeks",
    "Introduce preventive medication simultaneously",
    "Inpatient detox for refractory cases (IV DHE protocol)",
    "Avoid opioids for primary headache — not indicated",
], 9.1, 1.3, 3.9, 5.8, title_bg=ORANGE, bullet_size=11)

add_text(s9, "Source: Harrison's 22E | Bradley & Daroff's Neurology | Creasy & Resnik's Maternal-Fetal Medicine",
         0.4, 7.1, 12.4, 0.3, font_size=8, italic=True, color=MED_GRAY)

# ══════════════════════════════════════════════════════════════════════════════
# SLIDE 10 — Summary
# ══════════════════════════════════════════════════════════════════════════════
s10 = prs.slides.add_slide(blank)
add_rect(s10, 0, 0, 13.333, 7.5, fill_color=DARK_BLUE)
add_rect(s10, 0, 0, 13.333, 0.08, fill_color=TEAL)
add_rect(s10, 0, 7.42, 13.333, 0.08, fill_color=TEAL)

add_text(s10, "Key Takeaways", 0.5, 0.25, 12.3, 0.65,
         font_size=30, bold=True, color=WHITE, align=PP_ALIGN.CENTER)

takeaways = [
    ("1", "Headache is one of the most common medical complaints; most are benign primary disorders (tension, migraine, cluster)."),
    ("2", "The IHS ICHD-3 classifies headache into Primary (no structural cause) and Secondary (underlying pathology) types."),
    ("3", "Migraine is a brain disorder (not purely vascular) — trigeminovascular activation and CGRP are central to its mechanism."),
    ("4", "Red flag features (SNOOP) demand urgent evaluation to exclude SAH, meningitis, cerebral venous thrombosis, and mass lesions."),
    ("5", "Thunderclap headache is SAH until proven otherwise — missed in >25% of first presentations."),
    ("6", "Acute treatment: NSAIDs, triptans, gepants, dopamine antagonists. Prophylaxis: beta-blockers, topiramate, CGRP monoclonal antibodies."),
    ("7", "Medication overuse headache is a common and reversible cause of chronic daily headache — opioids should be avoided."),
]
for i, (num, text) in enumerate(takeaways):
    ty = 1.05 + i * 0.85
    # number circle
    c = s10.shapes.add_shape(9, Inches(0.5), Inches(ty+0.08), Inches(0.5), Inches(0.5))
    c.fill.solid(); c.fill.fore_color.rgb = TEAL
    c.line.fill.background()
    add_text(s10, num, 0.5, ty+0.08, 0.5, 0.5,
             font_size=14, bold=True, color=WHITE, align=PP_ALIGN.CENTER, v_anchor=MSO_ANCHOR.MIDDLE)
    add_text(s10, text, 1.15, ty+0.05, 11.8, 0.62,
             font_size=12, color=WHITE, wrap=True)

add_text(s10,
    "Sources: Harrison's Principles of Internal Medicine 22E | Bradley & Daroff's Neurology in Clinical Practice | "
    "ROSEN's Emergency Medicine | Neuroanatomy through Clinical Cases 3rd Ed | Kaplan & Sadock's Comprehensive Textbook",
    0.5, 7.12, 12.3, 0.3, font_size=8, italic=True, color=RGBColor(0xAA,0xBB,0xCC),
    align=PP_ALIGN.CENTER)

# ── Save ───────────────────────────────────────────────────────────────────────
out_path = "/tmp/workspace/headache-ppt/Headache_Comprehensive_Overview.pptx"
buf = BytesIO()
prs.save(buf)
with open(out_path, "wb") as f:
    f.write(buf.getvalue())
print(f"Saved: {out_path}")
print(f"Slides: {len(prs.slides)}")
Running Command

python /tmp/workspace/headache-ppt/create_headache_ppt.py

Your presentation is ready! Here is the download link:

Headache Comprehensive Overview

Presentation · PPTX


What's in the Presentation (10 Slides)

SlideTitle
1Title Slide - Styled in deep navy/teal with subtitle
2What is Headache? - Definition, epidemiology stats (90%/69%/16%/0.1%), pain-sensitive structures
3Classification - Primary vs. Secondary headaches side-by-side (IHS ICHD-3)
4Migraine - Clinical features, pathophysiology (CGRP, trigeminovascular system), triggers
5Tension-Type & Cluster Headache - Detailed comparison of both
6Red Flags ("SNOOP") - Systemic/Neurologic/Onset/Older age/Progressive indicators
7Diagnostic Approach - History, physical exam, investigations (CT, MRI, LP)
8Management - Acute drugs (triptans, NSAIDs, gepants, O2) + prophylaxis options
9Non-Pharmacological & Special Situations - CBT, pregnancy, medication overuse headache
10Key Takeaways Summary - 7 clinical pearls on dark navy background

Quick Answer: What is Headache?

A headache is pain or discomfort in the head, scalp, or neck. Key points:
  • Brain parenchyma is NOT pain-sensitive - pain arises from meninges, cerebral vessels, and skull-lining tissues, largely mediated through the trigeminal nerve (CNV)
  • Primary headaches (no underlying structural cause): tension-type (69%), migraine (16%), cluster (0.1%)
  • Secondary headaches arise from an identifiable cause - infections (meningitis), vascular events (SAH, stroke), masses, metabolic disorders
  • Migraine is now understood as a brain disorder - the trigeminovascular system and CGRP are central to its mechanism, not merely vascular changes
  • Red flag: a sudden "thunderclap" (worst headache of life) is subarachnoid hemorrhage until proven otherwise - missed in >25% of first presentations
Sources: Harrison's Principles of Internal Medicine 22E | Bradley & Daroff's Neurology | ROSEN's Emergency Medicine | Neuroanatomy through Clinical Cases 3rd Ed
This is a shared conversation. Sign in to Orris to start your own chat.