Museum specimen
| Specimen | Gross Appearance |
|---|---|
| Renal Cell Carcinoma (Clear Cell) | Upper pole of kidney. Spherical, well-encapsulated mass. Cut section shows variegated appearance - yellow (lipid-laden cells), golden, with areas of hemorrhage (red-brown) and necrosis (white). "Multicolored" is classic. |
| Wilms' Tumor (Nephroblastoma) | Large, well-encapsulated mass in child's kidney. Soft, grey-white, fish-flesh appearance. May show cystic areas. Compressed normal kidney at periphery. |
| Hydronephrosis | Kidney is grossly enlarged. Renal pelvis & calyces massively dilated. Cortex thinned/compressed to a thin rim. Parenchyma atrophied. |
| Polycystic Kidney Disease (ADPKD) | Both kidneys grossly enlarged (can be up to 4 kg each). Entire parenchyma replaced by innumerable cysts of varying sizes filled with clear/straw-colored fluid. Normal renal tissue barely visible. |
| Chronic Pyelonephritis | Kidney small and contracted. Irregular, coarse, U-shaped scars (corticomedullary scars) with underlying blunted, dilated calyces - "clubbing." Asymmetric involvement. |
| Renal TB | Cavitary lesions with caseous (cheese-like) white necrosis. Dystrophic calcification may be present. "Putty kidney" - completely calcified kidney. |
| Renal Calculi | Staghorn calculus fills the pelvis and major calyces, taking the shape of a stag's antlers. May be associated with hydronephrosis. |
| Specimen | Gross Appearance |
|---|---|
| Transitional Cell Carcinoma (Urothelial Ca) | Papillary, frond-like projections (low grade) OR flat, sessile, infiltrating mass (high grade). Commonly at trigone or lateral walls. Surface may be irregular, hemorrhagic. |
| Chronic Cystitis | Bladder wall thickened. Mucosa congested, granular, or trabeculated (due to hypertrophy of detrusor muscle from obstruction). |
| Bladder Calculi | Smooth, laminated stones free in the bladder lumen. May be single large stone or multiple small ones. |
| Exstrophy of Bladder | (Congenital specimen) Bladder open anteriorly, mucosa exposed. Seen with pubic symphysis diastasis. |
| Specimen | Gross Appearance |
|---|---|
| Seminoma | Most common. Testis enlarged, tunica albuginea intact initially. Cut section: homogeneous, cream/grey-white, lobulated solid tumor. Soft, "fish-flesh" consistency. No necrosis or hemorrhage (distinguishes from non-seminomatous). |
| Teratoma (Mature) | Cystic areas with cartilage, hair, sebaceous material. Multiloculated cyst with mixed solid areas. Heterogeneous cut surface. |
| Embryonal Carcinoma | Cut section shows variegated, grey-white to tan tumor with areas of hemorrhage and necrosis. Less homogeneous than seminoma. |
| Yolk Sac Tumor | Pale grey, mucoid/gelatinous appearance. Common in children. |
| Torsion of Testis | Testis dark red-purple (hemorrhagic infarction). Swollen, congested. Cord twisted above. |
| Epididymo-orchitis | Enlarged, congested testis with yellow-green pus if abscess present. |
| Cryptorchidism | Small, atrophic testis found in inguinal canal or abdominal cavity. |
| Specimen | Gross Appearance |
|---|---|
| Carcinoma Stomach (Antrum) | Ulcero-proliferative mass, most at lesser curvature/antrum. Irregular, everted, heaped-up edges with necrotic base ("malignant ulcer"). Linitis plastica - entire stomach leather-bottle shaped, rigid, contracted (diffuse infiltrating type). |
| Peptic Ulcer | Punched-out, clean-based ulcer with regular, smooth, non-everted edges ("benign ulcer"). Typically on lesser curvature or duodenal bulb. |
| Carcinoma Colon | (a) Annular/napkin-ring type - circumferential constriction causing obstruction (common in left colon). (b) Fungating/cauliflower - projecting mass (common in right colon/cecum). |
| Hirschsprung Disease | Segment of contracted, narrow distal colon (aganglionic) with massively dilated proximal colon (megacolon). |
| Intussusception | Segment of bowel telescoped into distal segment. Sausage-shaped mass. Edematous, congested bowel. |
| Intestinal TB | Transverse ulcers encircling the ileum (healed โ strictures). Serosal tubercles. Matted lymph nodes. |
| Crohn's Disease | Skip lesions (segmental involvement). Cobblestone mucosa. Creeping fat on serosa. Fissure ulcers. Thickened wall. |
| Carcinoid Tumor | Small submucosal nodule, firm, yellow-grey. Ileum most common. Peritoneal puckering/fibrosis nearby. |
| Specimen | Gross Appearance |
|---|---|
| Chronic Cholecystitis | Gallbladder wall thickened and fibrotic. Lumen may contain gallstones (cholesterol stones - yellow, faceted, crystalline OR pigment stones - small, black/dark brown, amorphous). Mucosa pale, atrophied. |
| Acute Cholecystitis | Gallbladder distended, serosa red and fibrinous (periholecystic exudate). Wall edematous. Purulent bile inside. |
| Carcinoma Gallbladder | Fundus most common. Diffuse thickening and infiltration of wall (flat type) OR polypoid/papillary mass projecting into lumen. Grey-white, firm. Often with stones in lumen. |
| Mucocele of GB | Grossly distended gallbladder filled with clear mucus (cystic duct obstructed by stone, no infection). |
| Empyema GB | Distended GB filled with frank pus. |
| Strawberry GB | Small yellow flecks on mucosal surface (cholesterolosis) - yellow deposits on pink/red mucosa resembling strawberry skin. |
| Specimen | Gross Appearance |
|---|---|
| Hepatocellular Carcinoma (HCC) | Large, yellowish-green (bile-stained) or greenish-brown mass. May be solitary, massive OR multinodular. Soft, necrotic, hemorrhagic center. Background cirrhotic liver common. |
| Macronodular Cirrhosis | Liver initially enlarged, later shrunken and firm. Cut surface shows large nodules (>3 mm) of regenerating hepatocytes separated by broad bands of fibrous tissue (post-necrotic/viral). |
| Micronodular Cirrhosis (Alcoholic) | Small, uniform nodules (<3 mm) separated by thin fibrous bands. Liver surface finely granular ("hobnail liver"). Initially enlarged (fatty) โ later small and shrunken. |
| Fatty Liver (Steatosis) | Enlarged, soft, greasy liver. Cut surface pale yellow. Rounded edges. "Nutmeg" pattern NOT present here (nutmeg = congestion). |
| Nutmeg Liver (Chronic Venous Congestion) | Cut surface shows alternating red (congested central veins) and yellow (periportal fat) areas resembling a nutmeg. Seen in right heart failure. |
| Amoebic Liver Abscess | Single large abscess, usually in right lobe. Contents: chocolate/anchovy sauce-colored pus (sterile, liquefied hepatocytes + RBCs). Shaggy walls. |
| Pyogenic Liver Abscess | Multiple small abscesses with yellow pus. Walls of fibrous tissue. |
| Hepatic Metastases | Multiple nodules of varying sizes scattered throughout both lobes. White/pale. Umbilicated centers (central necrosis causing central depression). "Canon-ball" metastases. |
| Echinococcal (Hydatid) Cyst | Large cyst with thick laminated white wall (endocyst). Daughter cysts inside. Contents: "hydatid sand" (scolices). Usually right lobe. |
| Portal Hypertension | Not a single specimen - shown by splenomegaly, ascites, esophageal varices. |
Create a printable PDF reference card for museum specimen gross appearance
mkdir -p /tmp/workspace/museum-specimen-pdf && ls /tmp/workspace/museum-specimen-pdf/
~/museum-specimen-pdf/generate_pdf.py
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.units import cm, mm
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
HRFlowable, KeepTogether, PageBreak
)
from reportlab.lib.enums import TA_CENTER, TA_LEFT
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont
# โโ Colour palette โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
C_KIDNEY = colors.HexColor('#C0392B') # deep red
C_BLADDER = colors.HexColor('#2471A3') # blue
C_TESTIS = colors.HexColor('#1E8449') # green
C_GI = colors.HexColor('#D35400') # orange
C_GB = colors.HexColor('#B7950B') # gold
C_LIVER = colors.HexColor('#6C3483') # purple
C_TIPS = colors.HexColor('#1A5276') # dark navy
C_LIGHT_GREY = colors.HexColor('#F4F6F7')
C_ROW_ALT = colors.HexColor('#EBF5FB')
C_HEADER_TXT = colors.white
C_DARK = colors.HexColor('#17202A')
PAGE_W, PAGE_H = A4
MARGIN = 1.5 * cm
# โโ Styles โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
styles = getSampleStyleSheet()
def make_style(name, **kwargs):
return ParagraphStyle(name, **kwargs)
TITLE_STYLE = make_style('Title2',
fontSize=20, leading=24, alignment=TA_CENTER,
textColor=C_DARK, fontName='Helvetica-Bold', spaceAfter=4)
SUBTITLE_STYLE = make_style('Sub',
fontSize=10, leading=14, alignment=TA_CENTER,
textColor=colors.HexColor('#555555'), fontName='Helvetica', spaceAfter=2)
SECTION_STYLE = make_style('Section',
fontSize=12, leading=15, textColor=C_HEADER_TXT,
fontName='Helvetica-Bold', alignment=TA_LEFT)
SPEC_NAME_STYLE = make_style('SpecName',
fontSize=9, leading=12, fontName='Helvetica-Bold',
textColor=C_DARK)
SPEC_DESC_STYLE = make_style('SpecDesc',
fontSize=8.5, leading=12, fontName='Helvetica',
textColor=C_DARK)
KEYWORD_STYLE = make_style('Keyword',
fontSize=8, leading=11, fontName='Helvetica-Bold',
textColor=colors.HexColor('#C0392B'))
TIP_BODY_STYLE = make_style('TipBody',
fontSize=8.5, leading=12, fontName='Helvetica',
textColor=C_DARK)
STEP_STYLE = make_style('Step',
fontSize=8.5, leading=12, fontName='Helvetica-Bold',
textColor=C_DARK)
FOOTER_STYLE = make_style('Footer',
fontSize=7, alignment=TA_CENTER,
textColor=colors.HexColor('#888888'), fontName='Helvetica')
# โโ Helper: section header โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
def section_header(text, color):
data = [[Paragraph(text, SECTION_STYLE)]]
t = Table(data, colWidths=[PAGE_W - 2*MARGIN])
t.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,-1), color),
('TOPPADDING', (0,0), (-1,-1), 6),
('BOTTOMPADDING', (0,0), (-1,-1), 6),
('LEFTPADDING', (0,0), (-1,-1), 10),
('RIGHTPADDING', (0,0), (-1,-1), 10),
('ROUNDEDCORNERS', [4,4,4,4]),
]))
return t
# โโ Helper: specimen table โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
def specimen_table(rows, accent_color):
"""rows = list of (specimen_name, gross_description, buzzword)"""
col_widths = [4.5*cm, 10.5*cm, 3.8*cm]
# Header row
header = [
Paragraph('Specimen', make_style('H', fontSize=8, fontName='Helvetica-Bold', textColor=C_HEADER_TXT)),
Paragraph('Gross Appearance', make_style('H2', fontSize=8, fontName='Helvetica-Bold', textColor=C_HEADER_TXT)),
Paragraph('Buzzword', make_style('H3', fontSize=8, fontName='Helvetica-Bold', textColor=C_HEADER_TXT)),
]
table_data = [header]
for i, (name, desc, buzz) in enumerate(rows):
table_data.append([
Paragraph(name, SPEC_NAME_STYLE),
Paragraph(desc, SPEC_DESC_STYLE),
Paragraph(f'<i>"{buzz}"</i>', KEYWORD_STYLE),
])
light = colors.HexColor(_lighten_hex(accent_color.hexval() if hasattr(accent_color,'hexval') else accent_color.hexColor() if hasattr(accent_color,'hexColor') else '#888888', 0.88))
ts = TableStyle([
# Header
('BACKGROUND', (0,0), (-1,0), accent_color),
('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'),
('FONTSIZE', (0,0), (-1,0), 8),
('TEXTCOLOR', (0,0), (-1,0), C_HEADER_TXT),
# Alternating rows
('ROWBACKGROUNDS', (0,1), (-1,-1), [C_LIGHT_GREY, C_ROW_ALT]),
# Grid
('GRID', (0,0), (-1,-1), 0.4, colors.HexColor('#CCCCCC')),
('LINEBELOW', (0,0), (-1,0), 1.2, accent_color),
# Padding
('TOPPADDING', (0,0), (-1,-1), 4),
('BOTTOMPADDING', (0,0), (-1,-1), 4),
('LEFTPADDING', (0,0), (-1,-1), 6),
('RIGHTPADDING', (0,0), (-1,-1), 6),
('VALIGN', (0,0), (-1,-1), 'TOP'),
])
t = Table(table_data, colWidths=col_widths, repeatRows=1)
t.setStyle(ts)
return t
def _lighten_hex(hexstr, factor):
"""Not used - using predefined light colours instead."""
return '#EBF5FB'
# โโ DATA โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
KIDNEY_ROWS = [
('Renal Cell Ca\n(Clear Cell)',
'Spherical mass, upper pole. Cut surface: <b>variegated</b> - yellow (lipid), red-brown (haemorrhage), white (necrosis). Well-encapsulated.',
'Multicolored / Variegated'),
('Wilms\' Tumor\n(Nephroblastoma)',
'Large, well-encapsulated mass in child. Soft, <b>grey-white, fish-flesh</b>. Cystic areas. Compressed normal kidney at periphery.',
'Fish-flesh, child\'s kidney'),
('Hydronephrosis',
'Kidney grossly enlarged. Renal pelvis & calyces <b>massively dilated</b>. Cortex thinned to a rim. Parenchyma atrophied.',
'Dilated pelvis, thinned cortex'),
('Polycystic Kidney\n(ADPKD)',
'Both kidneys hugely enlarged (up to 4 kg). Entire parenchyma replaced by <b>innumerable cysts</b> - clear/straw fluid. Barely any normal tissue.',
'Innumerable cysts'),
('Chronic\nPyelonephritis',
'Small, contracted kidney. Irregular <b>U-shaped corticomedullary scars</b> with underlying blunted, clubbed calyces. Asymmetric.',
'U-shaped scars, clubbed calyces'),
('Renal TB',
'<b>Caseous (cheese-like) white necrosis</b> in cavities. Dystrophic calcification. End-stage: "putty kidney" - completely calcified.',
'Putty kidney / Caseous necrosis'),
('Staghorn Calculus',
'Stone <b>fills pelvis and calyces</b>, shaped like a stag\'s antlers. Associated hydronephrosis common.',
'Stag\'s antler shape'),
]
BLADDER_ROWS = [
('TCC / Urothelial\nCarcinoma',
'<b>Papillary frond-like</b> projections (low grade) OR flat, sessile, infiltrating mass (high grade). At trigone/lateral walls. Haemorrhagic surface.',
'Papillary fronds or flat-infiltrating'),
('Chronic Cystitis',
'Wall <b>thickened and trabeculated</b> (detrusor hypertrophy from obstruction). Mucosa congested, granular.',
'Trabeculated wall'),
('Bladder Calculi',
'<b>Smooth, laminated stones</b> free in lumen. Single large or multiple small. Associated mucosal inflammation.',
'Laminated stones'),
('Carcinoma Bladder\n(Invasive)',
'Large, <b>sessile infiltrating mass</b>, firm, grey-white. Invades muscle wall. Often necrotic surface. Trigone common site.',
'Sessile infiltrating mass'),
]
TESTIS_ROWS = [
('Seminoma',
'Enlarged testis, tunica intact early. Cut: <b>homogeneous cream/grey-white, lobulated</b>. Soft, fish-flesh. No haemorrhage or necrosis.',
'Homogeneous cream-white'),
('Teratoma\n(Mature)',
'<b>Multiloculated cyst</b> with cartilage, hair, sebaceous material. Heterogeneous cut surface. Mixed solid/cystic.',
'Mixed cystic, cartilage, hair'),
('Embryonal\nCarcinoma',
'<b>Variegated grey-white to tan</b> tumor with haemorrhage and necrosis. Less homogeneous than seminoma.',
'Variegated with necrosis'),
('Testicular Torsion',
'Testis <b>dark red-purple</b> (haemorrhagic infarction). Swollen, congested. Cord twisted above.',
'Dark red-purple, hemorrhagic'),
('Cryptorchidism',
'<b>Small, atrophic testis</b> in inguinal canal or abdomen. Firm, reduced size. โ risk malignancy.',
'Atrophic testis, maldescended'),
]
GI_ROWS = [
('Ca Stomach\n(Ulcero-proliferative)',
'Irregular mass, lesser curvature/antrum. <b>Everted, heaped-up edges</b> with necrotic floor - classic malignant ulcer appearance.',
'Heaped-up everted edges'),
('Linitis Plastica\n(Diffuse Gastric Ca)',
'Entire stomach contracted, rigid, <b>leather-bottle shaped</b>. Wall diffusely thickened. Lumen greatly reduced.',
'Leather-bottle stomach'),
('Peptic Ulcer',
'<b>Punched-out, clean-based</b> ulcer with regular, smooth, non-everted edges. Lesser curvature (stomach) or duodenal bulb.',
'Punched-out, non-everted edges'),
('Ca Colon - Annular',
'<b>Circumferential ring/napkin-ring</b> constriction. Common in left colon. Causes obstruction. Edges raised.',
'Napkin-ring / Apple-core'),
('Ca Colon - Fungating',
'<b>Cauliflower-like fungating mass</b> projecting into lumen. Common in right colon/caecum. Irregular, friable surface.',
'Cauliflower mass'),
('Crohn\'s Disease',
'<b>Skip lesions</b>, cobblestone mucosa, creeping fat on serosa. Fissure ulcers. Thickened wall. Transmural.',
'Skip lesions, cobblestone'),
('Intestinal TB',
'<b>Transverse/annular ulcers</b> encircling ileum (at ileocaecal junction). Healed โ strictures. Serosal tubercles. Matted nodes.',
'Transverse ulcers, strictures'),
('Intussusception',
'Bowel <b>telescoped</b> into distal segment. Sausage-shaped mass. Oedematous, congested bowel.',
'Sausage-shaped, telescoped'),
]
GB_ROWS = [
('Chronic Cholecystitis\n+ Gallstones',
'GB wall <b>thickened and fibrotic</b>. Lumen has stones: cholesterol (yellow, faceted, crystalline) or pigment (small, black, amorphous). Mucosa pale.',
'Thickened wall + stones'),
('Acute Cholecystitis',
'GB <b>distended</b>, serosa red with fibrinous exudate. Wall oedematous. Purulent bile inside. Cystic duct obstructed.',
'Distended, fibrinous serosa'),
('Ca Gallbladder',
'Fundus most common. <b>Diffuse wall thickening</b> (flat type) OR polypoid/papillary mass. Grey-white, firm. Often associated stones.',
'Diffuse thickening, fundus'),
('Mucocele of GB',
'Grossly <b>distended GB filled with clear mucus</b>. Cystic duct obstructed by stone. No infection. Thin wall.',
'Distended, clear mucus'),
('Empyema of GB',
'Distended GB filled with <b>frank pus</b>. Extremely tender in life. Wall oedematous, congested.',
'Pus-filled GB'),
('Strawberry GB',
'<b>Yellow flecks</b> on pink/red mucosa (cholesterolosis - cholesterol deposits). Resembles skin of a strawberry.',
'Yellow flecks = strawberry'),
]
LIVER_ROWS = [
('HCC',
'Large <b>yellow-green (bile-stained)</b> or greenish-brown mass. Solitary/multinodular. Soft, necrotic centre. Often on cirrhotic background.',
'Yellow-green, bile-stained'),
('Micronodular Cirrhosis\n(Alcoholic)',
'Small <b>uniform nodules <3 mm</b>, thin fibrous bands. Surface finely granular ("hobnail liver"). Initially enlarged (fatty) โ later shrunken.',
'Hobnail liver'),
('Macronodular Cirrhosis\n(Post-viral)',
'<b>Large nodules >3 mm</b>, broad fibrous bands. Liver firm, shrunken. Cut surface: irregular nodularity.',
'Large nodules, broad fibrosis'),
('Nutmeg Liver\n(Chronic Congestion)',
'Cut surface shows <b>alternating red (congested central veins) and yellow (periportal fat)</b> - resembles cut nutmeg. Right heart failure.',
'Nutmeg pattern'),
('Fatty Liver\n(Steatosis)',
'<b>Enlarged, soft, greasy, pale yellow</b>. Rounded edges. Floats in formalin. No nodularity.',
'Greasy, pale yellow, floats'),
('Amoebic Liver Abscess',
'Single large abscess, <b>right lobe</b>. Contents: <b>chocolate/anchovy sauce-coloured pus</b> (liquefied hepatocytes + RBCs). Shaggy walls.',
'Anchovy sauce pus'),
('Hepatic Metastases',
'<b>Multiple pale nodules</b>, both lobes. <b>Umbilicated centres</b> (central necrosis โ central depression). "Cannon-ball" metastases.',
'Umbilicated, cannon-ball'),
('Hydatid Cyst\n(Echinococcus)',
'Large cyst, <b>right lobe</b>. Thick <b>laminated white wall</b> (endocyst). Daughter cysts inside. "Hydatid sand" (scolices).',
'Laminated wall, daughter cysts'),
]
APPROACH_STEPS = [
('1', 'ORGAN', 'Identify which organ - size, shape, colour'),
('2', 'SURFACE', 'Smooth / nodular / granular / scarred / irregular'),
('3', 'CUT SURFACE', 'Colour, texture, any masses, cavities, necrosis'),
('4', 'ABNORMALITY', 'Location, size, edges, contents, walls'),
('5', 'DIAGNOSIS', 'State your diagnosis confidently'),
('6', 'BUZZWORD', 'Give the ONE classic distinguishing feature'),
]
# โโ Page callbacks โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
def add_page_number(canvas, doc):
canvas.saveState()
canvas.setFont('Helvetica', 7)
canvas.setFillColor(colors.HexColor('#888888'))
canvas.drawCentredString(PAGE_W / 2, 0.7 * cm,
f'Pathology Museum Specimen Reference | Page {doc.page} | Gross Appearance Quick Reference')
# Top stripe
canvas.setFillColor(C_DARK)
canvas.rect(0, PAGE_H - 1*cm, PAGE_W, 1*cm, fill=1, stroke=0)
canvas.setFillColor(colors.white)
canvas.setFont('Helvetica-Bold', 9)
canvas.drawCentredString(PAGE_W/2, PAGE_H - 0.65*cm,
'PATHOLOGY MUSEUM SPECIMENS | GROSS / MACROSCOPIC APPEARANCE')
canvas.restoreState()
# โโ Build PDF โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
def build():
out_path = '/tmp/workspace/museum-specimen-pdf/Museum_Specimen_Gross_Appearance.pdf'
doc = SimpleDocTemplate(
out_path,
pagesize=A4,
leftMargin=MARGIN, rightMargin=MARGIN,
topMargin=1.4*cm, bottomMargin=1.4*cm,
title='Pathology Museum Specimens - Gross Appearance',
author='Orris Medical Reference',
)
story = []
W = PAGE_W - 2*MARGIN
# โโ Cover block โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
cover_data = [[
Paragraph('๐ฌ Museum Specimen', TITLE_STYLE),
]]
cover2 = [[
Paragraph('GROSS / MACROSCOPIC APPEARANCE QUICK REFERENCE', make_style('Sub2',
fontSize=11, alignment=TA_CENTER, fontName='Helvetica-Bold',
textColor=C_DARK, spaceAfter=2)),
]]
cover3 = [[
Paragraph('Kidney ยท Bladder ยท Testis ยท GI ยท Gallbladder ยท Liver', SUBTITLE_STYLE),
]]
for d in [cover_data, cover2, cover3]:
t = Table(d, colWidths=[W])
t.setStyle(TableStyle([
('ALIGN', (0,0), (-1,-1), 'CENTER'),
('BOTTOMPADDING', (0,0), (-1,-1), 2),
('TOPPADDING', (0,0), (-1,-1), 2),
]))
story.append(t)
story.append(HRFlowable(width=W, thickness=2, color=C_DARK, spaceAfter=8, spaceBefore=4))
# โโ Section builder helper โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
def add_section(icon, title, color, rows):
story.append(Spacer(1, 6))
story.append(section_header(f'{icon} {title}', color))
story.append(Spacer(1, 3))
story.append(specimen_table(rows, color))
# โโ KIDNEY โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
add_section('๐ด', 'KIDNEY', C_KIDNEY, KIDNEY_ROWS)
# โโ BLADDER โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
add_section('๐ต', 'BLADDER', C_BLADDER, BLADDER_ROWS)
# โโ TESTIS โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
add_section('๐ข', 'TESTIS', C_TESTIS, TESTIS_ROWS)
story.append(PageBreak())
# โโ GI โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
add_section('๐ ', 'GASTROINTESTINAL TRACT (GI)', C_GI, GI_ROWS)
# โโ GB โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
add_section('๐ก', 'GALLBLADDER (GB)', C_GB, GB_ROWS)
story.append(PageBreak())
# โโ LIVER โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
add_section('๐ฃ', 'LIVER', C_LIVER, LIVER_ROWS)
story.append(Spacer(1, 10))
# โโ Viva Approach Box โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
story.append(section_header('๐ HOW TO APPROACH ANY MUSEUM SPECIMEN (Viva Formula)', C_TIPS))
story.append(Spacer(1, 4))
step_data = [['Step', 'Focus', 'What to Say']]
for num, focus, desc in APPROACH_STEPS:
step_data.append([
Paragraph(f'<b>{num}</b>', make_style('SN', fontSize=9, fontName='Helvetica-Bold',
textColor=C_TIPS, alignment=TA_CENTER)),
Paragraph(f'<b>{focus}</b>', make_style('SF', fontSize=8.5, fontName='Helvetica-Bold',
textColor=C_DARK)),
Paragraph(desc, TIP_BODY_STYLE),
])
st = Table(step_data, colWidths=[1.2*cm, 3.5*cm, W - 4.7*cm], repeatRows=1)
st.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,0), C_TIPS),
('TEXTCOLOR', (0,0), (-1,0), C_HEADER_TXT),
('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'),
('FONTSIZE', (0,0), (-1,0), 8),
('ROWBACKGROUNDS',(0,1), (-1,-1), [C_LIGHT_GREY, C_ROW_ALT]),
('GRID', (0,0), (-1,-1), 0.4, colors.HexColor('#CCCCCC')),
('TOPPADDING', (0,0), (-1,-1), 4),
('BOTTOMPADDING', (0,0), (-1,-1), 4),
('LEFTPADDING', (0,0), (-1,-1), 6),
('RIGHTPADDING', (0,0), (-1,-1), 6),
('ALIGN', (0,0), (0,-1), 'CENTER'),
('VALIGN', (0,0), (-1,-1), 'MIDDLE'),
]))
story.append(st)
story.append(Spacer(1, 10))
# โโ Key Buzzwords Box โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
story.append(section_header('โญ EXAMINER FAVOURITE BUZZWORDS', C_DARK))
story.append(Spacer(1, 4))
buzzwords = [
('Renal Cell Carcinoma', '"Variegated / multicolored cut surface"', C_KIDNEY),
('Seminoma', '"Homogeneous cream-white fish-flesh"', C_TESTIS),
('Linitis Plastica', '"Leather-bottle stomach"', C_GI),
('Nutmeg Liver', '"Cut surface like a nutmeg"', C_LIVER),
('Amoebic Liver Abscess', '"Anchovy sauce / chocolate-coloured pus"', C_LIVER),
('Polycystic Kidney', '"Innumerable cysts, no normal parenchyma"', C_KIDNEY),
('Alcoholic Cirrhosis', '"Hobnail liver, micronodular"', C_LIVER),
('Gallbladder (Cholesterol)', '"Strawberry gallbladder"', C_GB),
('Wilms\' Tumor', '"Fish-flesh, well-encapsulated, child\'s kidney"', C_KIDNEY),
('Hydatid Cyst', '"Laminated white wall, daughter cysts, hydatid sand"', C_LIVER),
]
bw_data = [['Specimen', 'Classic Examiner Buzzword']]
for spec, bw, col in buzzwords:
bw_data.append([
Paragraph(f'<b>{spec}</b>', make_style('BS', fontSize=8.5, fontName='Helvetica-Bold', textColor=col)),
Paragraph(f'<i>{bw}</i>', make_style('BD', fontSize=8.5, fontName='Helvetica', textColor=C_DARK)),
])
bwt = Table(bw_data, colWidths=[5*cm, W - 5*cm], repeatRows=1)
bwt.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,0), C_DARK),
('TEXTCOLOR', (0,0), (-1,0), C_HEADER_TXT),
('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'),
('FONTSIZE', (0,0), (-1,0), 8),
('ROWBACKGROUNDS',(0,1), (-1,-1), [C_LIGHT_GREY, colors.HexColor('#EAF4EA')]),
('GRID', (0,0), (-1,-1), 0.4, colors.HexColor('#CCCCCC')),
('TOPPADDING', (0,0), (-1,-1), 5),
('BOTTOMPADDING', (0,0), (-1,-1), 5),
('LEFTPADDING', (0,0), (-1,-1), 8),
('RIGHTPADDING', (0,0), (-1,-1), 8),
('VALIGN', (0,0), (-1,-1), 'MIDDLE'),
]))
story.append(bwt)
story.append(Spacer(1, 8))
story.append(Paragraph('Reference: Robbins & Cotran Pathologic Basis of Disease | Orris Medical Reference | July 2026', FOOTER_STYLE))
doc.build(story, onFirstPage=add_page_number, onLaterPages=add_page_number)
print(f'PDF saved to: {out_path}')
return out_path
if __name__ == '__main__':
build()
cd /tmp/workspace/museum-specimen-pdf && python generate_pdf.py 2>&1
ls -lh /tmp/workspace/museum-specimen-pdf/Museum_Specimen_Gross_Appearance.pdf
Museum Specimen Gross Appearance
PDF Document ยท PDF
| Page | Content |
|---|---|
| Page 1 | Kidney (7 specimens) ยท Bladder (4 specimens) ยท Testis (5 specimens) |
| Page 2 | GI Tract (8 specimens) ยท Gallbladder (6 specimens) |
| Page 3 | Liver (8 specimens) ยท Viva Approach Formula (6-step) ยท Top 10 Examiner Buzzwords |