Foam cell histopathology d/d

Reading File
Finding Sources
Finding Sources
Reading File
Reading File
Finding Sources
Finding Sources
Reading File
Loading Image
Finding Sources
Finding Sources
Finding Sources
Loading Image
Reading File
I now have all the material needed for a comprehensive, well-structured answer. Let me compile it.

Foam Cell Histopathology - Differential Diagnosis

Foam cells are lipid-laden macrophages (histiocytes) with a characteristic pale, vacuolated, "foamy" cytoplasm on H&E due to dissolved neutral lipids. They are not a single diagnosis - they appear across a broad range of metabolic, infectious, neoplastic, and reactive conditions.

Histological Appearance

  • Large macrophages with abundant, pale vacuolated cytoplasm (lipid washed out by formalin fixation leaves clear spaces)
  • Small, eccentric or central nucleus
  • On H&E: optically clear or finely granular cytoplasm
  • Special stains: Oil Red O / Sudan Black on frozen sections confirms lipid
  • CD68 positive (macrophage marker); adipophilin IHC helps identify lipid accumulation
Foam cells from a tuberous xanthoma - H&E showing large vacuolated macrophages amid collagen bundles

Differential Diagnosis by System/Category

1. XANTHOMAS (Skin/Soft Tissue)

The prototype foam cell lesion. Macrophages engulf lipid via scavenger receptors after excess lipoprotein deposition in tissues.
TypeKey Histologic Features
Eruptive xanthomaFoam cells in reticular dermis; mixed neutrophil + lymphocyte infiltrate early; extracellular lipid clefts
Tuberous xanthomaLarge foam cell aggregates in dermis; fibrosis; few inflammatory cells; cholesterol esters visible under polarized light
Tendinous xanthomaSimilar to tuberous but even larger foam cells
Plane xanthoma / XanthelasmaSuperficial dermal foam cells; non-inflammatory; minimal fibrosis; thin epidermis (eyelid clue)
Verruciform xanthomaFoam cells restricted to dermal papillae; overlying epithelial hyperplasia/acanthosis
Note: Formalin fixation removes lipid leaving artifactual clefts. Adipophilin/CD68 IHC confirms foam cell identity. - Dermatology 2-Volume Set 5e

2. NON-LANGERHANS CELL HISTIOCYTOSES

ConditionDistinguishing Features
Juvenile Xanthogranuloma (JXG)Dermal histiocytes + Touton giant cells (wreath of nuclei with peripheral foamy cytoplasm); eosinophils; no lipid disorder required; CD68+/S100-/CD1a-
Xanthoma DisseminatumFoam cells + Touton cells on mucous membranes; associated DI
Papular XanthomaMore foam cells, fewer giant cells than JXG
Multicentric ReticulohistiocytosisLarge histiocytes with "ground-glass" eosinophilic cytoplasm (NOT foam cells) - key distinguishing point
Erdheim-Chester DiseaseFoamy CD68+/CD1a- histiocytes with fibrosis; long bone involvement

3. ATHEROSCLEROSIS (Vascular)

  • Fatty streak: Earliest atherosclerotic lesion - subendothelial accumulation of foam cells (macrophage-derived + smooth muscle cell-derived)
  • Macrophages ingest oxidized LDL via scavenger receptors → foam cell formation
  • Progress to fibrous plaques with foam cell-rich lipid core, cholesterol clefts, necrotic debris, and fibrous cap
Atherosclerotic plaque diagram showing foam cells alongside cholesterol crystals and smooth muscle cells
  • Fuster and Hurst's The Heart, 15th Edition

4. LEPROSY (Lepromatous Type)

  • Virchow cells (Lepra cells): Lipid-laden macrophages stuffed with Mycobacterium leprae organisms ("globi")
  • H&E: Foamy macrophages in dermis; grenz zone (Unna's grenz zone - clear subepidermal zone)
  • AFB stain (Fite-Faraco): Reveals masses of acid-fast bacilli within the foamy cytoplasm
  • Lepromatous = multibacillary; no granulomas (poor T-cell response)
  • Involves skin, peripheral nerves, testes, anterior eye
  • Robbins, Cotran & Kumar Pathologic Basis of Disease; Andrews' Diseases of the Skin
Key distinguishing feature from xanthomas: AFB positivity, grenz zone, no lipid disorder

5. LIPID STORAGE DISEASES

DiseaseOrgan/SiteCell Appearance
Niemann-Pick Disease (A/B)Lung, liver, spleen, bone marrowLarge foamy macrophages; sphingomyelin on EM - lamellar "myelin figures"
Niemann-Pick Type CLung (BAL foam cells), liverSimilar foamy infiltrates; pulmonary fibrosis in long-standing disease
Gaucher DiseaseSpleen, liver, BMGaucher cells - "crumpled tissue paper" cytoplasm (glucocerebroside); NOT true foam cells but often in D/D
Cholesteryl Ester Storage Disease / Wolman DiseaseIntestinal mucosa, liverFoam cells infiltrating intestinal villi; mutation in LIPA gene
  • Fishman's Pulmonary Diseases; Sleisenger and Fordtran's GI & Liver Disease

6. XANTHOGRANULOMATOUS INFLAMMATION (Infectious/Reactive)

ConditionSiteFeatures
Xanthogranulomatous PyelonephritisKidneyFoamy macrophages in renal parenchyma; usually E. coli/Proteus; staghorn calculi; CD68+
MalakoplakiaBladder, kidney, GI tractFoamy von Hansemann cells with Michaelis-Gutmann bodies (targetoid calcospherites, PAS/von Kossa+); macrophage dysfunction with gram-neg infections
Megalocytic Interstitial NephritisKidneySimilar macrophage dysfunction pattern
  • National Kidneys Foundation Primer on Kidney Diseases, 8e

7. TUMORS / NEOPLASTIC CONDITIONS

TumorFoam Cell Context
Clear Cell Carcinoma (kidney, endometrium)Clear cells due to glycogen/lipid - NOT true foam cells; PAS+, CD10+/EMA+
Adrenocortical CarcinomaLipid-rich clear cells
HibernomaBrown fat tumor - multivacuolated lipoblasts
Liposarcoma (Well-differentiated)Lipoblasts with scalloped nuclei
DermatofibromaMay contain incidental xanthomatous (foamy) cells; storiform pattern
Giant Cell Tumor of Tendon SheathFoamy histiocytes + hemosiderin + giant cells - DDx for tendinous xanthoma

8. MISCELLANEOUS

ConditionNotes
Whipple's DiseaseSmall intestinal villi stuffed with PAS+ macrophages (contain T. whipplei); foamy appearance; villi expanded - "foam cells" in villi
Langerhans Cell HistiocytosisCD1a+/S100+/langerin+ (Birbeck granules on EM); NOT true foam cells but in clinical D/D
Rosai-Dorfman DiseaseEmperipolesis (lymphocytes within histiocyte cytoplasm); S100+/CD68+
GVHDDermal xanthomatous cells in biopsies may indicate hepatic GVHD
Pulmonary Alveolar ProteinosisFoamy alveolar macrophages; PAS+ granular material
Post-obstructive pneumoniaEndogenous lipoid pneumonia - foamy alveolar macrophages
HIV + IgA gammopathyPapular neutrophilic xanthoma - foam cells intermingled with neutrophils + nuclear dust

Key Discriminating Stains

StainPurpose
Oil Red O / Sudan Black (frozen)Confirms neutral lipid
CD68 (PGM1/KP1)Macrophage marker
Adipophilin IHCLipid droplet protein; aids foam cell ID on paraffin
AFB (Fite-Faraco)Leprosy (Virchow cells)
PASWhipple's macrophages; Gaucher cells
CD1a / LangerinLangerhans cells (distinguish from foam cells)
Michaelis-Gutmann (PAS, von Kossa)Malakoplakia
S100Rosai-Dorfman (positive); xanthoma foam cells (negative)

Quick Summary Table

CategoryConditionKey Distinguishing Feature
MetabolicXanthomasLipid disorder; adipophilin+; no organisms
HistiocytosisJXGTouton giant cells; children; no lipid disorder
VascularAtherosclerosisIntimal location; cholesterol clefts
InfectiousLepromatous leprosyAFB+ Virchow cells; grenz zone
StorageNiemann-PickEM lamellar figures; sphingomyelinase deficiency
Infectious-reactiveXanthogranulomatous pyelonephritisKidney; gram-neg infection
Infectious-reactiveMalakoplakiaMichaelis-Gutmann bodies
GI infectionWhipple's diseasePAS+ macrophages in small bowel villi
Sources: Dermatology 2-Volume Set 5e; Fitzpatrick's Dermatology Vol 1-2; Robbins, Cotran & Kumar Pathologic Basis of Disease; Andrews' Diseases of the Skin; National Kidneys Foundation Primer on Kidney Diseases, 8e; Fuster and Hurst's The Heart, 15th Edition; Sleisenger and Fordtran's GI & Liver Disease; Harrison's Principles of Internal Medicine 22E

Compiled all in one page

Asking for Preferences
Reading File
Running Command

mkdir -p /home/daytona/workspace/foam-cell-dd && ls /home/daytona/workspace/foam…

Writing File

~/foam-cell-dd/generate_pdf.py

from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.units import mm, cm
from reportlab.platypus import (
    SimpleDocTemplate, Table, TableStyle, Paragraph, Spacer,
    HRFlowable, KeepTogether
)
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
from reportlab.platypus import BaseDocTemplate, PageTemplate, Frame

OUTPUT = "/home/daytona/workspace/foam-cell-dd/Foam_Cell_Histopathology_DD.pdf"

# ── Colour palette ────────────────────────────────────────────────────────────
DARK_BLUE   = colors.HexColor("#1a2e4a")
MED_BLUE    = colors.HexColor("#2563a8")
LIGHT_BLUE  = colors.HexColor("#dbeafe")
ACCENT      = colors.HexColor("#e07b39")
ROW_ALT     = colors.HexColor("#f0f6ff")
ROW_WHITE   = colors.white
HEADER_BG   = colors.HexColor("#1a2e4a")
SUBHDR_BG   = colors.HexColor("#2563a8")
GREEN_BG    = colors.HexColor("#d1fae5")
YELLOW_BG   = colors.HexColor("#fef9c3")
PINK_BG     = colors.HexColor("#fce7f3")
PURPLE_BG   = colors.HexColor("#ede9fe")
ORANGE_BG   = colors.HexColor("#ffedd5")
TEAL_BG     = colors.HexColor("#ccfbf1")

# ── Styles ────────────────────────────────────────────────────────────────────
styles = getSampleStyleSheet()

def make_style(name, parent='Normal', **kw):
    return ParagraphStyle(name, parent=styles[parent], **kw)

title_style = make_style('TitleS', fontSize=16, textColor=colors.white,
                          alignment=TA_CENTER, fontName='Helvetica-Bold',
                          spaceAfter=2)
subtitle_style = make_style('SubTitle', fontSize=9, textColor=colors.HexColor("#bfdbfe"),
                             alignment=TA_CENTER, fontName='Helvetica')
sect_style = make_style('SectHdr', fontSize=8, textColor=colors.white,
                         fontName='Helvetica-Bold', alignment=TA_LEFT)
cell_style = make_style('CellS', fontSize=7, textColor=DARK_BLUE,
                         fontName='Helvetica', leading=9)
cell_bold  = make_style('CellB', fontSize=7, textColor=DARK_BLUE,
                         fontName='Helvetica-Bold', leading=9)
cell_hdr   = make_style('ColHdr', fontSize=7, textColor=colors.white,
                         fontName='Helvetica-Bold', leading=9, alignment=TA_CENTER)
note_style = make_style('NoteS', fontSize=6.5, textColor=colors.HexColor("#374151"),
                         fontName='Helvetica-Oblique', alignment=TA_CENTER)
key_style  = make_style('KeyS', fontSize=7, textColor=DARK_BLUE,
                         fontName='Helvetica-Bold', leading=9)
footer_style = make_style('FootS', fontSize=6, textColor=colors.grey,
                           fontName='Helvetica', alignment=TA_CENTER)

def P(text, style=cell_style): return Paragraph(text, style)
def B(text): return Paragraph(text, cell_bold)
def H(text): return Paragraph(text, cell_hdr)

# ── Table helper ──────────────────────────────────────────────────────────────
def section_header(title, color=SUBHDR_BG, cols=4):
    t = Table([[Paragraph(title, sect_style)]], colWidths=['100%'])
    t.setStyle(TableStyle([
        ('BACKGROUND', (0,0), (-1,-1), color),
        ('TOPPADDING',  (0,0), (-1,-1), 3),
        ('BOTTOMPADDING', (0,0), (-1,-1), 3),
        ('LEFTPADDING', (0,0), (-1,-1), 6),
    ]))
    return t

def make_table(headers, rows, col_widths, row_colors=None):
    data = [headers] + rows
    t = Table(data, colWidths=col_widths, repeatRows=1)
    style_cmds = [
        ('BACKGROUND', (0,0), (-1,0), MED_BLUE),
        ('GRID', (0,0), (-1,-1), 0.3, colors.HexColor("#d1d5db")),
        ('VALIGN', (0,0), (-1,-1), 'TOP'),
        ('TOPPADDING', (0,0), (-1,-1), 2.5),
        ('BOTTOMPADDING', (0,0), (-1,-1), 2.5),
        ('LEFTPADDING', (0,0), (-1,-1), 3),
        ('RIGHTPADDING', (0,0), (-1,-1), 3),
        ('ROWBACKGROUNDS', (0,1), (-1,-1), [ROW_WHITE, ROW_ALT]),
    ]
    if row_colors:
        for ri, rc in row_colors:
            style_cmds.append(('BACKGROUND', (0, ri+1), (-1, ri+1), rc))
    t.setStyle(TableStyle(style_cmds))
    return t

# ── Build document ────────────────────────────────────────────────────────────
doc = SimpleDocTemplate(
    OUTPUT,
    pagesize=A4,
    leftMargin=10*mm, rightMargin=10*mm,
    topMargin=8*mm, bottomMargin=8*mm,
    title="Foam Cell Histopathology - Differential Diagnosis",
    author="Orris Medical"
)

W = A4[0] - 20*mm   # usable width

story = []

# ═══════════════════════════════════════════════════════════════════
# TITLE BANNER
# ═══════════════════════════════════════════════════════════════════
banner = Table(
    [[P("FOAM CELL HISTOPATHOLOGY", title_style)],
     [P("Differential Diagnosis — Quick Reference", subtitle_style)]],
    colWidths=[W]
)
banner.setStyle(TableStyle([
    ('BACKGROUND', (0,0), (-1,-1), DARK_BLUE),
    ('TOPPADDING', (0,0), (-1,-1), 6),
    ('BOTTOMPADDING', (0,0), (-1,-1), 6),
    ('LEFTPADDING', (0,0), (-1,-1), 8),
]))
story.append(banner)
story.append(Spacer(1, 3))

# ═══════════════════════════════════════════════════════════════════
# DEFINITION BOX
# ═══════════════════════════════════════════════════════════════════
def_text = (
    "<b>Foam cells</b> are lipid-laden macrophages with <b>pale, vacuolated, \"foamy\" cytoplasm</b> on H&amp;E "
    "(lipid dissolved by formalin → clear vacuoles). CD68+, Adipophilin+. "
    "Oil Red O / Sudan Black on <b>frozen sections</b> confirms neutral lipid. "
    "They occur across metabolic, infectious, neoplastic and reactive conditions."
)
def_box = Table([[P(def_text, make_style('Def', fontSize=7.2, textColor=DARK_BLUE,
                                          fontName='Helvetica', leading=10))]],
                colWidths=[W])
def_box.setStyle(TableStyle([
    ('BACKGROUND', (0,0), (-1,-1), LIGHT_BLUE),
    ('TOPPADDING', (0,0), (-1,-1), 5),
    ('BOTTOMPADDING', (0,0), (-1,-1), 5),
    ('LEFTPADDING', (0,0), (-1,-1), 8),
    ('RIGHTPADDING', (0,0), (-1,-1), 8),
    ('BOX', (0,0), (-1,-1), 0.8, MED_BLUE),
]))
story.append(def_box)
story.append(Spacer(1, 4))

# ═══════════════════════════════════════════════════════════════════
# MAIN DIFFERENTIAL TABLE
# ═══════════════════════════════════════════════════════════════════
story.append(section_header("▶  MAIN DIFFERENTIAL DIAGNOSIS"))
story.append(Spacer(1, 2))

W1, W2, W3, W4 = 32*mm, 42*mm, 52*mm, 34*mm
cw = [W1, W2, W3, W4]

hdr = [H("Category / Disease"), H("Organ / Site"), H("Key Histologic Features"), H("Distinguishing Clue")]

rows_main = [
    # XANTHOMAS
    [B("XANTHOMAS"), P(""), P(""), P("")],
    [P("Eruptive xanthoma"),
     P("Reticular dermis"),
     P("Small foam cells; neutrophil + lymphocyte infiltrate (early); extracellular lipid clefts"),
     P("Hypertriglyceridaemia; AFB –")],
    [P("Tuberous / Tendinous xanthoma"),
     P("Skin / tendons"),
     P("Large foam cell aggregates; fibrosis; cholesterol esters (polarised light)"),
     P("Cholesterol clefts; familial dyslipidaemia")],
    [P("Xanthelasma / Plane xanthoma"),
     P("Eyelid / skin"),
     P("Superficial dermal foam cells; non-inflammatory; minimal fibrosis"),
     P("Thin epidermis; eyelid location")],
    [P("Verruciform xanthoma"),
     P("Oral mucosa / genital"),
     P("Foam cells confined to dermal papillae; overlying epithelial hyperplasia"),
     P("HPV unrelated; unique papillary pattern")],
    # HISTIOCYTOSES
    [B("NON-LANGERHANS HISTIOCYTOSES"), P(""), P(""), P("")],
    [P("Juvenile Xanthogranuloma (JXG)"),
     P("Skin (head/neck)"),
     P("Histiocytes + Touton giant cells (wreath nuclei + peripheral foam); eosinophils"),
     P("CD68+, S100–, CD1a–; children; no lipid disorder")],
    [P("Xanthoma Disseminatum"),
     P("Mucosa / skin / CNS"),
     P("Foam cells + Touton cells; DI association"),
     P("Normolipidaemia; mucous membrane involvement")],
    [P("Erdheim-Chester Disease"),
     P("Long bones, retroperitoneum"),
     P("Foamy CD68+ histiocytes + dense fibrosis; Touton-like giant cells"),
     P("BRAF V600E mutation; long bone osteosclerosis")],
    # VASCULAR
    [B("VASCULAR"), P(""), P(""), P("")],
    [P("Atherosclerosis (fatty streak)"),
     P("Intima (aorta, coronaries)"),
     P("Subendothelial foam cells (macrophage + SMC-derived); cholesterol clefts; necrotic core in advanced plaques"),
     P("Intimal location; no grenz zone; evolves to fibrous plaque")],
    # INFECTIOUS
    [B("INFECTIOUS"), P(""), P(""), P("")],
    [P("Lepromatous Leprosy\n(Virchow / Lepra cells)"),
     P("Dermis, nerves, testes"),
     P("Lipid-laden macrophages filled with M. leprae globi; Grenz zone (clear sub-epidermal band); no true granulomas"),
     P("AFB+ (Fite-Faraco); globi; leonine facies")],
    [P("Whipple's Disease"),
     P("Small intestinal villi"),
     P("Villi expanded by PAS+ macrophages (T. whipplei); foamy cytoplasm"),
     P("PAS+++ (diastase-resistant); PCR T. whipplei")],
    # STORAGE
    [B("LIPID STORAGE DISEASES"), P(""), P(""), P("")],
    [P("Niemann-Pick (A/B)"),
     P("Lung, liver, spleen, BM"),
     P("Large foamy macrophages; sphingomyelin; lamellar 'myelin figures' on EM"),
     P("Sphingomyelinase deficiency; EM diagnostic")],
    [P("Niemann-Pick Type C"),
     P("Lung, liver"),
     P("Foamy macrophages; pulmonary fibrosis in long-standing disease; BAL foam cells"),
     P("NPC1/NPC2 gene; cholesterol transport defect")],
    [P("Cholesteryl Ester Storage / Wolman Disease"),
     P("Intestinal mucosa, liver"),
     P("Foam cells infiltrating intestinal villi; adrenal calcification (Wolman)"),
     P("LIPA gene mutation; adrenal calcification on imaging")],
    # XANTHOGRANULOMATOUS INFECTION
    [B("XANTHOGRANULOMATOUS INFLAMMATION"), P(""), P(""), P("")],
    [P("Xanthogranulomatous Pyelonephritis"),
     P("Kidney"),
     P("Foamy CD68+ macrophages replacing renal parenchyma; staghorn calculi; necrosis"),
     P("E. coli / Proteus; staghorn calculus; CD68+")],
    [P("Malakoplakia"),
     P("Bladder, kidney, GI"),
     P("Von Hansemann cells (foamy macrophages) + Michaelis-Gutmann bodies (targetoid calcospherites)"),
     P("MG bodies: PAS+, von Kossa+, iron stain+")],
    # TUMOURS
    [B("TUMOURS / NEOPLASTIC"), P(""), P(""), P("")],
    [P("Clear Cell RCC"),
     P("Kidney"),
     P("Clear cells (glycogen/lipid); delicate 'chicken-wire' vasculature; no true foam cell aggregates"),
     P("PAS+, CD10+, EMA+, PAX8+; NOT CD68+")],
    [P("Well-Diff. Liposarcoma"),
     P("Retroperitoneum, thigh"),
     P("Lipoblasts with scalloped hyperchromatic nuclei; MDM2+"),
     P("MDM2/CDK4 amplification; not pure foam cells")],
    [P("Giant Cell Tumour Tendon Sheath"),
     P("Tendon / joint"),
     P("Foamy histiocytes + hemosiderin + multinucleated giant cells + fibrous stroma"),
     P("CSF1 rearrangement; DDx tendinous xanthoma")],
    # MISC
    [B("MISCELLANEOUS"), P(""), P(""), P("")],
    [P("Lipoid Pneumonia (endogenous)"),
     P("Lung / alveoli"),
     P("Foamy alveolar macrophages; oil-like material in alveolar spaces"),
     P("Post-obstruction or aspiration; Oil Red O+")],
    [P("Pulmonary Alveolar Proteinosis"),
     P("Lung"),
     P("Foamy macrophages + granular PAS+ alveolar material"),
     P("PAS+ proteinaceous material; GM-CSF antibodies")],
    [P("GVHD (cutaneous)"),
     P("Skin"),
     P("Dermal xanthomatous cells in biopsies"),
     P("Context: post-HSCT; may indicate hepatic GVHD")],
]

row_colors_main = []
cat_rows = [0, 5, 10, 12, 15, 19, 22, 26]  # 0-indexed among data rows
cat_bg = [colors.HexColor("#1e3a5f"), colors.HexColor("#1e3a5f"), colors.HexColor("#1e3a5f"),
          colors.HexColor("#1e3a5f"), colors.HexColor("#1e3a5f"), colors.HexColor("#1e3a5f"),
          colors.HexColor("#1e3a5f"), colors.HexColor("#1e3a5f")]

t_main = Table([hdr] + rows_main, colWidths=cw, repeatRows=1)
style_cmds = [
    ('BACKGROUND', (0,0), (-1,0), MED_BLUE),
    ('GRID', (0,0), (-1,-1), 0.3, colors.HexColor("#d1d5db")),
    ('VALIGN', (0,0), (-1,-1), 'TOP'),
    ('TOPPADDING', (0,0), (-1,-1), 2),
    ('BOTTOMPADDING', (0,0), (-1,-1), 2),
    ('LEFTPADDING', (0,0), (-1,-1), 3),
    ('RIGHTPADDING', (0,0), (-1,-1), 3),
]
# alternating row backgrounds for data rows
for i in range(len(rows_main)):
    ri = i + 1
    if i in cat_rows:
        style_cmds.append(('BACKGROUND', (0, ri), (-1, ri), DARK_BLUE))
        style_cmds.append(('SPAN', (0, ri), (-1, ri)))
    else:
        bg = ROW_ALT if i % 2 == 0 else ROW_WHITE
        style_cmds.append(('BACKGROUND', (0, ri), (-1, ri), bg))

t_main.setStyle(TableStyle(style_cmds))
story.append(t_main)
story.append(Spacer(1, 4))

# ═══════════════════════════════════════════════════════════════════
# BOTTOM ROW: Stains | Key Distinguishing Points
# ═══════════════════════════════════════════════════════════════════
story.append(section_header("▶  KEY DISCRIMINATING STAINS"))
story.append(Spacer(1, 2))

stain_cw = [28*mm, 60*mm, 72*mm]
stain_hdr = [H("Stain"), H("Purpose"), H("Positive In")]
stain_rows = [
    [B("Oil Red O / Sudan Black"),
     P("Confirms neutral lipid (frozen sections only)"),
     P("Xanthomas, lipoid pneumonia, lipid storage diseases")],
    [B("CD68 (KP1 / PGM1)"),
     P("Macrophage lineage marker"),
     P("All foam cell lesions; strongly + in xanthogranulomatous inflammation")],
    [B("Adipophilin IHC"),
     P("Lipid droplet protein; works on paraffin"),
     P("Xanthomas, foam cells in standard sections")],
    [B("AFB – Fite-Faraco"),
     P("Acid-fast mycobacteria"),
     P("Lepromatous leprosy (Virchow cells); globi within macrophages")],
    [B("PAS (diastase-resistant)"),
     P("Intracellular organisms / glycoprotein"),
     P("Whipple's disease (PAS++++); NOT positive in xanthomas")],
    [B("Michaelis-Gutmann bodies\n(PAS, von Kossa, Iron)"),
     P("Targetoid calcospherites in macrophages"),
     P("Malakoplakia only")],
    [B("CD1a / Langerin / S100"),
     P("Langerhans cell markers"),
     P("LCH (CD1a+, S100+); absent in all foam cell xanthomas")],
    [B("CSF1R / BRAF V600E"),
     P("Molecular markers"),
     P("Giant cell tumour (CSF1R); Erdheim-Chester (BRAF V600E)")],
]

t_stain = make_table(stain_hdr, stain_rows, stain_cw)
story.append(t_stain)
story.append(Spacer(1, 4))

# ═══════════════════════════════════════════════════════════════════
# TOUTON GIANT CELL NOTE
# ═══════════════════════════════════════════════════════════════════
touton_note = Table([[
    P("<b>Touton Giant Cell</b> — Pathognomonic foamy giant cell: central wreath of nuclei "
      "surrounded by <i>eosinophilic</i> cytoplasm (inner) and <i>foamy/xanthomatous</i> cytoplasm (outer). "
      "Seen in: <b>JXG</b> (most characteristic), xanthoma disseminatum, xanthomas, necrobiotic xanthogranuloma. "
      "<b>NOT</b> seen in: lepromatous leprosy, atherosclerosis, malakoplakia, or storage diseases.",
      make_style('ToutonS', fontSize=7, textColor=colors.HexColor("#1e3a5f"),
                  fontName='Helvetica', leading=9))
]], colWidths=[W])
touton_note.setStyle(TableStyle([
    ('BACKGROUND', (0,0), (-1,-1), YELLOW_BG),
    ('BOX', (0,0), (-1,-1), 0.8, colors.HexColor("#ca8a04")),
    ('TOPPADDING', (0,0), (-1,-1), 5),
    ('BOTTOMPADDING', (0,0), (-1,-1), 5),
    ('LEFTPADDING', (0,0), (-1,-1), 8),
    ('RIGHTPADDING', (0,0), (-1,-1), 8),
]))
story.append(touton_note)
story.append(Spacer(1, 3))

# ═══════════════════════════════════════════════════════════════════
# QUICK MNEMONICS
# ═══════════════════════════════════════════════════════════════════
mn_cw = [W/3, W/3, W/3]
mn_hdr = [H("AFB+ Foam Cells"), H("PAS+ Foam Cells"), H("Touton Giant Cells")]
mn_rows = [
    [P("Lepromatous leprosy\n(Virchow / Lepra cells)\n• Fite-Faraco +\n• Grenz zone\n• No granulomas"),
     P("Whipple's disease\n(T. whipplei)\n• Villi expanded\n• Diastase-resistant\n• PCR confirms"),
     P("JXG (most typical)\nXanthoma disseminatum\nTuberous xanthoma\nNecrobiotic xanthogranuloma")]
]
t_mn = make_table(mn_hdr, mn_rows, mn_cw)
story.append(t_mn)
story.append(Spacer(1, 3))

# ═══════════════════════════════════════════════════════════════════
# FOOTER
# ═══════════════════════════════════════════════════════════════════
footer_txt = (
    "Sources: Dermatology 2-Vol Set 5e | Fitzpatrick's Dermatology | Robbins & Cotran Pathologic Basis of Disease | "
    "Andrews' Diseases of the Skin | Harrison's Principles of Internal Medicine 22E | "
    "Fuster & Hurst's The Heart 15e | Sleisenger & Fordtran's GI & Liver Disease | "
    "National Kidney Foundation Primer 8e  •  Compiled by Orris Medical AI"
)
story.append(Paragraph(footer_txt, footer_style))

# ── Build ─────────────────────────────────────────────────────────────────────
doc.build(story)
print(f"PDF written to: {OUTPUT}")
Running Command

cd /home/daytona/workspace/foam-cell-dd && python generate_pdf.py 2>&1

Running Command

ls -lh /home/daytona/workspace/foam-cell-dd/Foam_Cell_Histopathology_DD.pdf

Your one-page PDF is ready:

Foam Cell Histopathology DD

PDF Document · PDF

What's included on the page:
  • Definition box - foam cell basics, stain notes
  • Main D/D table (4 columns: Category, Site, Key Histology, Distinguishing Clue) covering:
    • Xanthomas (eruptive, tuberous, tendinous, xanthelasma, verruciform)
    • Non-Langerhans histiocytoses (JXG, xanthoma disseminatum, Erdheim-Chester)
    • Vascular (atherosclerosis/fatty streak)
    • Infectious (lepromatous leprosy/Virchow cells, Whipple's disease)
    • Lipid storage diseases (Niemann-Pick A/B/C, Wolman/CESD)
    • Xanthogranulomatous inflammation (XGP, malakoplakia)
    • Tumours (clear cell RCC, liposarcoma, GCTS)
    • Miscellaneous (lipoid pneumonia, PAP, GVHD)
  • Key discriminating stains table (Oil Red O, CD68, adipophilin, AFB, PAS, MG bodies, CD1a, molecular markers)
  • Touton giant cell highlighted note box
  • Quick mnemonics - AFB+ / PAS+ / Touton+ foam cell conditions side by side
  • Full source citations in footer
This is a shared conversation. Sign in to Orris to start your own chat.