Explain the terms
clubbing fingers liver disease

Clinical photograph of the distal digits demonstrating digital clubbing. Modality: Clinical photography; technique: macro close‑up digital image with bright‑field illumination and high resolution to emphasize nail bed morphology. Anatomical location: fingers (distal phalanges) with visible nail plates, nail beds, and periungual tissue; dorsal view highlighting the nail–bed interface. Visual features: bulbous, expanded distal digits; nail plates show increased curvature with convex nail beds; reduced angle between the nail plate and the adjacent skin; glossy, smooth periungual skin; absence of cutaneous ulcers in view; subtle subungual fullness may be present. Pathologic/clinical findings: clubbing is a clinical sign characterized by hyperplastic nail bed change; not a histologic lesion, but correlates with chronic hypoxia and systemic disease. Diagnostic significance: digital clubbing signals potential underlying cardiopulmonary pathology or hepatobiliary disease; commonly associated conditions include interstitial lung disease (idiopathic pulmonary fibrosis, bronchiectasis), chronic obstructive pulmonary disease, cyanotic heart disease, liver cirrhosis, and inflammatory bowel disease; warrants systemic workup. Differential considerations: idiopathic clubbing; secondary clubbing from pulmonary/vascular disease or congenital heart disease; alternatively pseudoclubbing from nail dystrophy. Clinical correlation: correlate with oxygen saturation, chest imaging, echocardiography, hepatic panel; multidisciplinary assessment recommended. Documented progression can guide treatment decisions and patient counseling in dermatology, pulmonology, and internal medicine.

This clinical photograph displays a dorsal view of a human hand demonstrating classic digital clubbing (hippocratic fingers). The distal phalanges of all visible fingers appear bulbous and enlarged, with an increased longitudinal and transverse curvature of the nail plates, giving them a 'watch-glass' or convex appearance. There is a visible loss of the Lovibond angle (the normal 160-degree angle between the nail base and the proximal nail fold). The skin of the hand shows a generalized reddish-to-dusky hue, suggestive of polycythemia or chronic cyanosis. These physical findings are hallmark signs of chronic hypoxemia, frequently associated with underlying conditions such as congenital cyanotic heart disease (e.g., Tetralogy of Fallot) or chronic pulmonary disease. The image serves as an educational tool for identifying secondary physical manifestations of cardiovascular and respiratory pathology.
asterixis flapping tremor hepatic encephalopathy

Table 7. Management according to grade of hepatic encephalopathy (West-Haven Criteria) (36) <table><thead><tr><th>Grade of HE</th><th>Symptom description</th><th>Management in ALF</th></tr></thead><tbody><tr><td>Grade 1</td><td>Trivial lack of awareness<br>Shortened attention span<br>Impairment of addition or subtraction<br>Altered sleep rhythm</td><td>• Contact transplant enter and initiative transfer<br>• Obtain baseline CT head</td></tr><tr><td>Grade 2</td><td>Lethargy or apathy<br>Disorientation for time<br>Obvious personality change<br>Inappropriate behavior<br>Dyspraxia<br>Asterixis</td><td>• Transfer to the intensive care unit<br>• Neuro checks q1 hr</td></tr><tr><td>Grade 3</td><td>Somnolence to semistupor<br>Responsive to stimuli<br>Confusion<br>Gross disorientation<br>Bizarre behavior</td><td>• Intubation if appropriate<br>• Repeat CT head<br>• Avoid opioids and benzodiazepines for sedation<br>• Consider propofol due to short half life</td></tr><tr><td>Grade 4</td><td>Coma</td><td>• Repeat CT head<br>• Consider intracranial pressure monitor if transplant candidate<br>• Initiate treatment for cerebral edema</td></tr></tbody></table> ALF, acute liver failure; CT, computed tomography. HE, hepatic encephalopathy.

This pathophysiology diagram illustrates the multi-organ signaling pathways involved in the development of hepatic encephalopathy (HE) driven by oxidative stress and hyperammonemia. The process begins with systemic metabolic rate changes: an increased metabolic rate and electron transport chain activity lead to a depletion of antioxidant enzymes (SOD and GPx) and the exacerbation of Reactive Oxygen Species (ROS). Concurrently, gut dysbiosis and short-chain fatty acids (SCFA) trigger pro-inflammatory cytokines, affecting protein metabolism and contributing to hepatic failure. In the liver, hepatic failure results in NH3 (ammonia) accumulation and increased MDA (malondialdehyde) levels. High levels of NH3 (≥ 500 μM) enter systemic circulation and, together with ROS, induce glial swelling and systemic inflammation. The final stage of the pathway shows these systemic effects crossing the blood-brain barrier, leading to the clinical manifestation of hepatic encephalopathy. The diagram highlights the compensatory struggle between homeostasis and oxidative damage in the context of liver dysfunction.
leuconychia white nails

A clinical photograph of a person's hand on a blue background, demonstrating distal leuconychia (whitening of the distal nail plate). The image shows several fingers where the distal half to third of the nail plate exhibits a prominent, opaque white or pale discoloration. This is clearly demarcated from the proximal portion of the nail plate, which maintains a normal, pinkish translucency. This specific pattern of nail discoloration is a documented complication following the application and removal of artificial nails, often associated with chemical exposure to adhesives like methyl cyanoacrylate or mechanical trauma to the nail surface. The subject has a dark skin tone (Fitzpatrick type IV-VI), and visible features include skin wrinkling over the interphalangeal joints and decorative rings on the second and third fingers. This visual serves as an educational example of chemical or traumatic nail plate dystrophy in the context of cosmetic nail procedures.

Clinical photograph showing nail dysplasia in the hands and feet, a characteristic finding of Nail-Patella Syndrome (NPS). The upper image displays the fingernails, which are hypoplastic and misshapen, appearing notably small and triangular, particularly on the thumbs. The lower image shows the toenails, which exhibit more severe onychodystrophy. The toenails are markedly reduced in size, thickened, and demonstrate significant leuconychia (opaque white discoloration) and surface irregularities, including pitting and longitudinal ridging. This visual presentation illustrates a key diagnostic feature of NPS, which often affects the nails of the hands more prominently than the feet, with the radial side (thumbs) typically being most severely involved. These clinical signs are often associated with other systemic features of the syndrome, such as patellar hypoplasia, iliac horns, and progressive renal disease.



"Easy bruising in patients with liver disease reflects coagulopathy and/or thrombocytopenia." - Goldman-Cecil Medicine
Note: Asterixis is not specific to liver disease - it also occurs in uraemia, CO₂ retention, and drug toxicity.
| Sign | What you see | Underlying mechanism |
|---|---|---|
| Clubbing | Bulbous fingertips, loss of nail angle | Vascular shunting, angiogenic factors |
| Dupuytren's contracture | Fixed finger flexion, palmar cords | Palmar fascia fibrosis (alcohol-related) |
| Leuconychia | White nails | Hypoalbuminaemia, reduced nail bed perfusion |
| Bruising | Easy/spontaneous ecchymoses | Coagulopathy (impaired factor synthesis) + thrombocytopenia |
| Flapping tremor | Wrist flap on outstretched hands | Hepatic encephalopathy - ammonia toxicity |
Explain in Detail
spider naevi liver disease

Clinical photography of the anterior chest and neck shows multiple erythematous, pinpoint lesions with radiating fine vessels consistent with spider naevi (spider angiomas). The lesions are small (approximately 1–3 mm), with a central red dot and a starburst pattern of telangiectatic capillaries that blanch on gentle compression. Distribution is predominantly on the upper chest and anterior neck, with some involvement of the shoulders. Surrounding skin is otherwise unremarkable, without edema or induration. This in vivo image demonstrates classic cutaneous telangiectasia arising from dilation of preexisting arterioles and capillary beds, producing the characteristic radiating vascular spokes. Spider naevi are benign vascular lesions commonly seen in young individuals but their multiplicity or new appearance in adults can indicate hormonal influences (estrogen excess) or underlying liver disease (cirrhosis, portal hypertension), pregnancy, or robust sun exposure in combination with vascular fragility. Clinically, identification should prompt correlation for systemic conditions, especially in patients with signs of liver dysfunction or heavy alcohol use. Differential diagnoses include cherry angioma, venous lake, capillary malformation, or telangiectasia related to hereditary hemorrhagic telangiectasia. This image is a useful educational reference for dermatology and internal medicine, illustrating recognition, documentation, and the clinical significance of vascular skin lesions in clinical practice today.

Clinical photography of the cutaneous surface reveals multiple spider telangiectases (spider angiomas) on the trunk. The lesions are characterized by central arteriolar dilation with radiating fine capillaries, producing a red, star-like or spider-web appearance. These blanch with pressure and tend to be bright red to pink. This pattern is typical for telangiectatic cutaneous vascular lesions and is commonly associated with estrogen-dominant states, pregnancy, hormonal therapy, and chronic liver disease with cirrhosis. In the dermatologic context, such findings are important clinical clues; in hepatology, their presence correlates with hyperestrinism and portal hypertension. Differential diagnoses include benign spider nevi vs cherry angiomas, rosacea-related telangiectasia, and congenital vascular malformations. For patients with suspected cirrhosis, these findings warrant clinical correlation and liver function assessment, including AST/ALT, bilirubin, albumin, INR, and imaging as indicated. Overall, spider telangiectases serve as a non-invasive cutaneous biomarker that informs risk stratification for liver disease, guides differential diagnosis, and supports multidisciplinary evaluation for hepatic pathology. In educational and research contexts, this photograph illustrates how cutaneous signs reflect systemic pathology. It may be used to teach correlation between liver disease and dermatologic manifestations, to train natural language processing and image recognition algorithms for vascular lesions, and to support patient counseling about prognosis and monitoring.
jaundice icteric sclera yellow eyes

Clinical photograph comparison of a patient's eyes demonstrating the resolution of jaundice. Panel (a) shows bilateral scleral icterus, characterized by a distinct yellowing of the sclera and bulbar conjunctiva, marked with blue arrows. This appearance is secondary to hyperbilirubinemia often associated with hepatobiliary disease. Panel (b) shows the same patient after two weeks of treatment, demonstrating a marked reduction in the yellow hue. The sclera has returned to a near-normal white color, indicating a decrease in systemic bilirubin levels and successful therapeutic intervention. This side-by-side comparison serves as an educational tool for identifying physical signs of liver dysfunction and monitoring clinical progression during treatment.

This clinical photograph displays a pediatric patient demonstrating severe systemic jaundice. The primary diagnostic feature is profound scleral icterus, characterized by a bright yellow discoloration of the entire visible sclera in both eyes. The upper eyelids are manually elevated to fully reveal the extent of the icterus. Additionally, the patient's facial skin, forehead, and upper chest exhibit a marked yellowish hue (jaundice), consistent with hyperbilirubinemia. The patient appears to be in a clinical setting, as evidenced by medical tubing and linens visible in the background. This image is an educational example of the physical manifestations of liver dysfunction or hemolytic processes, such as hepatitis, Wilsonian crisis, or acute toxicity, which can lead to significant accumulation of bilirubin in mucosal surfaces and skin.
xanthelasma eyelid cholesterol deposits

This clinical comparison photograph illustrates the dermatological management of xanthelasma palpebrarum using laser therapy. Panel A displays the 'before treatment' state of an adult patient, showing characteristic yellowish, well-demarcated, slightly raised plaques located on the medial aspect of the upper eyelids bilaterally. The lesions exhibit a soft, velvety texture typical of cholesterol deposits. Panel B displays the 'after treatment' outcome following the use of an Erbium laser. In this post-operative view, the xanthomatous lesions have been successfully ablated. The skin of the periorbital region shows resolution of the yellow plaques with minimal residual erythema or scarring in the treated zones. This comparison serves as an educational example of cosmetic and clinical dermatology, specifically highlighting the efficacy of laser resurfacing for benign periorbital skin lesions and the aesthetic restoration of eyelid skin uniformity.

This clinical photograph of a patient with closed eyes demonstrates bilateral, symmetric xanthelasma palpebrarum. The primary findings are multiple sharply demarcated, yellowish plaques located on the medial and superior aspects of both the upper and lower eyelids. The lesions exhibit a velvety or slightly irregular texture and are concentrated around the inner canthi, extending laterally along the eyelid creases and partially toward the eyelash margins. The surrounding periorbital skin shows mild hyperpigmentation and fine wrinkling, particularly in the areas adjacent to the lipid deposits. There are no signs of acute inflammatory changes such as significant erythema or edema. These characteristic cutaneous markers are associated with localized cholesterol accumulations and may indicate underlying dyslipidemia or systemic histiocytic disorders, serving as an important diagnostic sign in dermatology and internal medicine.

| Type | Cause | Bilirubin raised | Urine | Stool |
|---|---|---|---|---|
| Pre-hepatic | Haemolysis (excess RBC breakdown) | Unconjugated | Normal (no bilirubinuria) | Dark (urobilinogen ↑) |
| Hepatic (hepatocellular) | Hepatitis, cirrhosis - liver cell failure | Both | Dark (conjugated) | Pale |
| Post-hepatic (cholestatic/obstructive) | Bile duct obstruction - gallstones, cancer | Conjugated | Dark (orange-brown) | Pale/clay-coloured (acholic) |

"Impaired oestrogen metabolism leads to hyperoestrogenaemia, which produces vascular changes that may lead to palmar erythema and spider angiomas of the skin. Each angioma is a central, pulsating, dilated arteriole from which small vessels radiate." - Robbins, Cotran & Kumar Pathologic Basis of Disease
"Sialadenosis refers to a noninflammatory, noninfectious, nonneoplastic enlargement of a salivary gland, typically the parotid. Sialadenosis is associated with... chronic alcoholism and liver disease." - Cummings Otolaryngology

| Sign | Location | Mechanism | Key Association |
|---|---|---|---|
| Jaundice | Sclera first, then skin | Bilirubin deposition (>2-3 mg/dL) | Hepatitis, cirrhosis, bile duct obstruction |
| Spider Naevi | Face, neck, upper chest | Hyperoestrogenaemia from impaired hepatic oestrogen clearance | Cirrhosis (>5 = significant) |
| Parotid Swelling | Bilateral parotid glands | Sialadenosis - autonomic neuropathy + acinar hypertrophy | Chronic alcoholism + liver disease |
| Xanthelasma | Medial eyelids | Hypercholesterolaemia from bile acid retention | Chronic cholestasis (PBC, PSC) |
Explain in detail why those
caput medusae dilated abdominal veins portal hypertension

Axial contrast-enhanced CT scan of the abdomen at the level of the kidneys. A prominent white arrow points to significantly dilated, tortuous periumbilical (paraumbilical) veins located within the anterior abdominal wall, representing a 'caput medusae' appearance typical of portal hypertension. The image shows moderate to large volume ascites, visualized as low-attenuation fluid surrounding the liver and spleen. The spleen is noticeably enlarged (splenomegaly). Other visualized structures include the liver, both kidneys, the vertebral column with the adjacent abdominal aorta and inferior vena cava, and bowel loops. This diagnostic image is characteristic of chronic liver disease with secondary portal hypertension and established collateral venous circulation.

This clinical photograph shows a supine patient with severe abdominal distension, exhibiting a prominently rounded and protuberant abdominal contour. The skin surface demonstrates a diffuse network of dilated, tortuous, and branching collateral venous circulation (caput medusae-like appearance) visible across the entire abdominal wall. The superficial veins appear bluish through the stretched, translucent skin. A medical monitoring electrode is attached to the lower left quadrant. This visual presentation is characteristic of increased intra-abdominal pressure or portal hypertension, leading to the recruitment of superficial portosystemic collaterals. In this clinical context, the distension is secondary to massive fecal impaction causing abdominal compartment syndrome. The image illustrates a critical sign of obstructive pathology and vascular compromise relevant to emergency medicine and gastroenterology.
gynaecomastia male breast cirrhosis
palmar erythema liver disease

Clinical photography of the palmar surface (volar aspect) of the hand demonstrating palmar erythema, a cutaneous vascular sign often associated with liver disease. Modality: Clinical photography; color image captured under bright, diffuse illumination to show true erythema without shadowing. Anatomical location: palm (thenar and hypothenar regions) of the hand; symmetric or asymmetric involvement may be observed, though the provided image shows patchy diffuse redness along the palmar creases. Visual features include diffuse, blanchable erythema most prominent on the central palmar regions; warm appearance; minimal or absent edema; no vesicles or scaling evident. Pathophysiology: estrogen-mediated cutaneous vascular dilation; may reflect hepatic dysfunction with portal circulation alterations or hyperestrogenism. Diagnostic significance: Palmar erythema can indicate liver disease (cirrhosis, chronic hepatitis, alcoholic liver disease) or conditions with elevated estrogen; in pregnancy or with estrogen therapy it may appear similarly. Differential considerations include pregnancy-related erythema, drug-induced flushing, autoimmune or rheumatologic conditions, and vasculitis; clinical correlation with liver function tests (ALT/AST, ALP, bilirubin, albumin), coagulation profile, and portal hypertension signs is essential. Clinical relevance: serves as a non-invasive bedside sign prompting hepatology evaluation, risk stratification, and longitudinal monitoring; useful in medical education to illustrate cutaneous markers of systemic disease and to teach differential diagnosis in dermatology and internal medicine.

This dermatology clinical photograph captures bilateral palmar erythema on the ventral surfaces of the hands. Imaging modality: standard color clinical photography of hands; perspective: anterior/palmar view; technique: even illumination, neutral white balance; no magnification or contrast agents. Anatomy: palmar skin over the thenar and hypothenar eminences; symmetric involvement of both extremities; no cutaneous edema or desquamation. Visual features: diffuse, uniform erythema ranging from light pink to deep red, more prominent on the thenar and mid-palmar regions; skin remains smooth with no vesicles, scaling, or fissuring; nails appear normal; no signs of telangiectasia. Pathologic correlation: in the absence of systemic signs or abnormal liver function tests, this pattern is characteristic of hereditary (familial) palmar erythema, a benign genetic trait. Diagnostic significance: supports a hereditary etiology, contrasts with acquired palmar erythema seen in liver disease, pregnancy, medications; bilateral symmetry and early onset in multiple family members strengthen diagnosis. Differential considerations: acquired palmar erythema due to liver disease, endocrine or drug-induced causes, systemic inflammatory conditions; clinical correlation with family history, growth/development, and laboratory evaluation advised. Clinical use cases: dermatology teaching, genetic counseling, differential diagnosis training, radiology/pathology correlation, and longitudinal patient monitoring for family members. This image exemplifies familial, non-systemic presentation patterns for education.
splenomegaly portal hypertension abdominal CT

"In males, hyperestrogenemia may also produce hypogonadism and gynecomastia." - Robbins, Cotran & Kumar

| Sign | Specific cause | Why |
|---|---|---|
| Dupuytren's contracture | Alcohol | Palmar fascia fibrosis triggered by alcohol's direct toxic effects on fibroblasts + altered fibronectin metabolism |
| Parotid swelling | Alcohol | Sialadenosis - autonomic neuropathy + acinar cell hypertrophy from alcohol toxicity and nutritional deficiency |
| Intoxication/withdrawal | Alcohol | Direct CNS effect of ethanol; GABA/NMDA receptor dysregulation on abstinence |
| Xanthelasma | PBC / NAFLD | Cholestasis prevents bile acid excretion → hypercholesterolaemia → cholesterol deposits in periorbital skin |
| Scratch marks | Cholestatic liver disease | Bile salts accumulate in skin (not bilirubin) → pruritogenic substances stimulate cutaneous itch receptors → severe, unrelenting itching |
| Clubbing | Hepatopulmonary syndrome | Shunting bypasses the lung and liver → circulating angiogenic factors (VEGF, PDGF) cause nail bed vascular proliferation |
CIRRHOSIS
│
├── Synthetic Failure
│ ├── Low Albumin → Leuconychia, Oedema, Ascites
│ └── Low Clotting Factors → Bruising + Coagulopathy
│
├── Metabolic Failure
│ └── High Oestrogen → Spider Naevi, Palmar Erythema,
│ Gynaecomastia, Loss of Body Hair
│
└── Portal Hypertension
├── Splenomegaly → Thrombocytopenia → Bruising
├── Caput Medusae (portosystemic shunts)
├── Ascites (with RAAS activation + splanchnic dilation)
└── Hepatic Encephalopathy (ammonia → astrocyte swelling)
Generate a flowchart or infographic of cirrhosis pathophysiology and clinical progression
mkdir -p /tmp/workspace/cirrhosis-infographic && ls /tmp/workspace/
~/cirrhosis-infographic/generate.py
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
from matplotlib.patches import FancyBboxPatch, FancyArrowPatch
import matplotlib.patheffects as pe
import numpy as np
# ── Canvas ──────────────────────────────────────────────────────────────────
fig = plt.figure(figsize=(26, 34), facecolor='#0d1b2a')
ax = fig.add_axes([0, 0, 1, 1])
ax.set_xlim(0, 26)
ax.set_ylim(0, 34)
ax.axis('off')
# ── Colour palette ───────────────────────────────────────────────────────────
C = dict(
bg = '#0d1b2a',
title_bg = '#1a3a5c',
cause_bg = '#c0392b',
fibrosis = '#8e44ad',
syn_fail = '#d35400',
met_fail = '#27ae60',
portal_ht = '#2980b9',
decomp = '#c0392b',
specific = '#16a085',
arrow = '#ecf0f1',
text_light= '#ecf0f1',
text_dark = '#1a1a2e',
subtext = '#bdc3c7',
gold = '#f1c40f',
white = '#ffffff',
)
# ══════════════════════════════════════════════════════════════════════════════
# Helper functions
# ══════════════════════════════════════════════════════════════════════════════
def box(ax, x, y, w, h, color, alpha=1.0, radius=0.3, zorder=3):
b = FancyBboxPatch((x - w/2, y - h/2), w, h,
boxstyle=f"round,pad=0.05,rounding_size={radius}",
facecolor=color, edgecolor='#ecf0f120',
linewidth=1.2, alpha=alpha, zorder=zorder)
ax.add_patch(b)
def txt(ax, x, y, s, size=9, color='#ecf0f1', bold=False, ha='center', va='center', zorder=5):
weight = 'bold' if bold else 'normal'
ax.text(x, y, s, fontsize=size, color=color, ha=ha, va=va,
fontweight=weight, zorder=zorder,
fontfamily='DejaVu Sans',
wrap=True)
def arrow(ax, x1, y1, x2, y2, color='#ecf0f1', lw=1.8, style='->', zorder=4):
ax.annotate('', xy=(x2, y2), xytext=(x1, y1),
arrowprops=dict(arrowstyle=style,
color=color,
lw=lw,
connectionstyle='arc3,rad=0'),
zorder=zorder)
def curved_arrow(ax, x1, y1, x2, y2, color='#ecf0f1', lw=1.8, rad=0.2, zorder=4):
ax.annotate('', xy=(x2, y2), xytext=(x1, y1),
arrowprops=dict(arrowstyle='->',
color=color,
lw=lw,
connectionstyle=f'arc3,rad={rad}'),
zorder=zorder)
def bullet_box(ax, cx, cy, title, bullets, box_w, box_h, bg_color,
title_size=8.5, bullet_size=7.8, zorder=3):
box(ax, cx, cy, box_w, box_h, bg_color, alpha=0.92, zorder=zorder)
# title strip
strip = FancyBboxPatch((cx - box_w/2, cy + box_h/2 - 0.52), box_w, 0.52,
boxstyle="round,pad=0.02,rounding_size=0.15",
facecolor='#00000040', edgecolor='none', zorder=zorder+1)
ax.add_patch(strip)
txt(ax, cx, cy + box_h/2 - 0.26, title, size=title_size,
bold=True, color=C['white'], zorder=zorder+2)
line_h = (box_h - 0.65) / (len(bullets) + 0.5)
for i, b in enumerate(bullets):
by = cy + box_h/2 - 0.72 - i * line_h
txt(ax, cx - box_w/2 + 0.22, by, '•', size=bullet_size,
color=C['gold'], ha='left', zorder=zorder+2)
txt(ax, cx - box_w/2 + 0.5, by, b, size=bullet_size,
color=C['text_light'], ha='left', zorder=zorder+2)
# ══════════════════════════════════════════════════════════════════════════════
# TITLE BANNER
# ══════════════════════════════════════════════════════════════════════════════
title_rect = FancyBboxPatch((0.3, 32.6), 25.4, 1.2,
boxstyle="round,pad=0.1,rounding_size=0.3",
facecolor=C['title_bg'], edgecolor=C['gold'],
linewidth=2.5, zorder=5)
ax.add_patch(title_rect)
txt(ax, 13, 33.28, 'CIRRHOSIS — Pathophysiology & Clinical Progression',
size=18, bold=True, color=C['gold'], zorder=6)
txt(ax, 13, 32.88, 'From Aetiology → Fibrosis → Synthetic/Metabolic Failure → Portal Hypertension → Decompensation',
size=10, color=C['subtext'], zorder=6)
# ══════════════════════════════════════════════════════════════════════════════
# ROW 1 — CAUSES (y ≈ 31.2)
# ══════════════════════════════════════════════════════════════════════════════
cause_y = 31.2
causes = [
('Alcohol\n(ALD)', '#c0392b'),
('Viral Hepatitis\n(HBV / HCV)', '#e67e22'),
('NAFLD / NASH\n(Metabolic)', '#f39c12'),
('Autoimmune\n(PBC, PSC, AIH)', '#8e44ad'),
('Genetic\n(Wilson\'s, Haemo-\nchromatosis)', '#2ecc71'),
('Other\n(Drugs, Biliary\nAtresia, Cardiac)', '#1abc9c'),
]
xs = np.linspace(2.5, 23.5, len(causes))
for (label, col), x in zip(causes, xs):
box(ax, x, cause_y, 3.5, 1.1, col, alpha=0.9)
txt(ax, x, cause_y, label, size=8.5, bold=True)
txt(ax, 13, 31.95, 'CAUSES OF CIRRHOSIS', size=10, bold=True, color=C['gold'])
# arrows from causes down to fibrosis box
for x in xs:
arrow(ax, x, cause_y - 0.55, x, 30.05, color='#ecf0f155', lw=1.2)
# ══════════════════════════════════════════════════════════════════════════════
# ROW 2 — HEPATIC FIBROSIS (y ≈ 29.6)
# ══════════════════════════════════════════════════════════════════════════════
fib_y = 29.6
box(ax, 13, fib_y, 18, 0.9, C['fibrosis'], alpha=0.95)
txt(ax, 13, fib_y + 0.17, 'HEPATIC INJURY → CHRONIC INFLAMMATION → STELLATE CELL ACTIVATION → COLLAGEN DEPOSITION → FIBROSIS / CIRRHOSIS',
size=8.8, bold=True)
txt(ax, 13, fib_y - 0.2,
'Architectural distortion: regenerative nodules replace functional parenchyma | Sinusoidal resistance ↑ | Hepatocyte mass ↓',
size=7.8, color=C['subtext'])
# ══════════════════════════════════════════════════════════════════════════════
# ROW 3 — THREE CORE FAILURES (y ≈ 28.3 header, boxes y ≈ 27.0)
# ══════════════════════════════════════════════════════════════════════════════
txt(ax, 13, 28.75, '▼ THREE CORE PATHOPHYSIOLOGICAL FAILURES ▼', size=10, bold=True, color=C['gold'])
# Draw three big columns
col_x = [4.5, 13.0, 21.5]
col_colors = [C['syn_fail'], C['met_fail'], C['portal_ht']]
col_titles = ['SYNTHETIC FAILURE', 'METABOLIC FAILURE', 'PORTAL HYPERTENSION']
col_bullets = [
['Albumin ↓ → Hypoalbuminaemia',
'Clotting factors (II,V,VII,IX,X) ↓',
'Thrombopoietin ↓',
'SHBG production impaired',
'Transferrin, ceruloplasmin ↓'],
['Oestrogen not cleared → Hyperoestrogenaemia',
'Testosterone not cleared (+ HPG suppressed)',
'Bilirubin conjugation fails → Jaundice',
'Ammonia not converted to urea → Encephalopathy',
'Bile acid metabolism impaired'],
['Sinusoidal fibrosis ↑ resistance',
'Splanchnic vasodilation (↑ NO)',
'Portal pressure > 12 mmHg',
'Portosystemic shunts open',
'Splenic congestion → Splenomegaly'],
]
for cx, col, title, bullets in zip(col_x, col_colors, col_titles, col_bullets):
bullet_box(ax, cx, 26.5, title, bullets,
box_w=7.8, box_h=3.0, bg_color=col,
title_size=9.5, bullet_size=8.0)
arrow(ax, 13, fib_y - 0.45, cx, 28.0, color='#ecf0f160', lw=1.5)
# ══════════════════════════════════════════════════════════════════════════════
# ROW 4 — CLINICAL SIGNS (from each failure column, y ≈ 23.5)
# ══════════════════════════════════════════════════════════════════════════════
txt(ax, 13, 24.75, '▼ RESULTING CLINICAL SIGNS ▼', size=10, bold=True, color=C['gold'])
sign_data = [
(4.5, C['syn_fail'], 'SYNTHETIC FAILURE SIGNS', [
'Leuconychia (white nails) — low albumin',
'Easy bruising / ecchymoses — low clotting factors',
'Peripheral oedema — low oncotic pressure',
'Prolonged PT / INR',
'Thrombocytopenia (+ hypersplenism)',
]),
(13.0, C['met_fail'], 'METABOLIC FAILURE SIGNS', [
'Spider naevi — oestrogen → arteriolar dilation',
'Palmar erythema — oestrogen → vasodilation',
'Gynaecomastia — ↑ oestrogen : ↓ testosterone',
'Loss of body hair & testicular atrophy',
'Jaundice — bilirubin accumulation',
'Parotid swelling (alcohol-specific)',
'Dupuytren\'s contracture (alcohol-specific)',
]),
(21.5, C['portal_ht'], 'PORTAL HYPERTENSION SIGNS', [
'Splenomegaly — splenic vein congestion',
'Caput medusae — para-umbilical collaterals',
'Haemorrhoids — anorectal varices',
'Oesophageal varices — ± massive haematemesis',
'Ascites — sinusoidal HTN + RAAS activation',
'Scratch marks — bile salts in skin (cholestasis)',
'Clubbing — hepatopulmonary syndrome',
]),
]
for cx, col, title, bullets in sign_data:
bullet_box(ax, cx, 22.6, title, bullets,
box_w=7.8, box_h=3.8, bg_color=col,
title_size=9.0, bullet_size=7.8)
arrow(ax, cx, 25.0, cx, 24.5, color='#ecf0f180', lw=2.0)
# ══════════════════════════════════════════════════════════════════════════════
# ROW 5 — ASCITES PATHOPHYSIOLOGY DETAIL (y ≈ 19.8)
# ══════════════════════════════════════════════════════════════════════════════
txt(ax, 13, 20.65, '▼ ASCITES: DETAILED MECHANISM ▼', size=10, bold=True, color=C['gold'])
asc_steps = [
(2.0, 19.5, 'Portal HTN\n(↑ sinusoidal\npressure)'),
(6.2, 19.5, 'Splanchnic\nArterial\nVasodilation\n(↑ NO)'),
(10.4, 19.5, 'Effective\nArterial\nHypovolaemia\n(underfilling)'),
(14.6, 19.5, 'RAAS + SNS\nActivation'),
(18.8, 19.5, 'Renal Na⁺ &\nH₂O Retention'),
(23.0, 19.5, 'ASCITES +\nOedema +\nDilutional\nHyponatraemia'),
]
for i, (x, y, label) in enumerate(asc_steps):
col = '#1a5276' if i < 5 else '#922b21'
box(ax, x, y, 3.5, 1.5, col, alpha=0.92)
txt(ax, x, y, label, size=7.8, bold=(i == 5))
if i < len(asc_steps) - 1:
arrow(ax, x + 1.75, y, asc_steps[i+1][0] - 1.75, y,
color=C['gold'], lw=1.8)
# add low albumin contribution
box(ax, 10.4, 17.85, 3.5, 0.75, '#6e2f1a', alpha=0.92)
txt(ax, 10.4, 17.85, 'Hypoalbuminaemia → ↓ Oncotic Pressure (also contributes)', size=7.5)
arrow(ax, 10.4, 18.22, 10.4, 18.75, color='#ecf0f180', lw=1.4)
# ══════════════════════════════════════════════════════════════════════════════
# ROW 6 — HEPATIC ENCEPHALOPATHY DETAIL (y ≈ 16.8)
# ══════════════════════════════════════════════════════════════════════════════
txt(ax, 13, 17.35, '▼ HEPATIC ENCEPHALOPATHY: MECHANISM ▼', size=10, bold=True, color=C['gold'])
he_steps = [
(2.2, 16.3, 'Liver Failure\n+\nGut Bacteria\nproducing NH₃'),
(6.5, 16.3, 'Ammonia (NH₃)\nnot cleared\n→ enters blood'),
(10.8, 16.3, 'NH₃ crosses\nBlood-Brain\nBarrier'),
(15.1, 16.3, 'Astrocytes\nconvert NH₃\nto Glutamine\n→ Astrocyte\nSwelling'),
(19.4, 16.3, 'Cerebral\nOedema +\nGABA↑ inhibition'),
(23.5, 16.3, 'Encephalopathy\nStages I–IV\n+ Asterixis\n(Flapping Tremor)'),
]
for i, (x, y, label) in enumerate(he_steps):
col = '#1d3557' if i < 5 else '#922b21'
box(ax, x, y, 3.8, 1.75, col, alpha=0.92)
txt(ax, x, y, label, size=7.6, bold=(i == 5))
if i < len(he_steps) - 1:
arrow(ax, x + 1.9, y, he_steps[i+1][0] - 1.9, y,
color=C['gold'], lw=1.8)
# Grading box
box(ax, 13, 14.4, 14, 1.2, '#2c3e50', alpha=0.92)
txt(ax, 13, 14.78, 'West-Haven Grading of Hepatic Encephalopathy', size=9, bold=True, color=C['gold'])
grades = 'Grade I: Mild confusion, sleep disturbance | Grade II: Lethargy, asterixis | Grade III: Somnolence, gross disorientation | Grade IV: Coma'
txt(ax, 13, 14.38, grades, size=8, color=C['subtext'])
# ══════════════════════════════════════════════════════════════════════════════
# ROW 7 — DECOMPENSATION + COMPLICATIONS (y ≈ 13.0)
# ══════════════════════════════════════════════════════════════════════════════
txt(ax, 13, 13.65, '▼ DECOMPENSATION & LIFE-THREATENING COMPLICATIONS ▼',
size=10, bold=True, color='#e74c3c')
comp_data = [
(3.0, 12.3, '#922b21', 'VARICEAL\nBLEEDING',
['Oesophageal / gastric varices',
'Portal pressure > 12 mmHg',
'~40% of cirrhotics develop',
'30% mortality per bleed',
'Tx: terlipressin, banding,\n TIPS, propranolol (prophylaxis)']),
(8.5, 12.3, '#1a5276', 'SPONTANEOUS\nBACTERIAL\nPERITONITIS (SBP)',
['Bacterial translocation across\n gut wall into ascitic fluid',
'Neutrophil count >250/mm³',
'E. coli most common',
'Triggers hepatorenal syndrome',
'Tx: cefotaxime + albumin']),
(14.0, 12.3, '#145a32', 'HEPATORENAL\nSYNDROME (HRS)',
['Renal vasoconstriction from\n RAAS/SNS over-activation',
'No structural renal lesion',
'Oliguria, rising creatinine',
'Type 1 (acute) vs Type 2 (chronic)',
'Tx: terlipressin + albumin;\n transplant definitive']),
(19.5, 12.3, '#4a235a', 'HEPATOCELLULAR\nCARCINOMA (HCC)',
['Chronic regeneration + oxidative\n stress → DNA mutation',
'HBV/HCV/NAFLD highest risk',
'AFP + imaging surveillance\n every 6 months',
'6-month survival without Tx < 50%',
'Tx: resection, RFA, TACE, transplant']),
(24.5, 12.3, '#6e2f1a', 'HEPATIC\nHYDROTHORAX',
['Ascites crosses diaphragm\n via small defects',
'Usually right-sided',
'Dyspnoea, hypoxia',
'Tx: diuretics; TIPS;\n avoid repeated drainage']),
]
for cx, cy, col, title, bullets in comp_data:
w = 4.7 if cx != 24.5 else 4.5
bullet_box(ax, cx, cy, title, bullets, box_w=w, box_h=3.2,
bg_color=col, title_size=8.5, bullet_size=7.4, zorder=3)
# ══════════════════════════════════════════════════════════════════════════════
# ROW 8 — COMPENSATED vs DECOMPENSATED + PROGNOSIS (y ≈ 8.8)
# ══════════════════════════════════════════════════════════════════════════════
txt(ax, 13, 10.45, '▼ CLINICAL STAGING ▼', size=10, bold=True, color=C['gold'])
# Compensated
box(ax, 5.5, 9.3, 9.5, 1.8, '#1a5276', alpha=0.92)
txt(ax, 5.5, 9.78, 'COMPENSATED CIRRHOSIS', size=9.5, bold=True, color=C['gold'])
txt(ax, 5.5, 9.38, 'Asymptomatic or mild | No ascites / encephalopathy / varices | Near-normal synthetic function', size=8)
txt(ax, 5.5, 9.05, 'Median survival > 12 years | Annual decompensation risk ~5%', size=8, color='#82e0aa')
# Decompensated
box(ax, 18.5, 9.3, 9.5, 1.8, '#922b21', alpha=0.92)
txt(ax, 18.5, 9.78, 'DECOMPENSATED CIRRHOSIS', size=9.5, bold=True, color=C['gold'])
txt(ax, 18.5, 9.38, 'Ascites / encephalopathy / variceal bleed / jaundice | Synthetic failure', size=8)
txt(ax, 18.5, 9.05, '2-year survival ~50% without transplant | MELD score guides transplant listing', size=8, color='#f1948a')
# Arrow between them
arrow(ax, 10.25, 9.3, 13.75, 9.3, color=C['gold'], lw=2.5, style='->')
txt(ax, 12.0, 9.6, 'Trigger event:', size=7.5, color=C['gold'])
txt(ax, 12.0, 9.28, 'Infection / Bleed\nAlcohol / Surgery', size=7.2, color=C['subtext'])
# ══════════════════════════════════════════════════════════════════════════════
# ROW 9 — SCORING SYSTEMS (y ≈ 7.7)
# ══════════════════════════════════════════════════════════════════════════════
box(ax, 13, 7.55, 24, 1.5, '#1c2833', alpha=0.95)
txt(ax, 13, 7.95, 'PROGNOSTIC SCORING', size=9.5, bold=True, color=C['gold'])
scoring = ('Child-Pugh Score (Bilirubin + Albumin + PT + Ascites + Encephalopathy): '
'Class A = 5-6 pts (good) | Class B = 7-9 pts (moderate) | Class C = 10-15 pts (poor, 1-yr survival ~45%) '
'MELD Score (Creatinine + Bilirubin + INR): predicts 90-day mortality | Score > 15 → transplant listing')
txt(ax, 13, 7.55, scoring, size=7.8, color=C['subtext'])
# ══════════════════════════════════════════════════════════════════════════════
# ROW 10 — TREATMENT OVERVIEW (y ≈ 5.8)
# ══════════════════════════════════════════════════════════════════════════════
txt(ax, 13, 6.85, '▼ MANAGEMENT OVERVIEW ▼', size=10, bold=True, color=C['gold'])
tx_data = [
(2.8, 5.6, '#1a5276', 'TREAT\nAETIOLOGY',
['Alcohol: abstinence',
'HBV: tenofovir/entecavir',
'HCV: DAA 8-12 weeks (cure)',
'NAFLD: weight loss, GLP-1',
'Autoimmune: steroids/UDCA']),
(8.0, 5.6, '#145a32', 'PREVENT\nCOMPLICATIONS',
['Propranolol: varices prophylaxis',
'Norfloxacin: SBP prophylaxis',
'Low Na diet + spironolactone:\n ascites',
'Lactulose + rifaximin: HE',
'HCC surveillance: USS + AFP']),
(13.2, 5.6, '#4a235a', 'MANAGE\nDECOMPENSATION',
['Variceal bleed: terlipressin\n + banding ± TIPS',
'SBP: cefotaxime + albumin',
'HRS: terlipressin + albumin',
'Ascites: diuretics / paracentesis',
'HE: lactulose, rifaximin, low NH₃']),
(18.4, 5.6, '#7b241c', 'LIVER\nTRANSPLANT',
['Definitive treatment',
'Indicated: MELD ≥ 15 / CTP C',
'Contraindications: active alcohol\n use, extrahepatic malignancy',
'5-yr survival post-Tx: ~75%',
'Living-donor or cadaveric']),
(23.2, 5.6, '#0e6655', 'MONITORING',
['LFTs, albumin, INR: 3-monthly',
'Endoscopy: varices q1-3 yr',
'USS + AFP: 6-monthly',
'DEXA: osteoporosis screen',
'Nephrology if HRS risk']),
]
for cx, cy, col, title, bullets in tx_data:
bullet_box(ax, cx, cy, title, bullets, box_w=4.6, box_h=3.0,
bg_color=col, title_size=8.5, bullet_size=7.4, zorder=3)
# ══════════════════════════════════════════════════════════════════════════════
# LEGEND / FOOTER
# ══════════════════════════════════════════════════════════════════════════════
box(ax, 13, 1.55, 24.5, 1.5, '#1c2833', alpha=0.95)
legend_items = [
(C['syn_fail'], 'Synthetic Failure'),
(C['met_fail'], 'Metabolic Failure'),
(C['portal_ht'], 'Portal Hypertension'),
(C['decomp'], 'Decompensation / Complications'),
('#145a32', 'Management'),
('#4a235a', 'Prognostic Tools'),
]
legend_xs = np.linspace(2.5, 23.5, len(legend_items))
for (col, label), lx in zip(legend_items, legend_xs):
rect = FancyBboxPatch((lx - 1.5, 1.28), 0.3, 0.35,
boxstyle="round,pad=0.02",
facecolor=col, edgecolor='none', zorder=6)
ax.add_patch(rect)
txt(ax, lx - 1.1, 1.46, label, size=7.5, color=C['subtext'], ha='left', zorder=6)
txt(ax, 13, 0.85,
'Sources: Robbins & Kumar Pathologic Basis of Disease | Sleisenger & Fordtran\'s GI and Liver Disease | Harrison\'s Principles of Internal Medicine 22E | Goldman-Cecil Medicine',
size=7.0, color='#7f8c8d')
# ══════════════════════════════════════════════════════════════════════════════
# SAVE
# ══════════════════════════════════════════════════════════════════════════════
out = '/tmp/workspace/cirrhosis-infographic/cirrhosis_pathophysiology.png'
plt.savefig(out, dpi=180, bbox_inches='tight', facecolor=fig.get_facecolor())
print(f"Saved: {out}")
plt.close()
cd /tmp/workspace/cirrhosis-infographic && python generate.py 2>&1
ls -lh /tmp/workspace/cirrhosis-infographic/cirrhosis_pathophysiology.png
cirrhosis pathophysiology
Image · PNG
| Layer | Content |
|---|---|
| 1 - Causes | Alcohol, HBV/HCV, NAFLD, Autoimmune, Genetic, Other |
| 2 - Fibrosis pathway | Injury → Inflammation → Stellate cell activation → Collagen → Cirrhosis |
| 3 - Three core failures | Synthetic / Metabolic / Portal hypertension - with mechanisms |
| 4 - Clinical signs | Every sign mapped to its failure pathway and mechanism |
| 5 - Ascites mechanism | Step-by-step: portal HTN → splanchnic vasodilation → RAAS activation → fluid retention |
| 6 - Hepatic encephalopathy | NH₃ → crosses BBB → astrocyte swelling → cerebral oedema → West-Haven grading |
| 7 - Complications | Variceal bleeding, SBP, HRS, HCC, Hepatic hydrothorax |
| 8 - Staging | Compensated vs Decompensated with survival figures |
| 9 - Scoring | Child-Pugh and MELD score criteria |
| 10 - Management | Aetiology-specific treatment, prophylaxis, decompensation management, transplant, monitoring |