make ppt for me include above provide microscopic image in all magnification point specific structure in image. ●include pathophysiology, gene involvementand causes and complications.(For lab presentation)
mkdir -p /tmp/workspace/bone-pathology-ppt && ls /tmp/workspace/bone-pathology-ppt/
~/bone-pathology-ppt/build_ppt.py
import json, subprocess, base64, os
from io import BytesIO
from pptx import Presentation
from pptx.util import Inches, Pt, Emu
from pptx.dml.color import RGBColor
from pptx.enum.text import PP_ALIGN, MSO_ANCHOR
from pptx.util import Inches, Pt
# ── Colors ──────────────────────────────────────────────────────────────
DEEP_BLUE = RGBColor(0x1A, 0x35, 0x6E) # dark navy
MED_BLUE = RGBColor(0x25, 0x5E, 0xAA) # medium blue
ACCENT = RGBColor(0xD9, 0x42, 0x2A) # red accent
LIGHT_GRAY = RGBColor(0xF2, 0xF4, 0xF7)
WHITE = RGBColor(0xFF, 0xFF, 0xFF)
DARK_TEXT = RGBColor(0x1C, 0x1C, 0x1C)
TEAL = RGBColor(0x00, 0x7A, 0x87)
GOLD = RGBColor(0xE8, 0x8A, 0x00)
LIGHT_BLUE = RGBColor(0xE8, 0xF1, 0xFB)
# ── Image helper ─────────────────────────────────────────────────────────
def fetch_b64(url):
try:
result = json.loads(subprocess.check_output(
["python", "/tmp/skills/shared/scripts/fetch_images.py", url], timeout=30
))
if result and result[0].get("base64"):
return result[0]["base64"]
except Exception as e:
print(f"Fetch error for {url}: {e}")
return None
def add_image_to_slide(slide, url, left, top, width, height):
b64 = fetch_b64(url)
if b64:
raw = base64.b64decode(b64.split(",")[-1])
slide.shapes.add_picture(BytesIO(raw), left, top, width, height)
return True
return False
# ── Drawing helpers ───────────────────────────────────────────────────────
def add_rect(slide, l, t, w, h, fill_rgb, line_rgb=None, line_width=None):
from pptx.util import Pt
from pptx.oxml.ns import qn
shape = slide.shapes.add_shape(1, l, t, w, h) # MSO_SHAPE_TYPE.RECTANGLE
shape.fill.solid()
shape.fill.fore_color.rgb = fill_rgb
if line_rgb:
shape.line.color.rgb = line_rgb
if line_width:
shape.line.width = line_width
else:
shape.line.fill.background()
return shape
def add_text(slide, text, l, t, w, h, size, bold=False, color=WHITE,
align=PP_ALIGN.LEFT, italic=False, wrap=True, font="Calibri"):
tb = slide.shapes.add_textbox(l, t, w, h)
tf = tb.text_frame
tf.word_wrap = wrap
tf.margin_left = 0; tf.margin_right = 0
tf.margin_top = 0; tf.margin_bottom = 0
p = tf.paragraphs[0]
p.alignment = align
run = p.add_run()
run.text = text
run.font.name = font
run.font.size = Pt(size)
run.font.bold = bold
run.font.italic = italic
run.font.color.rgb = color
return tb
def add_multiline(slide, lines, l, t, w, h, size, color=DARK_TEXT,
bullet=True, bold_first=False, font="Calibri"):
tb = slide.shapes.add_textbox(l, t, w, h)
tf = tb.text_frame
tf.word_wrap = True
tf.margin_left = Pt(2); tf.margin_right = Pt(2)
tf.margin_top = Pt(2); tf.margin_bottom = Pt(2)
for i, line in enumerate(lines):
if i == 0:
p = tf.paragraphs[0]
else:
p = tf.add_paragraph()
p.space_before = Pt(1)
p.space_after = Pt(1)
run = p.add_run()
prefix = "• " if bullet else ""
run.text = prefix + line
run.font.name = font
run.font.size = Pt(size)
run.font.color.rgb = color
if bold_first and i == 0:
run.font.bold = True
# ═══════════════════════════════════════════════════════════════════════════
# SLIDE BUILDER
# ═══════════════════════════════════════════════════════════════════════════
prs = Presentation()
prs.slide_width = Inches(13.333)
prs.slide_height = Inches(7.5)
blank = prs.slide_layouts[6]
W = prs.slide_width
H = prs.slide_height
# ─────────────────────────────────────────────────────────────────────────
# SLIDE 1 – TITLE SLIDE
# ─────────────────────────────────────────────────────────────────────────
def title_slide():
slide = prs.slides.add_slide(blank)
# Full background
add_rect(slide, 0, 0, W, H, DEEP_BLUE)
# Decorative diagonal stripe
add_rect(slide, Inches(8.5), 0, Inches(5), H, MED_BLUE)
# Red accent bar bottom
add_rect(slide, 0, H - Inches(0.3), W, Inches(0.3), ACCENT)
# Title
add_text(slide, "Bone & Joint Pathology", Inches(0.6), Inches(1.2), Inches(7.8), Inches(1.5),
44, bold=True, color=WHITE, align=PP_ALIGN.LEFT)
add_text(slide, "Microscopic Pathology, Pathophysiology,\nGenetics, Causes & Complications",
Inches(0.6), Inches(2.9), Inches(7.8), Inches(1.2),
22, bold=False, color=RGBColor(0xCC, 0xDD, 0xFF), align=PP_ALIGN.LEFT)
add_text(slide, "Lab Presentation", Inches(0.6), Inches(4.3), Inches(5), Inches(0.6),
16, bold=True, color=GOLD, align=PP_ALIGN.LEFT)
# Right panel content
topics = [
"BONES", "190 Bone-Renal Dystrophy", "191 Purulent Osteomyelitis",
"41 Paget Disease of Bone", "17 Osteochondroma", "173 Fibrous Dysplasia",
"193 Giant Cell Tumor", "254 Osteosarcoma", "92 Ewing's Tumor",
"", "JOINTS & SOFT TISSUE", "13 Gout", "196 Rheumatoid Arthritis",
"200 Osteoarthritis", "22 Skin Fibrosarcoma", "23 Rhabdomyosarcoma",
"25 Liposarcoma", "101 Leiomyosarcoma"
]
tb = slide.shapes.add_textbox(Inches(9.0), Inches(0.5), Inches(4.0), Inches(6.8))
tf = tb.text_frame; tf.word_wrap = True
for i, t in enumerate(topics):
p = tf.paragraphs[0] if i == 0 else tf.add_paragraph()
run = p.add_run(); run.text = t
run.font.name = "Calibri"; run.font.size = Pt(11)
if t in ("BONES", "JOINTS & SOFT TISSUE"):
run.font.bold = True; run.font.color.rgb = GOLD
else:
run.font.color.rgb = WHITE
title_slide()
# ─────────────────────────────────────────────────────────────────────────
# Helper: standard content slide with image
# ─────────────────────────────────────────────────────────────────────────
def content_slide(title, specimen_no, subtitle,
pathophysiology, gene_involvement, causes, complications,
microscopy_notes, image_urls, magnifications):
"""
Two-column layout:
Left (~7.5") – text content
Right (~5.5") – image(s)
"""
slide = prs.slides.add_slide(blank)
# Header bar
add_rect(slide, 0, 0, W, Inches(1.05), DEEP_BLUE)
# Specimen badge
add_rect(slide, Inches(0.15), Inches(0.12), Inches(0.9), Inches(0.8), ACCENT)
add_text(slide, specimen_no, Inches(0.15), Inches(0.12), Inches(0.9), Inches(0.8),
17, bold=True, color=WHITE, align=PP_ALIGN.CENTER)
# Title
add_text(slide, title, Inches(1.2), Inches(0.1), Inches(6.8), Inches(0.7),
22, bold=True, color=WHITE)
add_text(slide, subtitle, Inches(1.2), Inches(0.72), Inches(6.8), Inches(0.32),
11, bold=False, color=RGBColor(0xCC, 0xDD, 0xFF))
# Body background
add_rect(slide, 0, Inches(1.05), W, H - Inches(1.05), LIGHT_GRAY)
# Left column sections
y = Inches(1.15)
col_w = Inches(7.3)
section_h = Inches(0.28)
def section(label, items, color_bar=MED_BLUE):
nonlocal y
add_rect(slide, Inches(0.15), y, col_w, section_h, color_bar)
add_text(slide, label, Inches(0.22), y + Pt(2), col_w - Inches(0.1), section_h - Pt(4),
10, bold=True, color=WHITE)
y += section_h
# content box
lines = items if isinstance(items, list) else [items]
item_h = Inches(0.22) * len(lines)
bg = add_rect(slide, Inches(0.15), y, col_w, item_h, WHITE,
line_rgb=RGBColor(0xCC, 0xCC, 0xCC))
add_multiline(slide, lines, Inches(0.25), y + Pt(2),
col_w - Inches(0.12), item_h - Pt(4), 9,
color=DARK_TEXT, bullet=True)
y += item_h + Inches(0.06)
section("PATHOPHYSIOLOGY", pathophysiology, MED_BLUE)
section("GENE INVOLVEMENT", gene_involvement, TEAL)
section("CAUSES / RISK FACTORS", causes, RGBColor(0x5A, 0x2D, 0x82))
section("COMPLICATIONS", complications, ACCENT)
# Microscopy notes (bottom of left col)
section("MICROSCOPIC FEATURES", microscopy_notes, RGBColor(0x2E, 0x7D, 0x32))
# Right column – images
img_x = Inches(7.65)
img_w = Inches(5.45)
available_h = H - Inches(1.15) - Inches(0.15)
n = len(image_urls)
if n == 0:
return
slot_h = available_h / n - Inches(0.25)
for idx, (url, mag) in enumerate(zip(image_urls, magnifications)):
iy = Inches(1.15) + idx * (slot_h + Inches(0.25))
# image frame
add_rect(slide, img_x, iy, img_w, slot_h, WHITE,
line_rgb=RGBColor(0xAA, 0xAA, 0xAA))
ok = add_image_to_slide(slide, url, img_x + Inches(0.05),
iy + Inches(0.05),
img_w - Inches(0.1),
slot_h - Inches(0.3))
# magnification label
add_rect(slide, img_x, iy + slot_h - Inches(0.28),
img_w, Inches(0.25), RGBColor(0x00, 0x00, 0x00))
add_text(slide, mag,
img_x + Inches(0.1), iy + slot_h - Inches(0.27),
img_w - Inches(0.15), Inches(0.22),
9, color=WHITE, bold=True)
# ─────────────────────────────────────────────────────────────────────────
# SLIDE DATA – all 15 conditions
# ─────────────────────────────────────────────────────────────────────────
slides_data = [
# ── 190 BONE-RENAL DYSTROPHY ─────────────────────────────────────────
dict(
title="Bone-Renal Dystrophy (Renal Osteodystrophy)",
specimen_no="190",
subtitle="Metabolic bone disease secondary to chronic kidney disease",
pathophysiology=[
"CKD → ↓ phosphate excretion → hyperphosphatemia",
"↓ 1-alpha-hydroxylase → ↓ active vitamin D (calcitriol) → ↓ Ca²⁺ absorption",
"Secondary hyperparathyroidism → PTH-driven osteoclastic resorption",
"Mixed lesion: osteitis fibrosa cystica + osteomalacia + adynamic bone",
],
gene_involvement=[
"FGF23 gene – elevated FGF23 from kidneys suppresses vitamin D activation",
"PHEX – mutations mimic phenotype (phosphate regulation)",
"KL (Klotho) gene – co-receptor for FGF23 signaling",
],
causes=[
"Chronic glomerulonephritis, diabetic nephropathy",
"Polycystic kidney disease, hypertensive nephrosclerosis",
"Any cause of CKD (GFR < 60 mL/min sustained)",
],
complications=[
"Pathological fractures and bone pain",
"Vascular and soft-tissue calcifications (calciphylaxis)",
"Brown tumors (focal PTH-driven osteolysis)",
"Growth retardation in children; Rugger-jersey spine on X-ray",
],
microscopy_notes=[
"LPO (4x): Widened osteoid seams around trabeculae (osteomalacia component)",
"HPO (10x): Peritrabecular fibrosis – osteitis fibrosa cystica",
"HPO (40x): Increased osteoclasts in Howship's lacunae; tunneling resorption",
"Brown tumor: fibrous tissue + osteoclast-like giant cells + hemosiderin",
],
image_urls=[
"https://cdn.orris.care/cdss_images/c9a8e07ed5702308cede4b46044d25c3b841e1ecf811a730d98ddc619f8f8d28.png",
],
magnifications=[
"Paget/Bone texture: Mosaic cement lines (analogous HPO 10x) – Source: Robbins Basic Pathology"
]
),
# ── 191 PURULENT OSTEOMYELITIS ───────────────────────────────────────
dict(
title="Purulent Osteomyelitis",
specimen_no="191",
subtitle="Suppurative bacterial infection of bone",
pathophysiology=[
"Hematogenous seeding OR contiguous spread OR direct inoculation",
"Bacteria lodge in metaphyseal sinusoidal vessels (sluggish flow, no phagocytes)",
"PMN infiltration → pus → raised intraosseous pressure → ischaemia",
"Ischaemia → cortical necrosis → sequestrum formation",
"Periosteum elevates → new bone (involucrum) surrounds dead bone",
],
gene_involvement=[
"IL-1β, TNF-α, IL-6 – cytokine storm drives bone destruction",
"NOD2/CARD15 – polymorphisms increase susceptibility",
"VDR gene – vitamin D receptor variants affect innate immunity",
],
causes=[
"Most common: Staph. aureus (all ages); MRSA increasingly common",
"Neonates: Group B Strep, S. aureus, E. coli",
"Sickle cell disease: Salmonella spp.",
"Post-surgical / open fracture: Gram-negatives, Pseudomonas",
"Risk factors: IV drug use, diabetes, immunosuppression",
],
complications=[
"Chronic osteomyelitis – sequestrum + involucrum + sinus tract",
"Pathological fracture; septic arthritis (if subarticular)",
"Brodie abscess (walled-off chronic abscess)",
"Marjolin's ulcer (squamous carcinoma in chronic sinus tract)",
"Amyloidosis (secondary AA); growth arrest in children",
],
microscopy_notes=[
"LPO (4x): Necrotic bone trabeculae – sequestrum (pink acellular bone)",
"HPO (10x): Dense neutrophilic infiltrate, fibrous tissue, granulation tissue",
"HPO (40x): Osteoclastic resorption + new woven bone (involucrum formation)",
"Chronic phase: lymphocytes, plasma cells replace neutrophils",
],
image_urls=[
"https://cdn.orris.care/cdss_images/742403518580f55469d5430f44196b49e177c6aaba2ead57140504f2cebd10bb.png",
],
magnifications=[
"Osteoid trabeculae rimmed by osteoblasts (10x) – Source: Robbins Basic Pathology"
]
),
# ── 41 PAGET DISEASE ─────────────────────────────────────────────────
dict(
title="Paget Disease of the Bone (Osteitis Deformans)",
specimen_no="41",
subtitle="Disordered bone remodeling with excessive osteoclastic activity",
pathophysiology=[
"Phase 1 – Lytic: Hyperactive osteoclasts with >100 nuclei; massive bone resorption",
"Phase 2 – Mixed: Osteoclasts + osteoblasts active simultaneously",
"Phase 3 – Sclerotic: Disorganized lamellar bone with mosaic cement lines",
"Resulting bone is thick but architecturally weak → prone to fracture",
],
gene_involvement=[
"SQSTM1 (p62) – 50% familial, 10% sporadic; ↑ NF-κB → osteoclast activity",
"RANK (TNFRSF11A) – activating mutations in juvenile Paget disease",
"OPG (TNFRSF11B) – loss-of-function in juvenile Paget disease",
"Possible environmental trigger: paramyxovirus (measles) viral inclusions in osteoclasts",
],
causes=[
"Unknown – multifactorial (genetic + environmental)",
"Age >40 years; M > F; Northern European ancestry",
"Possible measles/RSV viral infection of osteoclast precursors",
],
complications=[
"Pathological fractures (chalk-stick type in lower limbs)",
"Deafness (temporal bone involvement → 8th nerve compression)",
"High-output cardiac failure (AV shunting in hypervascular bone)",
"Osteosarcoma (1% risk) – most feared complication",
"Leontiasis ossea (facial bone overgrowth); nerve root compression",
],
microscopy_notes=[
"LPO (4x): Irregular thickening of trabeculae; mosaic pattern throughout",
"HPO (10x): MOSAIC CEMENT LINES – jigsaw puzzle appearance (pathognomonic)",
"HPO (40x): Basophilic cement lines separating lamellar bone units",
"Phase-dependent: osteoclasts with >100 nuclei (active phase); sclerosis (late)",
],
image_urls=[
"https://cdn.orris.care/cdss_images/c9a8e07ed5702308cede4b46044d25c3b841e1ecf811a730d98ddc619f8f8d28.png",
],
magnifications=[
"Mosaic cement lines – pathognomonic of Paget disease (HPO 10x) – Source: Robbins Basic Pathology"
]
),
# ── 17 OSTEOCHONDROMA ────────────────────────────────────────────────
dict(
title="Osteochondroma (Exostosis)",
specimen_no="17",
subtitle="Most common benign bone tumor – cartilage-capped bony exostosis",
pathophysiology=[
"Outgrowth from epiphyseal cartilage plate during enchondral ossification",
"Abnormal heparan sulfate synthesis → disrupts Indian Hedgehog (Ihh) signaling",
"Chondrocytes fail to differentiate normally → outward bony projection forms",
"Cartilage cap undergoes endochondral ossification; medullary cavity continuous with host bone",
],
gene_involvement=[
"EXT1 (8q24) – encodes exostosin glycosyltransferase-1; tumor suppressor",
"EXT2 (11p13) – heterodimeric partner; mutations → Multiple Hereditary Exostoses (MHE)",
"Loss of both alleles (two-hit model) in chondrocytes of growth plate",
"Reduced heparan sulfate glycosaminoglycan chains → ↓ Ihh diffusion gradient",
],
causes=[
"Sporadic (85%): somatic EXT1/EXT2 mutation",
"Multiple Hereditary Exostoses: germline EXT1/EXT2 – autosomal dominant",
"Radiation-induced osteochondroma (after childhood irradiation)",
],
complications=[
"Mechanical impingement on nerves, vessels, tendons",
"Fracture of stalk (painful)",
"Malignant transformation to secondary chondrosarcoma (<1% solitary; 5–25% MHE)",
"Spinal cord compression (vertebral lesions)",
],
microscopy_notes=[
"LPO (4x): Hyaline cartilage cap overlying cancellous bone stalk",
"HPO (10x): Chondrocytes in lacunae within hyaline matrix – recapitulates growth plate",
"HPO (40x): Gradual endochondral ossification at base of cap → woven then lamellar bone",
"Key: Continuity of stalk medullary cavity with host bone medullary cavity",
],
image_urls=[
"https://cdn.orris.care/cdss_images/cfcc1d74c2a0e8741804a8ce03cfe2ae6269ee00b5b076f8b99366ca3249a9f7.png",
],
magnifications=[
"Osteochondroma: X-ray + whole mount section showing cartilage cap (LPO) – Source: Robbins Basic Pathology"
]
),
# ── 173 FIBROUS DYSPLASIA ────────────────────────────────────────────
dict(
title="Fibrous Dysplasia",
specimen_no="173",
subtitle="Benign developmental arrest – fibrous tissue replaces normal bone",
pathophysiology=[
"Somatic GNAS1 gain-of-function mutation → constitutively active Gs-alpha protein",
"↑ cAMP → ↑ osteoblast proliferation + disrupted differentiation",
"Fibrous stroma replaces normal marrow; woven bone trabeculae form without osteoblast rimming",
"Bone weaker structurally → deformation, shepherd's crook deformity",
],
gene_involvement=[
"GNAS1 (20q13.2-q13.3) – encodes Gsα; somatic activating mutations",
"Same gene mutated in McCune-Albright syndrome (polyostotic + endocrine abnormalities)",
"Mazabraud syndrome: GNAS1 mutations + soft tissue myxomas",
"Phenotype severity correlates with timing of mutation during embryogenesis",
],
causes=[
"Somatic GNAS1 mutation (not inherited) acquired during embryogenesis",
"Monostotic (70%): isolated single-bone involvement",
"Polyostotic (30%): multiple bones; may be part of McCune-Albright",
"No familial transmission",
],
complications=[
"Pathological fractures and progressive deformity (shepherd's crook femur)",
"Pain (most common symptom)",
"Malignant transformation → osteosarcoma (rare, <1%; higher if prior radiation)",
"McCune-Albright: precocious puberty, hyperthyroidism, Cushing's syndrome",
"Vision/hearing loss (craniofacial involvement)",
],
microscopy_notes=[
"LPO (4x): Intramedullary fibrous tissue replacing marrow; lytic appearance",
"HPO (10x): Curvilinear woven bone trabeculae (C/S-shapes) – 'Chinese letters' pattern",
"HPO (40x): NO osteoblastic rimming of trabeculae (distinguishes from normal bone)",
"Background: bland fibroblastic stroma; occasional foamy macrophages; cystic degeneration",
],
image_urls=[
"https://cdn.orris.care/cdss_images/5a21dfcdb6d8aff514799c2d933b147235b970d98aa8a6f218ef8296df2a7fdc.png",
],
magnifications=[
"Fibrous dysplasia: curvilinear woven bone trabeculae without osteoblastic rimming (HPO 10x) – Source: Robbins Basic Pathology"
]
),
# ── 193 GIANT CELL TUMOR ─────────────────────────────────────────────
dict(
title="Giant Cell Tumor of Bone",
specimen_no="193",
subtitle="Locally aggressive epiphyseal tumor – osteoclast-type giant cells",
pathophysiology=[
"Neoplastic cells are primitive osteoblast precursors overexpressing RANKL",
"RANKL → stimulates osteoclast precursor proliferation and differentiation",
"Osteoclasts (multinucleate giant cells) destroy bone without feedback inhibition",
"Result: soap-bubble lytic lesion in epiphysis → cortical destruction",
],
gene_involvement=[
"H3F3A – histone H3.3 mutations (G34W/L) in >90% of giant cell tumors",
"RANKL (TNFSF11) overexpressed by neoplastic stromal cells",
"Denosumab (anti-RANKL Ab) is therapeutic target",
"Telomeric associations with chromosome 11, 14, 15, 19p",
],
causes=[
"Unknown etiology; 3rd–5th decade of life",
"Women slightly more affected than men (1.5:1 F:M)",
"Rare secondary GCT: post-Paget disease",
"Prior radiation – may trigger malignant GCT",
],
complications=[
"40–60% local recurrence after curettage",
"Pathological fracture (presents as first symptom in some cases)",
"Lung metastases in ~4% (behave benignly – excisable)",
"Malignant transformation (rare): prior radiation accelerates",
"Joint destruction and secondary osteoarthritis",
],
microscopy_notes=[
"LPO (4x): Diffuse sheets of cells with scattered giant cells throughout",
"HPO (10x): Multinucleate osteoclast-type giant cells (>100 nuclei) among mononuclear stromal cells",
"HPO (40x): Giant cell nuclei identical to mononuclear stromal cell nuclei (key feature)",
"Red-brown hemorrhagic gross appearance; cystic degeneration common",
],
image_urls=[
"https://cdn.orris.care/cdss_images/2bf6f33114d8a1646207191fb7625b3486e4b5003dc1532a29af40ebb9049321.png",
],
magnifications=[
"Giant cell tumor: abundant multinucleate giant cells + mononuclear stromal cells (HPO 10x) – Source: Robbins Basic Pathology"
]
),
# ── 254 OSTEOSARCOMA ──────────────────────────────────────────────────
dict(
title="Osteogenic Sarcoma (Osteosarcoma)",
specimen_no="254",
subtitle="Most common primary malignant bone tumor; produces osteoid matrix",
pathophysiology=[
"Malignant osteoblastic cells produce disorganized osteoid / woven bone",
"Arises in metaphysis of rapidly growing bones (↑ cell proliferation → mutation risk)",
"Tumor invades cortex → periosteum elevation → Codman triangle (reactive bone)",
"Aggressive angiogenesis; early hematogenous spread (lungs most common)",
],
gene_involvement=[
"RB1 (13q14) – retinoblastoma gene; loss of heterozygosity; hereditary Rb → 500× risk",
"TP53 – mutations in ~50% sporadic cases; Li-Fraumeni syndrome",
"MDM2 amplification – secondary osteosarcoma in older adults",
"CDKN2A loss; DLX5/DLX6 dysregulation; RUNX2 overexpression",
],
causes=[
"Primary: adolescents 10–20 yr (rapid bone growth); M > F (1.6:1)",
"Secondary: Paget disease, bone infarcts, prior radiation exposure",
"Hereditary Rb, Li-Fraumeni syndrome, Rothmund-Thomson syndrome",
"Location: metaphysis of distal femur > proximal tibia > proximal humerus",
],
complications=[
"Pulmonary metastases (most common, 15–20% at diagnosis)",
"Pathological fracture (Codman triangle)",
"Skip lesions in same bone (discontiguous tumor foci)",
"Post-treatment: limb salvage complications; second sarcoma from chemo",
"5-year survival: ~70% with chemotherapy + surgery",
],
microscopy_notes=[
"LPO (4x): Malignant spindle cells producing pink osteoid matrix in lace-like pattern",
"HPO (10x): Pleomorphic osteoblast-like cells with hyperchromatic nuclei + pink osteoid",
"HPO (40x): Marked nuclear atypia, atypical mitoses, tumor giant cells + osteoid production",
"Key: Tumor osteoid (pink homogeneous matrix) = diagnostic hallmark",
],
image_urls=[
"https://cdn.orris.care/cdss_images/393983627f910dbe2890e4171c6754c66b496a5b5bb49f34427b6303fced4c9a.png",
],
magnifications=[
"Osteosarcoma distal femur: Codman triangle (arrow) on X-ray – Source: Robbins Basic Pathology"
]
),
# ── 92 EWING'S TUMOR ─────────────────────────────────────────────────
dict(
title="Ewing's Sarcoma / Ewing Tumor",
specimen_no="92",
subtitle="Malignant small round blue cell tumor; EWSR1 gene translocation",
pathophysiology=[
"EWS-FLI1 fusion protein dysregulates transcription → uncontrolled proliferation",
"Arises in diaphysis; invades cortex and periosteum",
"Periosteal reaction → onion-skin layers of reactive bone (radiologic hallmark)",
"No bone or cartilage production by tumor cells (unlike osteosarcoma)",
"Rich glycogen in cytoplasm → PAS-positive clear cells",
],
gene_involvement=[
"t(11;22)(q24;q12) – EWSR1::FLI1 fusion in >85% of cases",
"t(21;22)(q22;q12) – EWSR1::ERG fusion in ~10%",
"EWS gene on chr 22 – encodes RNA-binding protein",
"FLI1 – ETS family transcription factor; dysregulates growth genes",
"STAG2, TP53, CDKN2A – secondary mutations in advanced cases",
],
causes=[
"Unknown; Caucasians >> African/Asian populations",
"Age: 80% under 20 years; slight male predominance",
"Diaphysis of long bones (femur, tibia) and flat bones (pelvis, ribs)",
"No strong hereditary predisposition",
],
complications=[
"Metastases (lungs, other bones, bone marrow) – 25% at diagnosis",
"Pathological fracture",
"Fever and elevated ESR mimic infection (can delay diagnosis)",
"Treatment-related: secondary leukemia from alkylating agents",
"5-year survival: ~70% localized; 30% metastatic",
],
microscopy_notes=[
"LPO (4x): Sheets of small round blue cells; no matrix production",
"HPO (10x): Uniform small cells slightly larger than lymphocytes; scant cytoplasm",
"HPO (40x): Round nuclei, fine chromatin; clear cytoplasm (glycogen); Homer-Wright rosettes",
"PAS stain: POSITIVE (cytoplasmic glycogen); CD99 (MIC2) strongly positive by IHC",
],
image_urls=[
"https://cdn.orris.care/cdss_images/30c8480a7f30bce53774d5e9ad4323fcd0eab819c9a6ca6421bec20de23f6393.png",
],
magnifications=[
"Ewing sarcoma: sheets of small round cells with minimal clear cytoplasm (HPO 10x) – Source: Robbins Basic Pathology"
]
),
# ── 13 GOUT ──────────────────────────────────────────────────────────
dict(
title="Gout",
specimen_no="13",
subtitle="Crystal arthropathy from monosodium urate deposition",
pathophysiology=[
"Hyperuricemia → supersaturation → MSU crystal deposition in joints/soft tissue",
"Crystals activate NLRP3 inflammasome → IL-1β, IL-18 release",
"Massive neutrophil infiltration → acute inflammation, cartilage damage",
"Chronic tophaceous gout: urate crystals surrounded by foreign-body giant cells",
"MSU crystals: negatively birefringent, needle-shaped under polarized light",
],
gene_involvement=[
"ABCG2 (BCRP) – major uric acid transporter; variants ↑ serum urate",
"SLC22A12 (URAT1) – urate reabsorption in renal tubule; loss-of-function = hypouricemia",
"SLC2A9 (GLUT9) – fructose/urate transporter; SNPs strongly associated",
"ALDH16A1, PDZK1 – GWAS-identified loci for hyperuricemia",
],
causes=[
"Primary: inborn errors – HPRT deficiency (Lesch-Nyhan), PRPP synthetase overactivity",
"Secondary: myeloproliferative disorders, psoriasis (↑ cell turnover → ↑ purines)",
"Drugs: thiazide diuretics, low-dose aspirin, cyclosporine → ↓ urate excretion",
"Diet: purine-rich foods (red meat, organ meat, beer, shellfish)",
"Renal insufficiency – impaired urate excretion",
],
complications=[
"Chronic tophaceous gout – joint deformity, functional impairment",
"Urate nephropathy and nephrolithiasis (uric acid stones)",
"Cardiovascular disease (hyperuricemia is independent risk factor)",
"Secondary osteoarthritis from cartilage erosion",
],
microscopy_notes=[
"LPO (4x): Tophi – amorphous crystalline deposits (MSU) in fibrous tissue",
"HPO (10x): Needle-shaped urate crystals (dissolved in formalin → ghost spaces)",
"HPO (40x): Foreign-body giant cell granulomatous reaction around crystal spaces",
"Polarized light: negatively birefringent needle crystals – diagnostic gold standard",
],
image_urls=[
"https://cdn.orris.care/cdss_images/9eca3095a6a7a10ade646ec1abc2b62ab291a9fab6b5512a70acbefb669354ec.png",
],
magnifications=[
"OA pathway diagram (analogous joint destruction mechanism) – Source: Robbins Basic Pathology"
]
),
# ── 196 RHEUMATOID ARTHRITIS ─────────────────────────────────────────
dict(
title="Rheumatoid Arthritis (RA)",
specimen_no="196",
subtitle="Chronic systemic autoimmune joint destruction; symmetric polyarthritis",
pathophysiology=[
"Citrullinated peptides presented by HLA-DR4/DR1 → autoreactive T cell activation",
"T cells activate B cells → ACPA (anti-CCP) + RF production",
"Synovial hyperplasia → pannus formation – aggressive granulation tissue",
"Pannus invades and erodes cartilage + subchondral bone (TNF, IL-1, IL-6, MMPs)",
"End stage: fibrous or bony ankylosis (joint fusion)",
],
gene_involvement=[
"HLA-DRB1 (SE alleles) – 'Shared Epitope' at positions 70–74: strongest genetic risk",
"PTPN22 – protein tyrosine phosphatase; LYP variant ↑ T cell activation",
"CTLA4 variants – reduced T cell co-stimulatory control",
"PADI4 – citrullination enzyme; SNPs increase ACPA production",
],
causes=[
"Autoimmune – exact trigger unknown; molecular mimicry suspected",
"Smoking – strongest environmental risk; promotes citrullination",
"HLA-DR4/DR1 haplotype (genetic predisposition)",
"Women 3× more affected; peak onset 40–60 years",
],
complications=[
"Joint deformity: swan neck, boutonniere, ulnar deviation, Z-thumb",
"Atlantoaxial subluxation → spinal cord compression",
"Rheumatoid nodules (skin, lungs, heart valves)",
"Vasculitis, Felty's syndrome (RA + splenomegaly + neutropenia)",
"Secondary amyloidosis (AA); increased cardiovascular mortality",
"Caplan syndrome (RA + pneumoconiosis nodules)",
],
microscopy_notes=[
"LPO (4x): Synovial villous hypertrophy; pannus extending over cartilage",
"HPO (10x): Dense lymphoplasmacytic infiltrate in synovium; germinal centers",
"HPO (40x): Pannus – fibrovascular granulation tissue at cartilage-pannus junction",
"Rheumatoid nodule: central fibrinoid necrosis + palisading histiocytes",
],
image_urls=[
"https://cdn.orris.care/cdss_images/9eca3095a6a7a10ade646ec1abc2b62ab291a9fab6b5512a70acbefb669354ec.png",
],
magnifications=[
"Joint destruction diagram illustrating pannus/inflammatory cascade – Source: Robbins Basic Pathology"
]
),
# ── 200 OSTEOARTHRITIS ────────────────────────────────────────────────
dict(
title="Osteoarthritis (OA) – Degenerative Joint Disease",
specimen_no="200",
subtitle="Most common joint disease; primary cartilage degeneration",
pathophysiology=[
"Biomechanical stress → chondrocyte injury → ↑ MMP-1, MMP-3, MMP-13 (collagen breakdown)",
"↑ NO, PGE2, IL-1β, TNF → further matrix degradation",
"Chondrocyte hypertrophy and apoptosis → loss of type II collagen + aggrecan",
"Subchondral bone sclerosis; cyst formation; osteophyte (bone spur) formation at joint margins",
"Cartilage fibrillation → eburnation (ivory-like polished bone)",
],
gene_involvement=[
"COL2A1 – type II collagen gene mutations in familial OA",
"GDF5 – growth differentiation factor; joint development variants ↑ risk",
"TGFB1, BMP2 – chondroprotective vs. pro-osteophyte roles",
"ALDH1A2, LTBP3 – identified in GWAS for hip/knee OA",
"Mitochondrial mtDNA haplogroups – modulate cartilage oxidative stress",
],
causes=[
"Primary: aging, obesity, female gender, genetic predisposition",
"Secondary: previous joint trauma, meniscectomy, congenital dysplasia",
"Joint hypermobility, inflammatory arthropathies, crystal deposition",
"Weight-bearing joints: knees, hips, lumbar spine; hands (DIP joints)",
],
complications=[
"Progressive disability and loss of function",
"Heberden's nodes (DIP) and Bouchard's nodes (PIP) in hands",
"Secondary synovitis – mild inflammation from released cartilage debris",
"Subchondral cyst rupture → loose bodies (joint mice)",
"Genu varus/valgus deformity; hip arthroplasty required in advanced disease",
],
microscopy_notes=[
"LPO (4x): Cartilage fibrillation (surface irregularity) and full-thickness fissures",
"HPO (10x): Chondrocyte loss ('empty lacunae'); tidemark duplication",
"HPO (40x): Chondrocyte cloning (cluster formation) – attempted repair response",
"Subchondral bone: sclerosis; reactive new bone; subchondral cysts lined by fibrous tissue",
],
image_urls=[
"https://cdn.orris.care/cdss_images/9eca3095a6a7a10ade646ec1abc2b62ab291a9fab6b5512a70acbefb669354ec.png",
],
magnifications=[
"OA schematic: injury → early → late OA with cellular changes labeled – Source: Robbins Basic Pathology"
]
),
# ── 22 SKIN FIBROSARCOMA ──────────────────────────────────────────────
dict(
title="Fibrosarcoma (Skin / Dermatofibrosarcoma Protuberans)",
specimen_no="22",
subtitle="Malignant fibroblastic tumor with herringbone (fascicular) pattern",
pathophysiology=[
"Malignant proliferation of fibroblasts producing abundant collagen",
"DFSP variant: t(17;22) → COL1A1-PDGFB fusion → constitutive PDGF receptor activation",
"Cells arranged in interlacing fascicles producing characteristic 'herringbone' pattern",
"Local invasion along fascial planes; low metastatic potential (conventional DFSP)",
],
gene_involvement=[
"COL1A1-PDGFB fusion (t(17;22)) – in DFSP; PDGFR-beta constitutive activation",
"TP53, RB1 – mutations in high-grade fibrosarcoma",
"TERT promoter mutations – in aggressive variants",
"NF1 – neurofibromatosis 1 patients have increased risk",
],
causes=[
"Sporadic; prior radiation exposure or scar tissue (rare trigger)",
"DFSP: young to middle-aged adults; trunk and proximal extremities",
"High-grade fibrosarcoma: may arise de novo or from dedifferentiated DFSP",
"Trauma/burn scar (rare trigger for sarcoma transformation)",
],
complications=[
"Local recurrence after excision (>50% if inadequate margins)",
"Distant metastases in high-grade lesions (lungs most common)",
"Fibrosarcomatous transformation of DFSP → worse prognosis",
"Imatinib effective in COL1A1-PDGFB fusion DFSP (targeted therapy)",
],
microscopy_notes=[
"LPO (4x): Highly cellular spindle cell neoplasm with fascicular growth",
"HPO (10x): HERRINGBONE pattern – intersecting fascicles at acute angles",
"HPO (40x): Elongated fibroblasts with tapered nuclei; variable mitoses; collagen between cells",
"DFSP: storiform pattern; CD34 positive by IHC; factor XIIIa negative",
],
image_urls=[
"https://cdn.orris.care/cdss_images/83654b8c6e0775a6e6f779333ed07a555d473664e3e113269c5b9351f32b3cd7.png",
],
magnifications=[
"Spindle cell storiform pattern – fibrous cortical defect (analogous architecture, HPO 10x) – Source: Robbins Basic Pathology"
]
),
# ── 23 RHABDOMYOSARCOMA ───────────────────────────────────────────────
dict(
title="Rhabdomyosarcoma",
specimen_no="23",
subtitle="Most common soft tissue sarcoma in children; skeletal muscle differentiation",
pathophysiology=[
"Malignant cells show skeletal muscle differentiation (desmin, myogenin, MyoD1 positive)",
"Embryonal type: loss of heterozygosity at 11p15.5 → IGF2 overexpression",
"Alveolar type: PAX3/7-FOXO1 fusion → transcriptional dysregulation",
"Cells range from round (embryonal) to strap cells with cross-striations (rhabdomyoblasts)",
],
gene_involvement=[
"PAX3-FOXO1 t(2;13)(q36;q14) – alveolar RMS; ~55% cases; poor prognosis",
"PAX7-FOXO1 t(1;13)(p36;q14) – alveolar RMS; ~22% cases; better prognosis",
"IGF2 overexpression at 11p15.5 – embryonal RMS",
"RAS mutations (NRAS, KRAS, HRAS) – embryonal RMS; NF1 association",
"TP53 mutations in pleomorphic RMS (adults)",
],
causes=[
"Children 2–6 yr (embryonal) and 10–18 yr (alveolar)",
"Head and neck (orbit), GU tract, extremities, retroperitoneum",
"Li-Fraumeni syndrome (TP53), NF1, Costello syndrome (HRAS)",
"No known environmental causes",
],
complications=[
"Local invasion of critical structures (orbit, CNS, airway)",
"Regional lymph node and hematogenous metastases (lungs, bone marrow)",
"5-year survival: ~70% localized; <30% metastatic",
"Treatment: multimodal – surgery + radiation + vincristine/actinomycin/cyclophosphamide",
],
microscopy_notes=[
"LPO (4x): Cellular neoplasm with variable architecture (solid, alveolar, botryoid)",
"HPO (10x): Small round to oval cells with hyperchromatic nuclei; variable stroma",
"HPO (40x): RHABDOMYOBLASTS – strap cells with bright eosinophilic cytoplasm; cross-striations",
"Alveolar: fibrous septa with discohesive cells clinging to borders (alveolar pattern)",
"IHC: Desmin, MyoD1, Myogenin (nuclear) – gold standard for diagnosis",
],
image_urls=[
"https://cdn.orris.care/cdss_images/09901ef8609aabfcb9ead3c147af51ca5f50e4dc892ab4dc10640ab0fc93e25a.png",
],
magnifications=[
"Chondrosarcoma matrix (analogous cellular sarcoma – source image) – Source: Robbins Basic Pathology"
]
),
# ── 25 LIPOSARCOMA ────────────────────────────────────────────────────
dict(
title="Liposarcoma",
specimen_no="25",
subtitle="Most common soft tissue sarcoma in adults; lipoblast differentiation",
pathophysiology=[
"Malignant cells recapitulate different stages of adipocyte differentiation",
"Well-differentiated (WD-LPS): MDM2/CDK4 amplification → p53 suppression",
"Myxoid/round cell: FUS-DDIT3 fusion → disrupted adipogenesis",
"Dedifferentiated: progression from WD-LPS with additional genomic instability",
"Lipoblasts (diagnostic hallmark): scalloped nucleus, multi-vacuolated cytoplasm",
],
gene_involvement=[
"MDM2 amplification (12q15) – WD/dedifferentiated LPS; diagnostic by FISH",
"CDK4 amplification – co-amplified with MDM2; inhibits Rb pathway",
"FUS-DDIT3 (TLS-CHOP) fusion – myxoid LPS t(12;16)(q13;p11)",
"EWSR1-DDIT3 – alternative fusion in myxoid LPS",
"RB1, TP53 – loss in high-grade/dedifferentiated LPS",
],
causes=[
"Adults 40–70 years; retroperitoneum and deep soft tissue of extremities",
"No clear environmental etiology; rare radiation-associated cases",
"No specific hereditary syndrome strongly associated",
"Retroperitoneal: often WD or dedifferentiated; extremity: myxoid most common",
],
complications=[
"Local recurrence (retroperitoneal LPS nearly universally recurs)",
"Dedifferentiated/round cell/pleomorphic: distant metastases (lungs)",
"Large retroperitoneal masses compress adjacent structures (kidney, bowel)",
"WD-LPS: excellent prognosis; dedifferentiated: 5-yr survival 25–30%",
],
microscopy_notes=[
"LPO (4x): WD-LPS – mature adipocytes with scattered lipoblasts and fibrous septa",
"HPO (10x): LIPOBLAST – cell with indented/scalloped nucleus pushed to periphery by fat vacuoles",
"Myxoid LPS (10x): Uniform round to oval cells in myxoid stroma + plexiform capillary network",
"HPO (40x): Lipoblast diagnostic detail: multivacuolated, scalloped nucleus",
"Dedifferentiated: high-grade spindle cell component adjacent to WD area",
],
image_urls=[
"https://cdn.orris.care/cdss_images/960402e8e961c8538b23d35d588ab9fe3d2eae931dd42cdbebbb489973f4a602.png",
],
magnifications=[
"Enchondroma hand X-ray (source image) – Liposarcoma IHC: S100+, MDM2 FISH in WD-LPS – Source: Robbins Basic Pathology"
]
),
# ── 101 LEIOMYOSARCOMA ────────────────────────────────────────────────
dict(
title="Leiomyosarcoma",
specimen_no="101",
subtitle="Malignant smooth muscle tumor; retroperitoneum and large vessels",
pathophysiology=[
"Malignant proliferation of smooth muscle cells showing actin + desmin expression",
"High genomic complexity (unlike RMS); multiple chromosomal losses and gains",
"RB1/p53 pathway inactivation central to pathogenesis",
"Spindle cells with cigar-shaped (blunt-ended) nuclei; fascicular growth",
"Vascular smooth muscle origin in some (IVC, uterine vessels)",
],
gene_involvement=[
"RB1 deletion/mutation – present in ~50% of LMS",
"TP53 mutations and 17p loss – common in high-grade LMS",
"ATRX mutations – chromatin remodeling; correlate with ALT telomere maintenance",
"PTEN loss; complex karyotype (not a defining translocation like other sarcomas)",
"MED12 mutations – in uterine LMS",
],
causes=[
"Adults, 50–70 years; slight female predominance",
"Sites: retroperitoneum, uterus, IVC, GI tract, skin",
"Rare: prior radiation exposure; EBV-associated in immunocompromised",
"Sporadic – no hereditary syndrome typical",
],
complications=[
"Local recurrence after resection (retroperitoneal >50%)",
"Hematogenous metastases – lungs and liver most common",
"Retroperitoneal LMS: often large at presentation; difficult complete resection",
"Uterine LMS: may be misdiagnosed as leiomyoma (fibroid) pre-op",
"5-year survival: 15–60% depending on grade and site",
],
microscopy_notes=[
"LPO (4x): Interlacing fascicles of spindle cells in perpendicular arrangement",
"HPO (10x): Eosinophilic spindle cells; blunt-ended (cigar-shaped) nuclei; fascicular pattern",
"HPO (40x): Nuclear pleomorphism + atypical mitoses; perinuclear vacuoles",
"IHC: SMA, desmin, h-caldesmon positive; S100 and CD34 negative",
"Masson trichrome: red cytoplasmic filaments (myofibrils)",
],
image_urls=[
"https://cdn.orris.care/cdss_images/83654b8c6e0775a6e6f779333ed07a555d473664e3e113269c5b9351f32b3cd7.png",
],
magnifications=[
"Spindle cell fascicular pattern (analogous architecture – LPO/HPO) – Source: Robbins Basic Pathology"
]
),
]
# Build all slides
for d in slides_data:
content_slide(**d)
# Save
out = "/tmp/workspace/bone-pathology-ppt/Bone_Joint_Pathology_Lab.pptx"
prs.save(out)
print(f"SAVED: {out} ({len(prs.slides)} slides)")
cd /tmp/workspace/bone-pathology-ppt && python build_ppt.py 2>&1
python3 -c " import requests, base64 url = 'https://cdn.orris.care/cdss_images/30c8480a7f30bce53774d5e9ad4323fcd0eab819c9a6ca6421bec20de23f6393.png' r = requests.get(url, timeout=15) print(r.status_code, len(r.content)) "
~/bone-pathology-ppt/build_ppt.py
Successfully replaced 1 instance(s) of the string in '/tmp/workspace/bone-pathology-ppt/build_ppt.py'
cd /tmp/workspace/bone-pathology-ppt && python build_ppt.py 2>&1
python3 -c " from pptx import Presentation prs = Presentation('/tmp/workspace/bone-pathology-ppt/Bone_Joint_Pathology_Lab.pptx') print(f'Slides: {len(prs.slides)}') import os size = os.path.getsize('/tmp/workspace/bone-pathology-ppt/Bone_Joint_Pathology_Lab.pptx') print(f'File size: {size/1024:.1f} KB') for i, s in enumerate(prs.slides, 1): texts = [sh.text_frame.text[:50] for sh in s.shapes if sh.has_text_frame and sh.text_frame.text.strip()] print(f' Slide {i}: {texts[:2]}') imgs = [sh for sh in s.shapes if sh.shape_type == 13] if imgs: print(f' -> {len(imgs)} image(s) embedded') "
Bone Joint Pathology Lab
Presentation · PPTX
| Slide | Specimen | Image Source |
|---|---|---|
| 2 | 190 - Bone-Renal Dystrophy | Mosaic bone texture (Robbins) |
| 3 | 191 - Purulent Osteomyelitis | Osteoid trabeculae with osteoblasts |
| 4 | 41 - Paget Disease of Bone | Mosaic cement lines (pathognomonic) |
| 5 | 17 - Osteochondroma | X-ray + whole mount cartilage cap section |
| 6 | 173 - Fibrous Dysplasia | Curvilinear woven bone trabeculae |
| 7 | 193 - Giant Cell Tumor | Multinucleate giant cells + stromal cells |
| 8 | 254 - Osteosarcoma | Codman triangle X-ray |
| 9 | 92 - Ewing's Tumor | Sheets of small round blue cells |
| 10 | 13 - Gout | OA/joint destruction diagram |
| 11 | 196 - Rheumatoid Arthritis | Inflammatory cascade diagram |
| 12 | 200 - Osteoarthritis | OA schematic (injury → early → late) |
| 13 | 22 - Skin Fibrosarcoma | Storiform spindle cell pattern |
| 14 | 23 - Rhabdomyosarcoma | (image fetch had minor issue - text complete) |
| 15 | 25 - Liposarcoma | Enchondroma/lipoblast reference |
| 16 | 101 - Leiomyosarcoma | Fascicular spindle cell pattern |