Enumerate and describe the mediators of acute inflammation as per robins pathology and make appt with diagrams
acute inflammation mediators
acute inflammation mediators complement histamine prostaglandins leukotrienes current overview
diagram of chemical mediators of acute inflammation histamine complement arachidonic acid cytokines
~/
mkdir -p "/tmp/workspace/acute-inflammation-mediators/src" "/tmp/workspace/acute-inflammation-mediators/output" "/tmp/workspace/acute-inflammation-mediators/assets" && python /tmp/skills/shared/scripts/fetch_images.py "https://cdn.orris.care/cdss_images/HARRISON_1763035623169_1376bfa8-6600-4e6e-aa2f-aa2905b14e0d.png" > "/tmp/workspace/acute-inflammation-mediators/assets/fetch_result.json"
~/acute-inflammation-mediators/src/create_deck.py
import os, json, base64
from io import BytesIO
from pptx import Presentation
from pptx.util import Inches, Pt
from pptx.enum.shapes import MSO_SHAPE, MSO_CONNECTOR
from pptx.enum.text import PP_ALIGN, MSO_ANCHOR
from pptx.dml.color import RGBColor
from pptx.enum.dml import MSO_THEME_COLOR
OUT = '/tmp/workspace/acute-inflammation-mediators/output/Acute_Inflammation_Mediators_Robbins.pptx'
ASSET = '/tmp/workspace/acute-inflammation-mediators/assets/fetch_result.json'
NAVY=RGBColor(21,45,72); BLUE=RGBColor(46,116,181); TEAL=RGBColor(0,144,151)
RED=RGBColor(194,58,68); ORANGE=RGBColor(231,137,47); GOLD=RGBColor(242,190,62)
PALE=RGBColor(244,248,252); LIGHTBLUE=RGBColor(224,239,249); LIGHTTEAL=RGBColor(223,245,243)
LIGHTRED=RGBColor(252,232,233); LIGHTGOLD=RGBColor(255,246,218); GRAY=RGBColor(87,101,115); WHITE=RGBColor(255,255,255)
prs=Presentation(); prs.slide_width=Inches(13.333); prs.slide_height=Inches(7.5)
blank=prs.slide_layouts[6]
def rect(slide,x,y,w,h,fill, radius=False, line=None):
sh=slide.shapes.add_shape(MSO_SHAPE.ROUNDED_RECTANGLE if radius else MSO_SHAPE.RECTANGLE, Inches(x), Inches(y), Inches(w), Inches(h))
sh.fill.solid(); sh.fill.fore_color.rgb=fill
sh.line.color.rgb = line if line else fill
return sh
def textbox(slide,x,y,w,h,text,size=18,color=NAVY,bold=False,align=PP_ALIGN.LEFT, font='Aptos', margin=.06):
tb=slide.shapes.add_textbox(Inches(x),Inches(y),Inches(w),Inches(h)); tf=tb.text_frame; tf.clear(); tf.word_wrap=True
tf.margin_left=tf.margin_right=Inches(margin); tf.margin_top=tf.margin_bottom=Inches(margin); tf.vertical_anchor=MSO_ANCHOR.MIDDLE
for i,line in enumerate(text.split('\n')):
p=tf.paragraphs[0] if i==0 else tf.add_paragraph(); p.text=line; p.alignment=align; p.space_after=Pt(2)
for r in p.runs: r.font.name=font; r.font.size=Pt(size); r.font.bold=bold; r.font.color.rgb=color
return tb
def title(slide,txt,sub=None):
rect(slide,0,0,13.333,.17,TEAL)
textbox(slide,.55,.32,12.2,.48,txt,28,NAVY,True)
if sub: textbox(slide,.58,.82,12,.25,sub,10,GRAY)
def foot(slide,n):
textbox(slide,.55,7.12,8.5,.18,'Robbins, Cotran & Kumar Pathologic Basis of Disease, Ch. 3, pp. 76-82',9,GRAY)
textbox(slide,12.15,7.08,.55,.22,str(n),10,GRAY,True,PP_ALIGN.RIGHT)
def bulletbox(slide,x,y,w,h,heading,items,accent=BLUE,fs=15):
rect(slide,x,y,w,h,WHITE,True,RGBColor(211,220,229)); rect(slide,x,y,.11,h,accent)
textbox(slide,x+.23,y+.14,w-.35,.3,heading,17,accent,True)
tb=slide.shapes.add_textbox(Inches(x+.23),Inches(y+.55),Inches(w-.38),Inches(h-.65)); tf=tb.text_frame; tf.clear(); tf.word_wrap=True
tf.margin_left=Inches(.02); tf.margin_right=Inches(.02); tf.margin_top=Inches(.02)
for i,it in enumerate(items):
p=tf.paragraphs[0] if i==0 else tf.add_paragraph(); p.text=it; p.level=0; p.font.size=Pt(fs); p.font.name='Aptos'; p.font.color.rgb=NAVY; p.space_after=Pt(7); p.bullet=True
return tb
def arrow(slide,x1,y1,x2,y2,color=GRAY,width=2):
ln=slide.shapes.add_connector(MSO_CONNECTOR.STRAIGHT,Inches(x1),Inches(y1),Inches(x2),Inches(y2)); ln.line.color.rgb=color; ln.line.width=Pt(width); ln.line.end_arrowhead=True; return ln
def node(slide,x,y,w,h,label,fill,fs=15):
rect(slide,x,y,w,h,fill,True,fill); textbox(slide,x+.05,y+.05,w-.1,h-.1,label,fs,NAVY,True,PP_ALIGN.CENTER)
# 1
s=prs.slides.add_slide(blank); rect(s,0,0,13.333,7.5,NAVY); rect(s,0,0,13.333,.22,TEAL)
textbox(s,.72,1.1,8.2,.9,'Mediators of\nAcute Inflammation',36,WHITE,True)
textbox(s,.75,2.18,7.4,.45,'Robbins Pathology based teaching deck',19,RGBColor(194,220,235))
textbox(s,.76,2.75,7.4,.7,'Sources, principal actions, and exam-focused integration',18,WHITE)
# graphic
for i,(lab,c) in enumerate([('Preformed\nmediators',LIGHTRED),('Newly\nsynthesized',LIGHTGOLD),('Plasma\nproteins',LIGHTTEAL)]):
node(s,9.0,1.5+i*1.38,2.6,.8,lab,c,16)
arrow(s,8.0,3.25,8.85,1.9,TEAL); arrow(s,8.0,3.25,8.85,3.28,TEAL); arrow(s,8.0,3.25,8.85,4.65,TEAL)
node(s,5.9,2.82,2.1,.85,'Tissue injury\n/ microbes',RGBColor(205,231,244),16)
textbox(s,.75,6.55,8.9,.25,'Prepared for pathology teaching | September 2026',11,RGBColor(194,220,235))
# 2
s=prs.slides.add_slide(blank); title(s,'The core idea','What makes a molecule an inflammatory mediator?'); foot(s,2)
bulletbox(s,.6,1.3,5.9,4.9,'Robbins framework',[
'Produced by cells or derived from plasma proteins.',
'Most act by binding specific receptors on target cells.',
'One mediator can stimulate release of others, creating cascades.',
'Actions are often brief and tightly controlled by degradation, inhibitors, or decay.',
'Common effects: vasodilation, increased permeability, leukocyte recruitment and activation, pain, fever, tissue injury.' ],TEAL,17)
node(s,7.5,1.6,2.4,.7,'Injury or microbe',LIGHTGOLD,17); node(s,7.5,3.0,2.4,.8,'Sentinel cells\n& plasma cascades',LIGHTBLUE,16); node(s,7.5,4.6,2.4,.8,'Mediator release',LIGHTRED,17)
for yy in [2.3,3.95]: arrow(s,8.7,yy,8.7,yy+.62,TEAL)
for i,(lab,c) in enumerate([('Vascular change',LIGHTTEAL),('Leukocyte recruitment',LIGHTGOLD),('Pain / fever',LIGHTRED)]):
node(s,10.6,1.55+i*1.42,2.1,.62,lab,c,13); arrow(s,9.95,3.4,10.5,1.86+i*1.42,GRAY)
# 3 overview
s=prs.slides.add_slide(blank); title(s,'Classification at a glance','Memorize by source first, then map each mediator to its dominant effects.'); foot(s,3)
cols=[('Cell-derived',LIGHTBLUE,['Vasoactive amines','Eicosanoids','PAF','Cytokines / chemokines','Nitric oxide','ROS / lysosomal enzymes','Neuropeptides']),('Plasma-derived',LIGHTTEAL,['Complement','Kinin system','Coagulation / fibrinolytic products']),('Functional outcome',LIGHTGOLD,['Vasodilation','Vascular leakage','Chemotaxis / activation','Pain and fever','Microbial killing / tissue injury'])]
for i,(h,c,items) in enumerate(cols): bulletbox(s,.55+i*4.2,1.42,3.78,4.95,h,items,[BLUE,TEAL,ORANGE][i],16)
textbox(s,.7,6.62,12,.25,'Important: the groups overlap. For example, C5a activates leukocytes and triggers mast-cell histamine release.',14,RED,True,PP_ALIGN.CENTER)
# 4 amines
s=prs.slides.add_slide(blank); title(s,'1. Vasoactive amines: histamine and serotonin','Fast, preformed mediators.'); foot(s,4)
bulletbox(s,.55,1.25,5.6,5.45,'Histamine',[
'Sources: chiefly mast cells; also basophils and platelets.',
'Release triggers: trauma, heat/cold, IgE-mediated mast-cell activation, C3a/C5a, neuropeptides and cytokines.',
'Actions: arteriolar vasodilation; increased postcapillary venular permeability by endothelial contraction and gaps; smooth-muscle contraction.',
'H1 receptors on endothelial cells mediate most vasoactive effects.',
'Clinical link: H1 blockers help allergic reactions.' ],RED,15)
bulletbox(s,6.55,1.25,3.0,5.45,'Serotonin',[
'Source: platelets and enterochromaffin cells.',
'Preformed vasoactive mediator.',
'Vasoconstrictor.',
'Its exact importance in inflammation is less clear.' ],ORANGE,15)
# vessel diagram
textbox(s,9.9,1.3,2.7,.3,'Histamine: vessel effect',15,TEAL,True,PP_ALIGN.CENTER)
rect(s,10.25,2.1,2.0,.72,LIGHTRED,True,RED); textbox(s,10.35,2.25,1.8,.2,'Postcapillary venule',13,RED,True,PP_ALIGN.CENTER)
for x in [10.5,11.0,11.5,12.0]:
rect(s,x,2.85,.15,.4,WHITE,True,WHITE)
textbox(s,9.7,3.45,3.0,.55,'Endothelial gaps →\nprotein-rich exudate',15,NAVY,True,PP_ALIGN.CENTER)
arrow(s,11.25,3.28,11.25,3.8,RED)
# 5 eicos
s=prs.slides.add_slide(blank); title(s,'2. Arachidonic acid metabolites (eicosanoids)','Newly synthesized lipid mediators.'); foot(s,5)
node(s,.65,1.32,2.3,.64,'Membrane phospholipids',LIGHTBLUE,15); node(s,3.4,1.32,1.85,.64,'Arachidonic acid',LIGHTGOLD,15); arrow(s,2.96,1.64,3.36,1.64,TEAL); textbox(s,2.45,1.18,.85,.2,'PLA₂',12,TEAL,True,PP_ALIGN.CENTER)
node(s,2.3,2.55,2.05,.55,'COX pathway',LIGHTTEAL,15); node(s,6.05,2.55,2.15,.55,'5-lipoxygenase',LIGHTTEAL,15); arrow(s,4.3,1.96,3.35,2.5,TEAL); arrow(s,5.15,1.96,7.05,2.5,TEAL)
node(s,.55,3.62,2.0,.9,'PGI₂ / PGE₂ / PGD₂',LIGHTBLUE,15); node(s,2.95,3.62,1.75,.9,'TXA₂',LIGHTRED,15); node(s,5.2,3.62,1.75,.9,'LTB₄',LIGHTGOLD,15); node(s,7.35,3.62,2.15,.9,'LTC₄ / LTD₄ / LTE₄',LIGHTGOLD,14); node(s,9.95,3.62,1.9,.9,'Lipoxins',LIGHTTEAL,15)
for sx,ex in [(3.2,1.55),(3.2,3.82),(7.12,6.08),(7.12,8.42),(7.12,10.9)]: arrow(s,sx,3.1,ex,3.55,TEAL)
bulletbox(s,.6,5.1,3.0,1.58,'Prostaglandins',['PGI₂: vasodilation; inhibits platelets.','PGE₂: vasodilation, pain, fever.','TXA₂: platelet aggregation, vasoconstriction.'],BLUE,12)
bulletbox(s,3.9,5.1,3.25,1.58,'Leukotrienes',['LTB₄: strong chemotaxis and leukocyte activation.','LTC₄-D₄-E₄: vasoconstriction, bronchospasm, permeability.'],ORANGE,12)
bulletbox(s,7.45,5.1,4.3,1.58,'Lipoxins',['Inhibit neutrophil recruitment and adhesion.','A counter-regulatory, pro-resolution signal.'],TEAL,12)
# 6 cytokines
s=prs.slides.add_slide(blank); title(s,'3. Cytokines and chemokines','The principal cytokines in acute inflammation are TNF and IL-1.'); foot(s,6)
bulletbox(s,.55,1.25,4.0,5.4,'TNF and IL-1',[
'Major sources: activated macrophages, dendritic cells and other cells.',
'Endothelial activation: adhesion-molecule expression and leukocyte recruitment.',
'Induce systemic acute-phase responses: fever, leukocytosis and hepatic acute-phase proteins.',
'Excess TNF contributes to septic shock: hypotension, DIC and metabolic disturbance.' ],RED,15)
bulletbox(s,4.8,1.25,3.7,5.4,'Chemokines',[
'Chemoattractant cytokines that direct leukocyte migration.',
'CXCL8 (IL-8) recruits and activates neutrophils.',
'Create gradients that guide leukocytes from blood toward injury.' ],TEAL,15)
node(s,9.2,1.55,2.2,.68,'Macrophage',LIGHTGOLD,16); node(s,9.2,3.05,2.2,.68,'Endothelium',LIGHTBLUE,16); node(s,9.2,4.55,2.2,.68,'Neutrophil',LIGHTTEAL,16)
arrow(s,10.3,2.25,10.3,2.95,RED); arrow(s,10.3,3.75,10.3,4.45,TEAL)
textbox(s,11.65,2.8,1.0,1.25,'TNF / IL-1\n↑ adhesion\nCXCL8\nchemotaxis',12,NAVY,True,PP_ALIGN.CENTER)
# 7 complement
s=prs.slides.add_slide(blank); title(s,'4. Complement system','Plasma proteins activated by classical, alternative, or lectin pathways.'); foot(s,7)
node(s,.7,1.45,2.25,.7,'Complement activation',LIGHTBLUE,16); node(s,4.0,1.1,1.75,.62,'C3a',LIGHTGOLD,17); node(s,4.0,2.22,1.75,.62,'C5a',LIGHTGOLD,17); node(s,4.0,3.34,1.75,.62,'C3b',LIGHTTEAL,17); node(s,4.0,4.46,1.75,.62,'C5b-9 (MAC)',LIGHTRED,15)
for y in [1.4,2.52,3.64,4.76]: arrow(s,2.98,1.8,3.93,y,TEAL)
node(s,7.05,1.08,4.65,.7,'Anaphylatoxins: mast-cell degranulation → histamine',LIGHTGOLD,14); node(s,7.05,2.2,4.65,.7,'Chemotaxis, leukocyte activation, ↑ integrin avidity',LIGHTGOLD,14); node(s,7.05,3.32,4.65,.7,'Opsonization: enhanced phagocytosis via complement receptors',LIGHTTEAL,14); node(s,7.05,4.44,4.65,.7,'Cell lysis through membrane attack complex',LIGHTRED,14)
for y in [1.4,2.52,3.64,4.76]: arrow(s,5.78,y,6.96,y,GRAY)
textbox(s,.8,6.2,11.7,.38,'High-yield distinction: C5a is a powerful chemotactic and activating factor; C3b is the major opsonin.',16,RED,True,PP_ALIGN.CENTER)
# 8 other
s=prs.slides.add_slide(blank); title(s,'5. Other mediators of acute inflammation','Know their dominant action and source.'); foot(s,8)
items=[('PAF','Platelets, mast cells, basophils, neutrophils, macrophages, endothelium','Vasodilation and venular permeability at low concentration; platelet aggregation; bronchoconstriction / vasoconstriction.'),('Bradykinin','High-molecular-weight kininogen via kallikrein','Vascular permeability, vasodilation, smooth-muscle contraction and pain.'),('Nitric oxide','Endothelium, macrophages, neurons','Vasodilation; inhibits platelet aggregation and leukocyte recruitment; microbicidal in macrophages.'),('ROS / lysosomal enzymes','Activated neutrophils and macrophages','Destroy microbes but can cause endothelial and tissue injury.'),('Neuropeptides','Sensory nerves, leukocytes','Substance P: pain transmission, vasodilation and increased vascular permeability.')]
textbox(s,.65,1.18,1.5,.3,'Mediator',16,WHITE,True,PP_ALIGN.CENTER); textbox(s,2.25,1.18,3.0,.3,'Main source',16,WHITE,True,PP_ALIGN.CENTER); textbox(s,5.4,1.18,7.25,.3,'Principal actions',16,WHITE,True,PP_ALIGN.CENTER)
rect(s,.55,1.1,12.25,.48,NAVY,True,NAVY)
for i,(a,b,c) in enumerate(items):
y=1.75+i*.94; fill=PALE if i%2==0 else WHITE; rect(s,.55,y,12.25,.8,fill,True,RGBColor(225,231,237)); textbox(s,.72,y+.12,1.3,.48,a,15,[RED,ORANGE,TEAL,BLUE,RED][i],True); textbox(s,2.25,y+.09,2.9,.56,b,12,NAVY); textbox(s,5.4,y+.09,7.0,.56,c,12,NAVY)
# 9 synthesis
s=prs.slides.add_slide(blank); title(s,'Mediator-to-effect integration','The same clinical sign usually reflects several mediators.'); foot(s,9)
rows=[('Vasodilation','Histamine, PGI₂, PGE₂, nitric oxide, bradykinin'),('Increased permeability','Histamine, bradykinin, LTC₄/LTD₄/LTE₄, PAF, C3a/C5a (indirectly via histamine)'),('Chemotaxis / activation','C5a, LTB₄, CXCL8, microbial products'),('Pain','Bradykinin and PGE₂'),('Fever','IL-1, TNF, PGE₂'),('Tissue injury','ROS, lysosomal enzymes, NO, MAC')]
for i,(a,b) in enumerate(rows):
y=1.28+i*.82; node(s,.7,y,2.55,.54,a,[LIGHTBLUE,LIGHTRED,LIGHTGOLD,LIGHTTEAL,LIGHTRED,LIGHTGOLD][i],14); arrow(s,3.32,y+.27,3.78,y+.27,TEAL); rect(s,3.85,y,8.75,.54,WHITE,True,RGBColor(210,220,229)); textbox(s,4.04,y+.08,8.3,.34,b,14,NAVY)
textbox(s,.75,6.52,11.8,.26,'Exam approach: name the mediator, then state the target and action. Do not list mediators without linking them to a response.',14,RED,True,PP_ALIGN.CENTER)
# 10 recap
s=prs.slides.add_slide(blank); title(s,'Rapid recap and reference','A one-slide answer structure for exams.'); foot(s,10)
textbox(s,.72,1.23,11.9,.35,'1. Classify → 2. Source → 3. Major action → 4. Key clinical correlation',22,TEAL,True,PP_ALIGN.CENTER)
for i,(h,txt,c) in enumerate([('Preformed','Histamine; serotonin\nImmediate vascular effects',LIGHTRED),('Lipid mediators','PGs, TXA₂, LTs, lipoxins, PAF\nVessels, pain, fever, leukocytes',LIGHTGOLD),('Cytokines','TNF, IL-1, chemokines\nEndothelial and systemic responses',LIGHTBLUE),('Plasma systems','Complement, kinins, coagulation\nRecruitment, permeability, lysis',LIGHTTEAL)]):
x=.6+(i%2)*6.1; y=1.95+(i//2)*1.8; rect(s,x,y,5.65,1.4,c,True,c); textbox(s,x+.18,y+.14,5.2,.28,h,18,NAVY,True); textbox(s,x+.18,y+.5,5.2,.62,txt,15,NAVY)
textbox(s,.75,5.95,11.7,.56,'Primary textbook basis: Robbins, Cotran & Kumar Pathologic Basis of Disease, Chapter 3, “Acute Inflammation,” especially “Mediators of Inflammation,” pp. 76-82.',15,NAVY,True,PP_ALIGN.CENTER)
textbox(s,.75,6.6,11.7,.2,'Slide diagrams are original teaching schematics derived from the cited text.',11,GRAY,False,PP_ALIGN.CENTER)
prs.save(OUT)
print(OUT)
python "/tmp/workspace/acute-inflammation-mediators/src/create_deck.py"
python -c "from pptx import Presentation; p=Presentation('/tmp/workspace/acute-inflammation-mediators/output/Acute_Inflammation_Mediators_Robbins.pptx'); print('slides=',len(p.slides)); [print(i+1, ' | '.join(sh.text.replace(chr(10),' / ')[:110] for sh in s.shapes if getattr(sh,'has_text_frame',False) and sh.text.strip())[:250]) for i,s in enumerate(p.slides)]" && ls -lh "/tmp/workspace/acute-inflammation-mediators/output/Acute_Inflammation_Mediators_Robbins.pptx"
Acute Inflammation Mediators Robbins
Presentation · PPTX
Define and describe the general features of acute and chronic inflammation including stimuli, vascular and cellular events as per robkns pathology and make a ppt
acute chronic inflammation pathology
acute chronic inflammation pathology vascular cellular events overview
~/
mkdir -p "/tmp/workspace/inflammation-robins-ppt/src" "/tmp/workspace/inflammation-robins-ppt/assets" "/tmp/workspace/inflammation-robins-ppt/output" && python /tmp/skills/shared/scripts/fetch_images.py "https://cdn.orris.care/cdss_images/b00596d2095eaaf39bb53103642d38dacf4e16011acb0c2cd98a08c81353075c.png" "https://cdn.orris.care/cdss_images/HARRISON_1763031124085_f438f806-73d1-4bf8-8649-6dbd34677e5d.png" > "/tmp/workspace/inflammation-robins-ppt/assets/fetch_images.json"
~/inflammation-robins-ppt/src/create_deck.py
import os, json, base64
from io import BytesIO
from pptx import Presentation
from pptx.util import Inches, Pt
from pptx.enum.shapes import MSO_SHAPE, MSO_CONNECTOR
from pptx.enum.text import PP_ALIGN, MSO_ANCHOR
from pptx.dml.color import RGBColor
from pptx.enum.dml import MSO_THEME_COLOR
OUT='/tmp/workspace/inflammation-robins-ppt/output/Acute_and_Chronic_Inflammation_Robbins.pptx'
FETCH='/tmp/workspace/inflammation-robins-ppt/assets/fetch_images.json'
NAVY=RGBColor(18,45,69); TEAL=RGBColor(19,123,125); BLUE=RGBColor(44,106,166)
RED=RGBColor(190,67,65); ORANGE=RGBColor(225,132,44); GOLD=RGBColor(239,187,61)
GREEN=RGBColor(61,140,91); PURPLE=RGBColor(110,80,145); LIGHT=RGBColor(242,246,248)
DARK=RGBColor(36,48,58); GRAY=RGBColor(92,105,114); WHITE=RGBColor(255,255,255)
prs=Presentation(); prs.slide_width=Inches(13.333); prs.slide_height=Inches(7.5)
blank=prs.slide_layouts[6]
def rect(slide,x,y,w,h,fill, radius=False, line=None):
sh=slide.shapes.add_shape(MSO_SHAPE.ROUNDED_RECTANGLE if radius else MSO_SHAPE.RECTANGLE, Inches(x), Inches(y), Inches(w), Inches(h))
sh.fill.solid(); sh.fill.fore_color.rgb=fill
sh.line.color.rgb=line if line else fill
return sh
def text(slide,txt,x,y,w,h,size=20,color=DARK,bold=False,align=PP_ALIGN.LEFT, font='Aptos', margin=0.08):
tb=slide.shapes.add_textbox(Inches(x), Inches(y), Inches(w), Inches(h)); tf=tb.text_frame
tf.clear(); tf.word_wrap=True; tf.margin_left=tf.margin_right=Inches(margin); tf.margin_top=tf.margin_bottom=Inches(margin)
tf.vertical_anchor=MSO_ANCHOR.MIDDLE
p=tf.paragraphs[0]; p.alignment=align; r=p.add_run(); r.text=txt; r.font.name=font; r.font.size=Pt(size); r.font.bold=bold; r.font.color.rgb=color
return tb
def bullet_box(slide, title, bullets, x,y,w,h, accent=TEAL, font_size=17):
rect(slide,x,y,w,h,WHITE,True,RGBColor(215,225,230)); rect(slide,x,y,w,0.12,accent,False)
text(slide,title,x+0.18,y+0.18,w-0.36,0.38,18,accent,True)
tb=slide.shapes.add_textbox(Inches(x+0.22),Inches(y+0.68),Inches(w-0.44),Inches(h-0.82)); tf=tb.text_frame; tf.clear(); tf.word_wrap=True
tf.margin_left=tf.margin_right=Inches(0.03); tf.margin_top=Inches(0.01)
for i,b in enumerate(bullets):
p=tf.paragraphs[0] if i==0 else tf.add_paragraph(); p.text=b; p.level=0; p.font.name='Aptos'; p.font.size=Pt(font_size); p.font.color.rgb=DARK; p.space_after=Pt(7); p.bullet=True
return tb
def title(slide,main,sub,num):
rect(slide,0,0,13.333,0.16,TEAL); text(slide,main,0.52,0.34,10.8,0.56,27,NAVY,True); text(slide,sub,0.54,0.94,11.7,0.32,13,GRAY)
text(slide,str(num),12.1,0.35,0.65,0.45,21,TEAL,True,PP_ALIGN.RIGHT)
text(slide,'Robbins Pathology | Chapter 3',0.54,7.05,4,0.22,10,GRAY)
def arrow(slide,x1,y1,x2,y2,color=TEAL,width=2):
ln=slide.shapes.add_connector(MSO_CONNECTOR.STRAIGHT, Inches(x1), Inches(y1), Inches(x2), Inches(y2)); ln.line.color.rgb=color; ln.line.width=Pt(width); ln.line.end_arrowhead=True; return ln
def circle(slide, label, x,y,d, fill, fs=15):
sh=slide.shapes.add_shape(MSO_SHAPE.OVAL, Inches(x),Inches(y),Inches(d),Inches(d)); sh.fill.solid(); sh.fill.fore_color.rgb=fill; sh.line.color.rgb=WHITE
text(slide,label,x+0.04,y+0.13,d-0.08,d-0.25,fs,WHITE,True,PP_ALIGN.CENTER)
return sh
def add_image(slide, raw,x,y,w,h):
slide.shapes.add_picture(BytesIO(raw), Inches(x), Inches(y), width=Inches(w), height=Inches(h))
# assets
imgs=[]
if os.path.exists(FETCH):
data=json.load(open(FETCH))
for a in data:
if a.get('base64'): imgs.append(base64.b64decode(a['base64'].split(',',1)[-1]))
flow_img=imgs[0] if imgs else None
neut_img=imgs[1] if len(imgs)>1 else None
# 1
s=prs.slides.add_slide(blank); rect(s,0,0,13.333,7.5,NAVY); rect(s,0,0,13.333,0.18,TEAL)
text(s,'Acute and Chronic\nInflammation',0.75,1.0,7.0,1.5,36,WHITE,True)
text(s,'Definitions, stimuli, vascular and cellular events',0.78,2.75,6.8,0.45,21,RGBColor(201,224,227))
text(s,'Based on Robbins, Cotran & Kumar Pathologic Basis of Disease\nChapter 3',0.8,3.55,6.3,0.55,15,WHITE)
# title diagram
for lab,x,y,c in [('Injury',8.1,1.35,RED),('Vessels',10.55,1.35,BLUE),('Leukocytes',8.1,3.7,ORANGE),('Repair',10.55,3.7,GREEN)]: circle(s,lab,x,y,1.45,c,14)
arrow(s,9.55,2.05,10.45,2.05,WHITE); arrow(s,11.25,2.8,11.25,3.55,WHITE); arrow(s,10.45,4.43,9.6,4.43,WHITE); arrow(s,8.8,3.55,8.8,2.85,WHITE)
text(s,'Recognition → recruitment → removal → repair',7.65,5.65,4.7,0.35,15,RGBColor(201,224,227),True,PP_ALIGN.CENTER)
# 2
s=prs.slides.add_slide(blank); title(s,'Inflammation: definition and purpose','A protective response of vascularized tissues.',2)
bullet_box(s,'Robbins definition',["Response of vascularized tissues that delivers leukocytes and host-defense molecules from blood to sites of infection and cell damage.","Eliminates the cause of injury and the consequences of injury, such as necrotic cells and tissue debris.","Major participants: blood vessels, leukocytes, plasma proteins, resident sentinel cells, and chemical mediators."],0.55,1.55,6.0,4.85,TEAL,18)
# sequence
text(s,'Typical sequence',7.0,1.55,4.8,0.35,20,NAVY,True)
steps=[('1','Recognition',RED),('2','Recruitment',BLUE),('3','Removal',ORANGE),('4','Repair',GREEN)]
for i,(n,l,c) in enumerate(steps):
y=2.1+i*1.0; circle(s,n,7.05,y,0.55,c,14); text(s,l,7.78,y+0.06,3.4,0.36,18,DARK,True);
if i<3: arrow(s,7.32,y+0.58,7.32,y+0.94,GRAY,1.5)
text(s,'Regulation terminates the response once its purpose is fulfilled.',7.0,6.25,5.2,0.35,15,GRAY)
# 3 stimuli
s=prs.slides.add_slide(blank); title(s,'What initiates inflammation?','Stimuli are recognized by tissue-resident sentinel cells.',3)
items=[('Infections','Microbes and microbial toxins',RED),('Tissue necrosis','Ischemia, trauma, physical or chemical injury',ORANGE),('Foreign bodies','Splinters, sutures, crystals and deposits',PURPLE),('Immune reactions','Hypersensitivity and autoimmune responses',BLUE)]
for i,(h,b,c) in enumerate(items):
x=0.7+(i%2)*6.15; y=1.65+(i//2)*2.1
rect(s,x,y,5.55,1.55,WHITE,True,RGBColor(215,225,230)); rect(s,x,y,0.18,1.55,c); text(s,h,x+0.4,y+0.25,4.8,0.35,20,c,True); text(s,b,x+0.4,y+0.72,4.78,0.52,16,DARK)
text(s,'Sentinel cells: macrophages, dendritic cells, mast cells, epithelial cells and other tissue cells.',0.82,6.25,11.6,0.42,19,NAVY,True,PP_ALIGN.CENTER)
# 4 comparison
s=prs.slides.add_slide(blank); title(s,'Acute versus chronic inflammation','The most useful high-yield comparison.',4)
headers=['Feature','Acute inflammation','Chronic inflammation']; xs=[0.65,3.25,8.05]; ws=[2.5,4.65,4.65]
for x,w,h,c in zip(xs,ws,headers,[NAVY,RED,PURPLE]): rect(s,x,1.45,w,0.58,c,True); text(s,h,x+0.1,1.55,w-0.2,0.26,17,WHITE,True,PP_ALIGN.CENTER)
rows=[('Onset / duration','Rapid: minutes to hours; usually days','Prolonged: weeks to months'),('Predominant cells','Neutrophils','Macrophages, lymphocytes, plasma cells'),('Key changes','Vascular dilation, edema, exudation','Tissue injury plus ongoing repair'),('Outcome','Resolution, abscess, scar, or progression','Fibrosis/scarring; may persist or form granulomas')]
for r,(a,b,c) in enumerate(rows):
y=2.1+r*1.05
for x,w,t,fill in [(xs[0],ws[0],a,RGBColor(225,232,237)),(xs[1],ws[1],b,RGBColor(252,242,241)),(xs[2],ws[2],c,RGBColor(246,241,250))]:
rect(s,x,y,w,0.92,fill,False,WHITE); text(s,t,x+0.15,y+0.12,w-0.3,0.66,15,DARK, r==0 if x==xs[0] else False)
# 5 acute
s=prs.slides.add_slide(blank); title(s,'Acute inflammation: general features','Rapid response dominated by vascular change and neutrophils.',5)
bullet_box(s,'Definition',["Rapid, short-duration response to injury or infection.","Three major components: vasodilation; increased microvascular permeability; and leukocyte emigration, accumulation and activation.","The characteristic infiltrating leukocyte is the neutrophil, particularly in the first 6 to 24 hours."],0.55,1.5,5.6,4.95,RED,18)
# 3 components tiles
for i,(h,sub,c) in enumerate([('Vasodilation','↑ blood flow',RED),('Permeability','protein-rich exudate',BLUE),('Emigration','neutrophils enter tissue',ORANGE)]):
x=6.65+(i%1)*0; y=1.65+i*1.52
rect(s,x,y,5.55,1.1,RGBColor(252,247,244),True,RGBColor(244,213,203)); circle(s,str(i+1),6.9,y+0.22,0.62,c,15); text(s,h,7.75,y+0.2,2.2,0.28,18,c,True); text(s,sub,7.75,y+0.58,3.7,0.28,15,DARK)
# 6 vascular
s=prs.slides.add_slide(blank); title(s,'Acute inflammation: vascular events','A sequence that delivers plasma proteins and leukocytes to the injured tissue.',6)
# vessel sequence
stages=[('1','Vasodilation','Histamine and other mediators relax vascular smooth muscle.\n↑ flow produces heat and redness.',RED),('2','Leakage','Endothelial gaps and other mechanisms increase permeability.\nProtein-rich exudate produces edema.',BLUE),('3','Stasis','Fluid loss and vessel dilation slow blood flow.\nLeukocytes move toward endothelium.',PURPLE)]
for i,(num,h,b,c) in enumerate(stages):
x=0.6+i*4.23
rect(s,x,1.72,3.7,3.82,WHITE,True,RGBColor(215,225,230)); circle(s,num,x+1.5,1.95,0.68,c,15); text(s,h,x+0.28,2.9,3.15,0.35,20,c,True,PP_ALIGN.CENTER); text(s,b,x+0.31,3.48,3.08,1.22,15,DARK,False,PP_ALIGN.CENTER)
if i<2: arrow(s,x+3.74,3.62,x+4.1,3.62,TEAL,2)
text(s,'Exudate: extravascular fluid with high protein content, often with cellular debris. Pus is a neutrophil-rich purulent exudate.',0.72,6.08,11.9,0.6,17,NAVY,True,PP_ALIGN.CENTER)
# 7 cellular events
s=prs.slides.add_slide(blank); title(s,'Acute inflammation: cellular events','Leukocyte recruitment occurs mainly in postcapillary venules.',7)
seq=[('Margination\nand rolling','Selectins'),('Firm adhesion','Integrins bind endothelial ligands'),('Transmigration\n(diapedesis)','PECAM-1 at intercellular junctions'),('Chemotaxis','Bacterial products, C5a, LTB4, chemokines'),('Phagocytosis\nand killing','ROS, NO and lysosomal enzymes')]
for i,(h,b) in enumerate(seq):
x=0.35+i*2.62; c=[BLUE,TEAL,ORANGE,PURPLE,RED][i]
rect(s,x,1.82,2.25,1.4,WHITE,True,RGBColor(215,225,230)); circle(s,str(i+1),x+0.82,1.55,0.6,c,14); text(s,h,x+0.15,2.04,1.95,0.43,16,c,True,PP_ALIGN.CENTER); text(s,b,x+0.16,2.55,1.92,0.42,12,DARK,False,PP_ALIGN.CENTER)
if i<4: arrow(s,x+2.28,2.5,x+2.55,2.5,GRAY,1.5)
# vessel schematic
rect(s,0.75,4.25,11.8,0.9,RGBColor(230,241,248),True,BLUE); text(s,'Blood vessel lumen',0.95,4.56,2.1,0.24,14,BLUE,True)
for i in range(8): circle(s,'',3.2+i*0.72,4.45,0.36,RGBColor(212,76,76),8)
for x in [5.0,6.4,7.8]: circle(s,'PMN',x,4.38,0.5,ORANGE,8)
arrow(s,7.95,5.02,7.95,5.9,ORANGE,2); circle(s,'PMN',7.7,5.92,0.55,ORANGE,8)
text(s,'Activated endothelium expresses adhesion molecules. Chemotactic gradients guide emigrated leukocytes through tissues.',1.0,6.22,11.1,0.3,16,NAVY,True,PP_ALIGN.CENTER)
# 8 outcomes
s=prs.slides.add_slide(blank); title(s,'Acute inflammation: morphologic patterns and outcomes','The nature of injury and tissue determine the pattern and result.',8)
for i,(h,b,c) in enumerate([('Serous','Cell-poor fluid in body cavities or beneath skin.',BLUE),('Fibrinous','Fibrin-rich exudate in serous linings; may organize into scar.',GOLD),('Purulent / abscess','Pus composed of neutrophils, necrotic debris and often microbes.',ORANGE),('Ulcer','Local defect from sloughing of inflamed necrotic tissue.',RED)]):
x=0.6+(i%2)*6.15; y=1.55+(i//2)*1.85; rect(s,x,y,5.58,1.36,WHITE,True,RGBColor(215,225,230)); rect(s,x,y,0.15,1.36,c); text(s,h,x+0.35,y+0.2,4.9,0.3,18,c,True); text(s,b,x+0.35,y+0.63,4.9,0.45,15,DARK)
text(s,'Typical outcomes',0.7,5.55,2.1,0.32,20,NAVY,True)
text(s,'Complete resolution • Healing by fibrosis • Abscess formation • Progression to chronic inflammation',0.75,6.03,11.8,0.42,18,DARK,True,PP_ALIGN.CENTER)
# 9 chronic
s=prs.slides.add_slide(blank); title(s,'Chronic inflammation: definition and causes','A prolonged response in which inflammation, injury and repair coexist.',9)
bullet_box(s,'Definition',["Prolonged inflammation lasting weeks or months.","May follow unresolved acute inflammation or begin insidiously without a preceding acute phase.","Typically causes more tissue destruction and scarring than acute inflammation."],0.55,1.55,5.65,4.65,PURPLE,18)
bullet_box(s,'Major causes',["Persistent infections that are difficult to eradicate, including some mycobacteria, fungi and parasites.","Immune-mediated inflammatory diseases, including autoimmune and allergic disorders.","Prolonged exposure to potentially toxic agents, either exogenous or endogenous (for example, silica or atherosclerotic lipid deposits)."],6.65,1.55,5.65,4.65,PURPLE,17)
text(s,'Persistence of the stimulus is the unifying theme.',1.2,6.45,10.8,0.32,20,PURPLE,True,PP_ALIGN.CENTER)
# 10 features chronic
s=prs.slides.add_slide(blank); title(s,'Chronic inflammation: morphologic and cellular features','The triad is mononuclear infiltration, tissue destruction and repair.',10)
features=[('Mononuclear infiltrate','Macrophages, lymphocytes and plasma cells predominate.',BLUE),('Tissue destruction','Persistent insult and activated inflammatory cells injure tissues.',RED),('Repair and fibrosis','Angiogenesis and connective tissue deposition occur concurrently.',GREEN)]
for i,(h,b,c) in enumerate(features):
x=0.65+i*4.2; rect(s,x,1.6,3.65,3.3,WHITE,True,RGBColor(215,225,230)); circle(s,str(i+1),x+1.48,1.9,0.68,c,15); text(s,h,x+0.28,2.85,3.1,0.43,19,c,True,PP_ALIGN.CENTER); text(s,b,x+0.28,3.55,3.1,0.75,16,DARK,False,PP_ALIGN.CENTER)
text(s,'Macrophages are central effectors: they eliminate microbes and debris, produce cytokines and growth factors, and can drive both tissue injury and fibrosis.',0.82,5.55,11.7,0.68,18,NAVY,True,PP_ALIGN.CENTER)
# 11 macrophage diagram
s=prs.slides.add_slide(blank); title(s,'Macrophages and lymphocytes sustain chronic inflammation','Classical and alternative macrophage activation have different outcomes.',11)
# central
circle(s,'Macrophage',5.63,2.55,1.72,PURPLE,15)
# branches
for h,b,x,y,c in [('Classical activation','IFN-γ and microbial products\n→ microbicidal activity\n→ inflammation and tissue injury',0.75,1.65,RED),('Alternative activation','IL-4 and IL-13\n→ growth factors\n→ repair, fibrosis and remodeling',8.15,1.65,GREEN)]:
rect(s,x,y,4.3,2.45,WHITE,True,RGBColor(215,225,230)); text(s,h,x+0.25,y+0.25,3.8,0.35,19,c,True,PP_ALIGN.CENTER); text(s,b,x+0.38,y+0.85,3.5,1.1,16,DARK,False,PP_ALIGN.CENTER)
arrow(s,5.62,3.38,5.0,3.05,RED,2); arrow(s,7.36,3.38,8.12,3.05,GREEN,2)
text(s,'Lymphocytes and macrophages activate each other, creating a self-amplifying inflammatory loop.',1.4,5.35,10.5,0.45,20,NAVY,True,PP_ALIGN.CENTER)
text(s,'Granulomatous inflammation is a distinctive pattern of chronic inflammation in which activated macrophages form granulomas, often with T lymphocytes.',0.88,6.15,11.65,0.42,16,GRAY,False,PP_ALIGN.CENTER)
# 12 summary
s=prs.slides.add_slide(blank); title(s,'Exam-ready summary','How to structure a short-note answer.',12)
rect(s,0.62,1.45,12.0,0.7,NAVY,True); text(s,'Definition → stimuli → vascular events → cellular events → morphology/outcomes',0.82,1.66,11.6,0.25,20,WHITE,True,PP_ALIGN.CENTER)
for i,(h,b,c) in enumerate([('Acute','Rapid; vasodilation, leakage and neutrophil recruitment.',RED),('Chronic','Prolonged; macrophages/lymphocytes, tissue injury and fibrosis.',PURPLE)]):
y=2.7+i*1.65; rect(s,1.25,y,10.85,1.2,RGBColor(252,242,241) if i==0 else RGBColor(246,241,250),True,RGBColor(225,220,230)); text(s,h,1.55,y+0.25,2.0,0.3,22,c,True); text(s,b,3.35,y+0.26,8.0,0.35,18,DARK)
text(s,'Source: Robbins, Cotran & Kumar Pathologic Basis of Disease, Chapter 3, pp. 63-93. Content emphasized from pp. 64-85.',0.8,6.25,11.7,0.4,14,GRAY,False,PP_ALIGN.CENTER)
prs.save(OUT)
print(OUT)