Non neoplastic giant cell lesions of bone
"giant cell lesions" AND bone
aneurysmal bone cyst or giant cell reparative granuloma or cherubism

| Feature | GCT (neoplastic) | Giant cell granuloma | Brown tumor | ABC | Cherubism |
|---|---|---|---|---|---|
| Age | 20 to 40, closed physis | Under 30 | Any, with metabolic disease | Under 20 | 2 to 5 years |
| Site | Epiphysis of long bone | Jaw, small bones of hand and foot | Any, often jaw, pelvis, ribs | Metaphysis, spine | Mandible and maxilla, bilateral |
| Giant cells | Large, many nuclei, evenly spread | Smaller, clustered | Smaller, nodular near hemorrhage | Scattered in septa | Clustered in vascular stroma |
| Key test | Imaging and histology | Exclude hyperparathyroidism | Ca, PO4, ALP, PTH | MRI fluid levels, USP6 | Family history, SH3BP2 |
Make a pdf of the same
ls -la /tmp/workspace/; mkdir -p /tmp/workspace/giant-cell-pdf; curl -sL -o /tmp/workspace/giant-cell-pdf/abc.png "https://cdn.orris.care/cdss_images/a5422fd11756a1e27525da39133e5e0f62fc6e2d9dd4d942dbe2b7772ff07432.png"; ls -la /tmp/workspace/giant-cell-pdf; python3 -c "from PIL import Image; print(Image.open('/tmp/workspace/giant-cell-pdf/abc.png').size)"
~/giant-cell-pdf/make_pdf.py
from reportlab.lib.pagesizes import A4
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import mm
from reportlab.lib import colors
from reportlab.platypus import (SimpleDocTemplate, Paragraph, Spacer, Table,
TableStyle, Image, ListFlowable, ListItem, KeepTogether)
OUT = "/tmp/workspace/giant-cell-pdf/Non_Neoplastic_Giant_Cell_Lesions_of_Bone.pdf"
NAVY = colors.HexColor("#1F3A5F")
LIGHT = colors.HexColor("#EAF0F7")
ss = getSampleStyleSheet()
title = ParagraphStyle("t", parent=ss["Title"], fontSize=20, textColor=NAVY, spaceAfter=4, alignment=0)
sub = ParagraphStyle("s", parent=ss["Normal"], fontSize=9.5, textColor=colors.grey, spaceAfter=10)
h1 = ParagraphStyle("h1", parent=ss["Heading2"], fontSize=13.5, textColor=NAVY, spaceBefore=12, spaceAfter=5)
body = ParagraphStyle("b", parent=ss["Normal"], fontSize=10, leading=14, spaceAfter=4)
bul = ParagraphStyle("bl", parent=body, spaceAfter=2)
small = ParagraphStyle("sm", parent=body, fontSize=8.5, leading=11, textColor=colors.HexColor("#444444"))
cell = ParagraphStyle("c", parent=body, fontSize=8.2, leading=10.2, spaceAfter=0)
cellh = ParagraphStyle("ch", parent=cell, textColor=colors.white, fontName="Helvetica-Bold")
def P(t, s=body): return Paragraph(t, s)
def bullets(items):
return ListFlowable([ListItem(P(i, bul), leftIndent=12) for i in items],
bulletType="bullet", start="\u2022", leftIndent=14, bulletFontSize=8)
def footer(canvas, doc):
canvas.saveState()
canvas.setFont("Helvetica", 8)
canvas.setFillColor(colors.grey)
canvas.drawString(18*mm, 10*mm, "Non-neoplastic giant cell lesions of bone")
canvas.drawRightString(A4[0]-18*mm, 10*mm, f"Page {doc.page}")
canvas.restoreState()
doc = SimpleDocTemplate(OUT, pagesize=A4, leftMargin=18*mm, rightMargin=18*mm,
topMargin=16*mm, bottomMargin=16*mm,
title="Non-neoplastic giant cell lesions of bone", author="Orris")
S = []
S.append(P("Non-neoplastic Giant Cell Lesions of Bone", title))
S.append(P("Study summary compiled from Campbell's Operative Orthopaedics 15th Ed, Scott-Brown's Otorhinolaryngology, "
"K J Lee's Essential Otolaryngology and Robbins & Kumar Basic Pathology", sub))
S.append(P("Overview", h1))
S.append(P("These lesions contain multinucleated osteoclast-type giant cells but are reactive, genetic or metabolic. They are not "
"true giant cell tumors (GCT). They look alike histologically, so diagnosis depends on clinical, biochemical and "
"radiological correlation."))
S.append(P("Main entities", ParagraphStyle("x", parent=body, fontName="Helvetica-Bold")))
S.append(bullets([
"Giant cell reparative granuloma (central giant cell granuloma, giant cell reaction of bone)",
"Brown tumor of hyperparathyroidism",
"Aneurysmal bone cyst (ABC), including its solid variant",
"Cherubism",
"Others that can contain giant cells: fibrous dysplasia, non-ossifying fibroma, chondroblastoma, Paget disease, fracture callus",
]))
S.append(P("1. Giant cell reparative granuloma (central giant cell granuloma)", h1))
S.append(bullets([
"<b>Definition:</b> benign; granuloma-like aggregates of giant cells in a fibrovascular stroma. First described by Jaffe in 1953 in the jaws. (Scott-Brown's, Vol 1)",
"<b>Who and where:</b> children and young adults, female:male about 2:1. Mandible and maxilla most often, then sphenoid and temporal bones. Most occur before age 30 and can cross the midline in the anterior maxilla (K J Lee). Extragnathic cases occur in the hand and foot bones.",
"<b>Presentation:</b> pain and swelling. Skull base lesions can cause diplopia, hearing loss, vertigo or tinnitus.",
"<b>Imaging:</b> CT shows an expansile lytic lesion with a \"soap bubble\" centre and well-demarcated edges; unilocular or multilocular.",
"<b>Histology:</b> cellular fibroblastic stroma with giant cell aggregates. Giant cells are smaller and have fewer nuclei than in true GCT. Mitoses may be present but the lesion is benign.",
"<b>Pitfalls:</b> indistinguishable histologically from the solid variant of ABC (Campbell's: the solid variant is often called giant cell reparative granuloma). Also mimics brown tumor, so check serum calcium, phosphate, ALP and PTH.",
"<b>Treatment:</b> curettage or excision. Curettage alone has about 15% recurrence, so excision is preferred where possible. Jaw lesions: intralesional steroids, calcitonin or interferon are options. Prognosis is good.",
]))
S.append(P("2. Brown tumor of hyperparathyroidism", h1))
S.append(bullets([
"<b>Cause:</b> primary hyperparathyroidism (parathyroid adenoma) or secondary hyperparathyroidism (chronic renal failure). Usually bone shows only diffuse demineralization; a focal brown tumor is rare.",
"<b>Appearance:</b> resembles GCT and is difficult to distinguish from it.",
"<b>Diagnosis:</b> from serum calcium, phosphorus, ALP and PTH, not from histology of the focal lesion.",
"<b>Histology favouring hyperparathyroidism:</b> smaller, often nodular giant cells (especially around hemorrhage); more spindle-shaped, delicate stromal cells; prominent osseous metaplasia; surrounding bone with intense osteoclastic and osteoblastic activity and peritrabecular fibrosis.",
"<b>Treatment:</b> endocrine disease managed by endocrinologist/endocrine surgeon. Orthopaedic care covers actual or impending pathologic fractures. (Campbell's)",
]))
S.append(P("3. Aneurysmal bone cyst (ABC)", h1))
S.append(bullets([
"<b>Nature:</b> locally destructive, blood-filled reactive lesion, \"not considered to be true neoplasms\" in Campbell's. Robbins describes a USP6 rearrangement in the spindle cells, so some authors regard it as neoplastic.",
"<b>Epidemiology:</b> most patients under 20, slight female predominance. Proximal humerus, distal femur, proximal tibia and spine. Spine accounts for 15 to 20%, favouring posterior elements.",
"<b>Presentation:</b> mild to moderate pain for weeks to months. Rapid growth can mimic malignancy; spinal lesions may cause neurological deficit.",
"<b>Radiology:</b> eccentric, expansile, lytic metaphyseal lesion elevating the periosteum with a thin cortical shell. MRI: multiloculated cavities with double-density fluid-fluid levels and septations (helps separate from unicameral bone cyst). Bone scan: central photopenia with peripheral uptake.",
"<b>Pathology:</b> cavitary lesion with blood-filled septate spaces; septa of cellular stroma with giant cells and reactive woven bone; no endothelial lining.",
"<b>Pathogenesis:</b> possibly local circulatory disturbance with raised venous pressure and hemorrhage. Primary ABC: 17p13 rearrangement fusing USP6 to COL1A1, causing USP6 overexpression; USP6 is a deubiquitinating enzyme that upregulates NF-kB and matrix metalloproteases, driving bone resorption (Robbins). Secondary ABC-like change occurs in GCT, chondroblastoma, osteoblastoma, fibrous dysplasia, non-ossifying fibroma and chondromyxoid fibroma, so sample adequately.",
"<b>Treatment:</b> extended curettage with bone graft or substitute (Campbell's). Embolization for inaccessible sites and adjuvants such as sclerotherapy are other options.",
]))
img = Image("/tmp/workspace/giant-cell-pdf/abc.png", width=150*mm, height=150*mm*1266/2295)
S.append(KeepTogether([Spacer(1, 4), img,
P("Aneurysmal bone cyst. (A) MRI with fluid-fluid levels. (B) Gross hemorrhagic, spongelike appearance. "
"Robbins & Kumar Basic Pathology, Fig. 19.26.", small)]))
S.append(P("4. Cherubism", h1))
S.append(bullets([
"<b>Genetics:</b> autosomal dominant, mapping to 4p16.3 (SH3BP2). Weaker penetrance in females, so males are more often affected. (Scott-Brown's)",
"<b>Onset:</b> usually age 2 to 5, before age 7.",
"<b>Clinical:</b> painless bilateral swelling of the mandibular angles, and in severe cases the posterior maxillae, giving a chubby face; upturned eyes with maxillary involvement; tooth displacement or loosening; speech and swallowing problems; cervical lymphadenopathy from reactive hyperplasia.",
"<b>Imaging:</b> multiple bilateral multilocular radiolucencies with fine bony septa in upper and lower jaws.",
"<b>Histology:</b> early lesions resemble giant cell granuloma: giant cells in cellular, vascular fibrous tissue with perivascular hyaline cuffing. Older lesions show increasing bony repair.",
"<b>Course:</b> rapid growth at first, slowing at puberty, then gradual regression. Observation; curettage or contouring rarely needed. Prognosis variable.",
]))
S.append(P("Comparison with true giant cell tumor", h1))
hdr = ["Feature", "GCT (neoplastic)", "Giant cell granuloma", "Brown tumor", "ABC", "Cherubism"]
rows = [
["Age", "20 to 40, closed physis", "Under 30", "Any, with metabolic disease", "Under 20", "2 to 5 years"],
["Site", "Epiphysis of long bone", "Jaw; small bones of hand and foot", "Any; often jaw, pelvis, ribs", "Metaphysis, spine", "Mandible and maxilla, bilateral"],
["Giant cells", "Large, many nuclei, evenly spread", "Smaller, clustered", "Smaller, nodular near hemorrhage", "Scattered in septa", "Clustered in vascular stroma"],
["Key test", "Imaging, histology", "Exclude hyperparathyroidism", "Ca, PO4, ALP, PTH", "MRI fluid levels, USP6", "Family history, SH3BP2"],
]
data = [[P(h, cellh) for h in hdr]] + [[P(c, cell) for c in r] for r in rows]
t = Table(data, colWidths=[20*mm, 29*mm, 29*mm, 31*mm, 27*mm, 30*mm], repeatRows=1)
t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), NAVY),
("ROWBACKGROUNDS", (0,1), (-1,-1), [colors.white, LIGHT]),
("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#B8C4D2")),
("VALIGN", (0,0), (-1,-1), "TOP"),
("TOPPADDING", (0,0), (-1,-1), 3), ("BOTTOMPADDING", (0,0), (-1,-1), 3),
]))
S.append(t)
S.append(Spacer(1, 4))
S.append(P("GCT is the neoplastic comparator: it arises in the epiphysis of skeletally mature patients and is treated by curettage with "
"adjuvant therapy, or denosumab when unresectable. GCT genetics (H3F3A) are from general knowledge, not the retrieved sources.", small))
S.append(P("Practical approach to a giant-cell-rich lesion", h1))
S.append(ListFlowable([ListItem(P(x, bul), leftIndent=14) for x in [
"Check calcium, phosphate, ALP and PTH first to exclude brown tumor.",
"Consider age, site, and whether the physis is open or closed.",
"Look for fluid-fluid levels on MRI (ABC) and for bilateral jaw lesions or family history (cherubism).",
"Sample thoroughly: giant cells and secondary ABC change can sit on top of another primary lesion.",
"Use molecular tests when needed (USP6 for ABC, H3F3A for GCT).",
]], bulletType="1", leftIndent=16))
S.append(P("Recent literature check", h1))
S.append(P("A PubMed search of the last 2 years found no systematic review or meta-analysis that changes the above. The relevant "
"results concern neoplastic GCT: bone graft vs cement recurrence meta-analysis, 1,454 patients (PMID 39236154, 2024); "
"GCT of the sphenoid bone (PMID 41685997); primary clivus bone lesions (PMID 42304155)."))
S.append(Spacer(1, 6))
S.append(P("For education only. Verify against current guidelines and clinical context before applying to patient care.", small))
doc.build(S, onFirstPage=footer, onLaterPages=footer)
print("ok")
cd /tmp/workspace/giant-cell-pdf && python3 make_pdf.py && python3 -c " import pdfplumber p=pdfplumber.open('Non_Neoplastic_Giant_Cell_Lesions_of_Bone.pdf'); print(len(p.pages)) for pg in p.pages: print(pg.extract_text()[:150].replace('\n',' | ')) "; ls -la
Non Neoplastic Giant Cell Lesions of Bone
PDF Document · PDF
Give me in detail about radiological appearnaces indicating pathological changes in various bone tumors
osteosarcoma radiograph sunburst periosteal reaction Codman triangle

Plain Radiography of a long bone diaphysis demonstrates an aggressive, ill-defined osteolytic lesion with cortical destruction and periosteal reaction. The radiograph shows a moth-eaten destruction pattern with diffuse bone loss extending along a substantial portion of the shaft. Periosteal elevation produces Codman triangle in the swept cortex, while layered deposition of reactive new bone beneath the periosteum can create an onion-skin appearance; in some cases perpendicular radiating spicules or sunburst-like projections may be seen. The lesion often breaches the cortex or expands to form a soft tissue mass that extends beyond the bone. Although ultrasound or CT can delineate the soft tissue component, CT and MRI best characterize the extent, relation to surrounding structures, and marrow involvement. The radiographic pattern is highly suggestive of an aggressive small round blue cell tumor, most notably Ewing sarcoma, particularly in children and adolescents. Differential considerations include osteosarcoma, osteomyelitis, lymphoma, metastasis, or eosinophilic granuloma, but the combination of an diaphyseal, permeative lesion with onion-skin periosteal reaction strongly favors Ewing. Clinical correlation with pain, fever, raised inflammatory markers, and prompt biopsy is essential to confirm diagnosis and guide treatment, which typically combines chemotherapy, limb-sparing surgery, and possibly radiotherapy.

This is a plain radiograph (X-ray) of the femur demonstrating malignant transformation of Paget disease into osteosarcoma in the proximal femur. The image exhibits an aggressive, poorly demarcated lytic-destructive lesion with a permeative pattern, extensive cortical destruction, and a bulky soft tissue mass. Classic Paget disease changes are overlaid by malignant osteoid-producing tumor features, including sunburst-like periosteal reaction and Codman triangle, with a wide zone of transition. The lesion may be associated with a pathologic fracture and cortical erosion. The radiographic pattern aligns with high-grade osteosarcoma in the setting of pagetic bone; imaging may reveal mineralization within the tumor and strong aggression into surrounding soft tissues. Bone scans typically show reduced isotope uptake in lytic Pagetic regions, whereas MRI/CT could better delineate medullary involvement and soft-tissue extent. This case, attributed to The Radswiki, Radiopaedia.org (case rID: 11727), highlights the need for biopsy for definitive histology and staging. Clinically, older patients with longstanding Paget disease presenting with new, persistent pain or fracture should raise suspicion for malignant transformation to osteosarcoma; management involves oncologic assessment, surgical planning, and systemic therapy as indicated. The image is valuable for radiology education and differential diagnosis training in musculoskeletal oncology, Paget disease, and bone tumors. Utility.
"bone neoplasms"[MeSH Terms] AND "diagnostic imaging"[MeSH Subheading]
| Pattern | Appearance | Meaning |
|---|---|---|
| Type 1A (geographic) | Well-defined lytic lesion with a sclerotic rim | Slow growth, benign or low grade |
| Type 1B | Well-defined lytic lesion with no sclerotic rim | Benign or low grade, a little more active |
| Type 1C | Slightly less sharp, non-sclerotic margin | Intermediate |
| Type 2 (moth-eaten) | Multiple 2-5 mm lucent areas separated by intact trabeculae | Aggressive (lymphoma, high-grade sarcoma) |
| Type 3 (permeative) | Coalescing lucencies of 1 mm or less, with a zone of transition of several centimetres | Most aggressive (Ewing sarcoma, round cell tumors) |

| Type | Meaning |
|---|---|
| Solid, thick, well-formed | Slow growth. It is not always benign: it can occur with grade 2 chondrosarcoma, and osteoid osteoma causes it too. |
| Laminated (onion skin) | Subperiosteal tumor extension, infection or hematoma. Classic for Ewing sarcoma. |
| Multilaminated | Periodic or episodic growth. |
| Codman triangle (angle) | Elevated, interrupted periosteum. It marks the longitudinal limit of subperiosteal tumor. It is seen in osteosarcoma and Ewing sarcoma (27% of Ewing cases). |
| Spiculated, sunburst or hair-on-end | Mineralisation perpendicular to the cortex. It indicates a rapidly evolving process. Classic for osteosarcoma and Ewing sarcoma (about 50% of Ewing cases). |


| Tumor | Key radiological signs |
|---|---|
| Giant cell tumor | A subarticular, eccentric lytic lesion with a geographic, non-sclerotic margin. Usually 5-7 cm. Trabeculation and cortical expansion are common. Cortical destruction with extension occurs in up to 50%. A poorly defined margin occurs in 10-15%. Periosteal reaction in 10-15% usually means a healed fracture. Look at the knee (55%), distal radius and proximal humerus. In the immature skeleton it sits in the metaphysis. CT shows cortex and trabeculation best. |
| Osteoid osteoma | A small nidus (usually under 1.5 cm) with surrounding sclerosis and cortical thickening. CT shows the nidus best, which may calcify. In the spine it shows as a dense pedicle with painful scoliosis. Three-phase bone scan shows focal hypervascularity and high uptake. A negative scan excludes it. |
| Osteoblastoma | A nidus larger than 1.5-2 cm. Expansile, lucent or sclerotic with a sclerotic rim. It favors the posterior spinal elements. The cortex may break, and there is surrounding edema. |
| Enchondroma | Lobulated lytic lesion with stippled or ring-and-arc calcification. Most often in the proximal phalanges. May present with a pathological fracture (60%). |
| Osteochondroma | A bone outgrowth continuous with the medullary cavity and cortex of the parent bone. A thick cartilage cap suggests secondary chondrosarcoma. Malignant change is under 1% in solitary lesions, under 5% in hereditary multiple exostoses, about 20% in Ollier disease and about 30% in Maffucci syndrome. |
| Fibrous dysplasia | Ground-glass matrix with a sclerotic rim. Polyostotic disease can show a shepherd's crook deformity of the proximal femur. McCune-Albright syndrome and Mazabraud syndrome are associated. |
| Aneurysmal bone cyst | An eccentric, expansile, lytic metaphyseal lesion with a thin cortical shell. MRI shows fluid-fluid levels and septations. |
| Simple bone cyst | A central, fluid-signal lesion in the proximal long bones of children. It may present with a fracture (the "fallen fragment" sign). |
| Non-ossifying fibroma | A cortically based, eccentric lucent lesion with a sclerotic scalloped margin. |
| Chondroblastoma | A well-circumscribed epiphyseal lytic lesion in skeletally immature patients (under 30), with stippled calcification. MRI shows edema out of proportion to the lesion size. - Miller's Review of Orthopaedics |

| Feature | Osteosarcoma | Ewing sarcoma | Chondrosarcoma | GCT |
|---|---|---|---|---|
| Age | Under 30 | 5 to 20 | Over 50 | 18 to 45 |
| Site | Metaphysis, knee | Diaphysis, flat bones | Pelvis, proximal femur, ribs | Epiphysis, subarticular |
| Destruction | Moth-eaten or permeative | Permeative | Lytic, scalloped | Geographic, no rim |
| Matrix | Cloud-like osteoid | None | Rings and arcs | None |
| Periosteal reaction | Sunburst, Codman | Onion skin, hair-on-end, Codman | Solid, thick | Rare (fracture healing) |
| Soft-tissue mass | Common, mineralised | Common, large (80%) | Common in high grade | Possible (up to 50% extend) |
give an account of non inflammatory non neoplastic lesions of bone- give it for md pathology exam 20 mark question
"bone diseases"[MeSH Terms] AND "pathology"[MeSH Subheading]
| Group | Examples |
|---|---|
| A. Congenital / developmental | Achondroplasia, thanatophoric dysplasia, osteogenesis imperfecta, osteopetrosis |
| B. Metabolic | Osteoporosis, rickets and osteomalacia, hyperparathyroidism (osteitis fibrosa cystica), renal osteodystrophy |
| C. Disordered remodeling | Paget disease of bone |
| D. Developmental tumor-like | Fibrous dysplasia (including McCune-Albright and Mazabraud syndromes), fibrous cortical defect / non-ossifying fibroma, simple and aneurysmal bone cysts |
| E. Vascular | Osteonecrosis (avascular necrosis) |
| F. Mechanical | Fractures and fracture healing |



| Disease | Key defect | Hallmark morphology | Key biochemistry |
|---|---|---|---|
| Osteoporosis | Low bone mass, normal quality | Thin, perforated trabeculae | Ca, PO4, ALP normal |
| Rickets / osteomalacia | Defective mineralisation | Excess unmineralised osteoid | Low vitamin D; ALP raised |
| Hyperparathyroidism | Raised PTH | Dissecting osteitis, brown tumor | Ca high, PO4 low, ALP high |
| Paget disease | Overactive osteoclasts | Mosaic pattern of lamellar bone | ALP high, Ca normal |
| Osteopetrosis | Failed osteoclast function | Solid bone, no marrow cavity | Anemia, pancytopenia |
| Osteogenesis imperfecta | Type I collagen defect | Thin bone, blue sclerae | Normal Ca, PO4 |
| Fibrous dysplasia | GNAS1 mutation | C-shaped woven bone, no osteoblast rimming | Normal (usually) |
| Osteonecrosis | Ischemia | Empty lacunae, subchondral wedge | Normal |
Add a section of LAngerhans cell histiocytosis
Langerhans cell histiocytosis eosinophilic granuloma bone histology Birbeck granules

Imaging modality: light microscopy of a bone lesion with hematoxylin and eosin staining. Site: medullary cavity of bone with cortical erosion and extension into adjacent soft tissue, consistent with lytic osseous involvement. Histology shows an infiltrative proliferation of Langerhans cells arranged in sheets within the marrow spaces, accompanied by a mixed inflammatory infiltrate rich in eosinophils. Langerhans cells display irregular, grooved or coffee-bean nuclei with pale cytoplasm and open chromatin; mitotic figures are variable. The surrounding stroma may be fibrous and vascular, with focal bone destruction and thinning of the cortex. These features are characteristic of Langerhans cell histiocytosis (LCH); immunohistochemistry typically demonstrates CD1a and langerin (CD207) positivity and S-100 protein expression in the lesional cells. Birbeck granules are a hallmark on electron microscopy but not visible on routine light microscopy. Clinically, LCH bone lesions may be asymptomatic initially or present with pain, tenderness, swelling, or pathologic fracture as the medullary cavity expands and cortical integrity is compromised. Differential diagnoses include eosinophilic granuloma, metastatic carcinoma, osteomyelitis, and fibrous dysplasia. The diagnostic significance lies in recognizing a clonal dendritic cell histiocytosis requiring confirmatory IHC and correlation with imaging and clinical findings for prognostication and treatment planning (surgery, chemotherapy, or targeted therapy).

Pediatric plain radiograph of the left femur (AP projection) demonstrates a focal, ill-defined lucent lesion within the mid-diaphysis of the femoral shaft with surrounding layered periosteal reaction. The lesion produces cortical thinning with mild endosteal scalloping and subtle medial-lateral cortical expansion. There is no clear fracture, and the adjacent soft tissues appear without conspicuous edema on this projection. This radiographic appearance is classic for eosinophilic granuloma / Langerhans cell histiocytosis (LCH) of bone in children, which typically involves the skull and long bones such as the femur, tibia, pelvis, and mandible; however, vertebrae and ribs can also be affected. In LCH, diaphyseal lucencies may be lytic with a surrounding reactive periosteum; differential diagnosis includes Ewing sarcoma, osteomyelitis, and benign bone cysts. Age is a guiding factor; in this case, a 4-year-old female, with differential weighted toward LCH over Ewing sarcoma, though biopsy is required for confirmation. CT, MRI, and PET modalities can further delineate extent and soft-tissue involvement, while FNA cytology or surgical biopsy confirms histology showing Langerhans cells with characteristic Birbeck granules on electron microscopy or CD1a/ langerin positivity. Case contributed by Radiopaedia; diagnosis established by biopsy. Confirmation.
"Histiocytosis, Langerhans-Cell"[MeSH Terms] AND "bone"
| Feature | Unifocal unisystem (eosinophilic granuloma) | Multifocal unisystem (Hand-Schüller-Christian disease) | Multisystem (Letterer-Siwe disease) |
|---|---|---|---|
| Age | Mostly children under 10, though adults are affected too | Children | Under 2 years |
| Distribution | Single bone (skull, femur, mandible, pelvis, ribs, spine) | Multiple bones, often with soft-tissue extension | Skin, liver, spleen, nodes, lungs, marrow, bone |
| Course | Indolent, may heal spontaneously | Chronic | Rapidly fatal if untreated |
| Key features | Pain, tenderness, pathologic fracture | Classic triad of calvarial defects, diabetes insipidus and exophthalmos | Seborrhoea-like rash, hepatosplenomegaly, pancytopenia, recurrent infections |
| Outcome | Excellent | Variable | About 50% 5-year survival with intensive chemotherapy |


| Disease | Key defect | Hallmark morphology | Key marker |
|---|---|---|---|
| Langerhans cell histiocytosis | Clonal Langerhans cell proliferation (BRAF V600E in about half) | Grooved nuclei, abundant eosinophils | CD1a, langerin, S-100; Birbeck granules |
Merge everything into one MD Pathology revision PDF
cd /tmp/workspace/giant-cell-pdf && mkdir -p ../md-path-revision/img && cd ../md-path-revision/img && cp ../../giant-cell-pdf/abc.png abc.png dl(){ curl -sL -o "$1" "$2"; } B=https://cdn.orris.care/cdss_images dl osteoporosis.png $B/29482f189db50f876460e067efcf9fba5b51e7c16485c20c66314ab118c051e0.png dl dissecting.png $B/32063524b07abbb19a1c3f1beeb72bbc639eb78cea2b0b9eec29f2dd9ba5ee0f.png dl paget.png $B/0638b8ba20b33042ca767de6dfcc880ecfa9c462e4517dcaa0913dc3072ced12.png dl lch_histo.jpg $B/Pathology_1760047972268_8d8dccf1-743c-42d4-be50-17ca51cd1d9d.jpg dl lch_femur.jpg $B/Pathology_1760047969146_f33c2c26-049e-4934-b6a4-9a0b2799677b.jpg dl periosteal.png $B/50fe7f8535926b406027655d7487896f9b059916e95d1213680f4510c44f6128.png dl matrix.png $B/fb01dd2c5314c9ad91c4e00ef37d65990b25c5ec39675ca6071cf2ec3bc7645b.png dl onion.png $B/95178bed7f98d31c166ee0bcba7eb4338fbeed1a0278ffc7244ded5f7a5d50fc.png dl chondro.png $B/9aa9b69737e829e5d2893138c660667eebd0c0e2d7e967c173934de75257dd22.png python3 -c " from PIL import Image; import glob for f in sorted(glob.glob('*')): try: im=Image.open(f); print(f, im.size, im.mode) except Exception as e: print(f,'ERR',e) "
~/md-path-revision/make_pdf.py
from reportlab.lib.pagesizes import A4
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import mm
from reportlab.lib import colors
from reportlab.platypus import (BaseDocTemplate, PageTemplate, Frame, Paragraph, Spacer, Table,
TableStyle, Image, ListFlowable, ListItem, KeepTogether,
PageBreak, NextPageTemplate)
from reportlab.platypus.tableofcontents import TableOfContents
from PIL import Image as PILImage
IMG = "/tmp/workspace/md-path-revision/img/"
OUT = "/tmp/workspace/md-path-revision/MD_Pathology_Bone_Lesions_Revision.pdf"
NAVY = colors.HexColor("#1F3A5F")
LIGHT = colors.HexColor("#EAF0F7")
GRID = colors.HexColor("#B8C4D2")
W, H = A4
LM = RM = 17 * mm
ss = getSampleStyleSheet()
def S(name, parent="Normal", **kw): return ParagraphStyle(name, parent=ss[parent], **kw)
title = S("title", "Title", fontSize=26, leading=30, textColor=NAVY, alignment=0, spaceAfter=6)
subt = S("subt", fontSize=12, leading=16, textColor=colors.HexColor("#444444"), spaceAfter=8)
part = S("part", "Heading1", fontSize=17, leading=21, textColor=colors.white, backColor=NAVY,
borderPadding=(6, 6, 6, 6), spaceBefore=4, spaceAfter=12)
h1 = S("h1", "Heading2", fontSize=13, leading=16, textColor=NAVY, spaceBefore=11, spaceAfter=4)
h2 = S("h2", "Heading3", fontSize=11, leading=14, textColor=colors.HexColor("#2E5C8A"), spaceBefore=7, spaceAfter=3)
body = S("body", fontSize=9.6, leading=13.2, spaceAfter=3.5)
bul = S("bul", parent="Normal", fontSize=9.6, leading=13, spaceAfter=1.5)
small = S("small", fontSize=8, leading=10.5, textColor=colors.HexColor("#555555"), spaceAfter=4)
cell = S("cell", fontSize=8, leading=10, spaceAfter=0)
cellh = S("cellh", fontSize=8, leading=10, textColor=colors.white, fontName="Helvetica-Bold")
box = S("box", fontSize=9.4, leading=12.6, backColor=colors.HexColor("#FFF7E0"),
borderColor=colors.HexColor("#E0B94A"), borderWidth=0.6, borderPadding=6,
spaceBefore=6, spaceAfter=10)
tocl1 = S("tocl1", fontSize=10.5, leading=15, leftIndent=0, fontName="Helvetica-Bold", textColor=NAVY)
tocl2 = S("tocl2", fontSize=9, leading=12, leftIndent=14)
def P(t, s=body): return Paragraph(t, s)
def bullets(items, style=bul):
return ListFlowable([ListItem(P(i, style), leftIndent=12) for i in items],
bulletType="bullet", start="\u2022", leftIndent=14, bulletFontSize=8)
def numbered(items):
return ListFlowable([ListItem(P(i, bul), leftIndent=14) for i in items],
bulletType="1", leftIndent=16)
def fig(fname, cap, maxw=140, maxh=80):
w, h = PILImage.open(IMG + fname).size
r = min(maxw * mm / w, maxh * mm / h)
return KeepTogether([Spacer(1, 3), Image(IMG + fname, width=w * r, height=h * r),
P(cap, small), Spacer(1, 3)])
def table(header, rows, widths):
data = [[P(h, cellh) for h in header]] + [[P(c, cell) for c in r] for r in rows]
t = Table(data, colWidths=[x * mm for x in widths], repeatRows=1)
t.setStyle(TableStyle([
("BACKGROUND", (0, 0), (-1, 0), NAVY),
("ROWBACKGROUNDS", (0, 1), (-1, -1), [colors.white, LIGHT]),
("GRID", (0, 0), (-1, -1), 0.4, GRID),
("VALIGN", (0, 0), (-1, -1), "TOP"),
("TOPPADDING", (0, 0), (-1, -1), 3), ("BOTTOMPADDING", (0, 0), (-1, -1), 3),
]))
return [t, Spacer(1, 5)]
class Doc(BaseDocTemplate):
def afterFlowable(self, f):
if isinstance(f, Paragraph):
if f.style.name == "part":
self.notify("TOCEntry", (0, f.getPlainText(), self.page))
elif f.style.name == "h1":
self.notify("TOCEntry", (1, f.getPlainText(), self.page))
def footer(c, d):
c.saveState()
c.setFont("Helvetica", 8); c.setFillColor(colors.grey)
c.drawString(LM, 10 * mm, "MD Pathology revision: non-inflammatory bone lesions, giant cell lesions, bone tumor radiology")
c.drawRightString(W - RM, 10 * mm, f"Page {d.page}")
c.restoreState()
doc = Doc(OUT, pagesize=A4, leftMargin=LM, rightMargin=RM, topMargin=16 * mm, bottomMargin=17 * mm,
title="MD Pathology Bone Lesions Revision", author="Orris")
frame = Frame(LM, 17 * mm, W - LM - RM, H - 33 * mm, id="f")
doc.addPageTemplates([PageTemplate(id="main", frames=[frame], onPage=footer)])
st = []
# ---------------- COVER ----------------
st += [Spacer(1, 40 * mm), P("MD Pathology Revision", title),
P("Bone lesions: non-inflammatory non-neoplastic lesions, non-neoplastic giant cell lesions, "
"and radiological signs of pathological change in bone tumors", subt),
P("Sources: Robbins & Kumar Basic Pathology (Ch. 19); Robbins, Cotran & Kumar Pathologic Basis of Disease (Ch. 26); "
"Grainger & Allison's Diagnostic Radiology (Ch. 40, 41, 49, 75); Campbell's Operative Orthopaedics 15th Ed; "
"Scott-Brown's Otorhinolaryngology; K J Lee's Essential Otolaryngology; Miller's Review of Orthopaedics. "
"Points marked \"general knowledge\" were not found in the retrieved textbook text and should be checked against your own reference.", small),
Spacer(1, 8)]
toc = TableOfContents()
toc.levelStyles = [tocl1, tocl2]
st += [P("Contents", h1), toc, PageBreak()]
# ---------------- PART 1 ----------------
st.append(P("PART 1. Non-inflammatory, non-neoplastic lesions of bone (20-mark answer)", part))
st.append(P("1. Introduction and classification", h1))
st.append(P("These are bone disorders that are neither infective/inflammatory (osteomyelitis) nor neoplastic. They arise from abnormal "
"development, abnormal remodeling or metabolism, ischemia, or trauma."))
st.append(bullets([
"Bone matrix is mainly type I collagen plus hydroxyapatite.",
"<b>Woven bone</b> is made rapidly in fetal life and in repair, with haphazard collagen. In an adult, woven bone is always abnormal because it signals ongoing repair. <b>Lamellar bone</b> is the mature form.",
"Osteoblasts make matrix; osteocytes sense load; osteoclasts (multinucleate macrophage-lineage cells) resorb bone. RANKL and OPG regulate osteoclasts.",
]))
st += table(["Group", "Examples"], [
["A. Congenital / developmental", "Achondroplasia, thanatophoric dysplasia, osteogenesis imperfecta, osteopetrosis"],
["B. Metabolic", "Osteoporosis, rickets and osteomalacia, hyperparathyroidism (osteitis fibrosa cystica), renal osteodystrophy"],
["C. Disordered remodeling", "Paget disease of bone"],
["D. Developmental / tumor-like", "Fibrous dysplasia (McCune-Albright, Mazabraud), fibrous cortical defect / non-ossifying fibroma, simple and aneurysmal bone cysts, Langerhans cell histiocytosis"],
["E. Vascular", "Osteonecrosis (avascular necrosis)"],
["F. Mechanical", "Fractures and fracture healing"],
], [48, 126])
st.append(P("2. Congenital and developmental disorders", h1))
st.append(P("Achondroplasia", h2))
st.append(bullets([
"Commonest skeletal dysplasia and commonest cause of dwarfism. Autosomal dominant, <b>FGFR3</b> gain-of-function mutation: the receptor is constitutively active and suppresses endochondral growth. About 90% are new mutations, almost all on the paternal allele.",
"Short proximal limbs, trunk of normal length, large head with bulging forehead, depressed nasal root. Intelligence and longevity are normal.",
]))
st.append(P("Thanatophoric dysplasia", h2))
st.append(bullets([
"Commonest lethal dwarfism; FGFR3 gain-of-function with greater signaling than in achondroplasia. About 1 in 20,000 live births.",
"Short limbs, frontal bossing, small chest, bell-shaped abdomen. Death from respiratory insufficiency at or soon after birth.",
]))
st.append(P("Osteogenesis imperfecta (OI)", h2))
st.append(bullets([
"Commonest inherited connective tissue disorder. Usually autosomal dominant mutation of the genes for the alpha-1 or alpha-2 chains of <b>type I collagen</b>; misfolded chains interfere with normal chains (dominant-negative effect).",
"Basic abnormality: too little bone, causing skeletal fragility. Associated: <b>blue sclerae</b> (thin collagen shows the choroid), hearing loss, small misshapen blue-yellow teeth (dentin deficiency).",
"Severity ranges from perinatal lethal forms to normal lifespan with childhood fractures.",
]))
st.append(P("Osteopetrosis (marble bone disease)", h2))
st.append(bullets([
"Defective osteoclast formation or function (usually failure to acidify the resorption pit) with reduced resorption and diffuse symmetric sclerosis. Bones are dense but brittle and fracture easily.",
"Bones lack a medullary canal. Erlenmeyer flask deformity of the metaphyses and retained calcified cartilage are classic (general knowledge).",
"<b>Autosomal dominant (mild):</b> detected in adolescence or adulthood after repeated fractures; mild cranial nerve deficits and anemia.",
"<b>Autosomal recessive (severe infantile):</b> marrow crowded out, leukopenia (often fatal), extramedullary hematopoiesis and hepatosplenomegaly.",
]))
st.append(P("3. Metabolic bone disease", h1))
st.append(P("3.1 Osteoporosis", h2))
st.append(bullets([
"<b>Definition:</b> osteopenia is reduced bone mass; osteoporosis is osteopenia severe enough to raise fracture risk. Bone is <b>histologically normal but reduced in quantity</b>. DEXA T-score of -2.5 or lower (at least 2.5 SD below peak bone mass).",
"<b>Types:</b> primary (senile, postmenopausal) is commonest. Secondary causes: corticosteroids, hyperthyroidism, malnutrition, immobilisation. May be localised (disuse) or generalised.",
"<b>Pathogenesis:</b> loss averages about 0.7% per year after peak mass. (1) Age-related fall in osteoblast proliferation and synthesis: low-turnover senile osteoporosis. (2) Reduced physical activity. (3) Genetic factors: RANK, RANKL, OPG, estrogen receptor polymorphisms. (4) Low calcium and vitamin D, raised PTH. (5) <b>Estrogen deficiency</b>: loses inhibition of osteoblast apoptosis, loses stimulation of osteoclast apoptosis, and RANKL rises; IL-1, IL-6 and TNF rise and OPG falls. Up to 2% of cortical and 9% of cancellous bone may be lost per year in the decade after menopause; high-turnover osteoporosis.",
"<b>Morphology:</b> thinned, perforated, disconnected trabeculae and thin cortices. Cancellous bone with large surface area (vertebral bodies) is hit first. Horizontal trabeculae are lost and vertical ones thicken, leading to microfractures and vertebral collapse.",
"<b>Clinical:</b> painful thoracic and lumbar vertebral fractures, loss of height, kyphosis and lordosis; fractures of femoral neck, pelvis and spine. Serum calcium, phosphate and ALP are <b>normal</b>. Radiographs show osteoporosis only after 30-40% bone loss, so DEXA or quantitative CT is used.",
"<b>Treatment:</b> exercise, calcium, vitamin D, bisphosphonates, denosumab (anti-RANKL); estrogen has limited use because of thrombosis, stroke and breast cancer risk.",
]))
st.append(fig("osteoporosis.png", "Osteoporotic vertebral body (right) shortened by compression fractures, with loss of horizontal trabeculae and thickened vertical ones. Robbins & Kumar Basic Pathology, Fig. 19.6.", 105, 60))
st.append(P("3.2 Rickets and osteomalacia", h2))
st.append(bullets([
"Cause: vitamin D deficiency or abnormal metabolism (dietary, malabsorption, hepatic or renal disease, phosphate wasting).",
"Basic defect: <b>impaired mineralisation with accumulation of unmineralised osteoid</b>. Rickets affects the growth plate of children; osteomalacia is the adult form. In osteoporosis, by contrast, mineralisation is normal but mass is low.",
"General knowledge: rachitic rosary, frontal bossing, pigeon chest, bowed legs, widened frayed metaphyses; in osteomalacia, wide osteoid seams, bone pain and Looser zones (pseudofractures).",
]))
st.append(P("3.3 Hyperparathyroidism", h2))
st.append(bullets([
"<b>Pathogenesis:</b> excess PTH raises RANKL on osteoblasts and activates osteoclasts; it also increases renal calcium reabsorption, urinary phosphate loss, and synthesis of 1,25(OH)2-vitamin D.",
"<b>Triad:</b> osteoporosis (worst in phalanges, vertebrae, proximal femur), brown tumors, and osteitis fibrosa cystica.",
"<b>Dissecting osteitis:</b> osteoclasts tunnel along trabeculae, giving a railroad-track appearance with fibrovascular replacement of marrow. A misnomer: it is not inflammatory.",
"<b>Brown tumor:</b> microfractures and hemorrhage draw macrophages and reparative fibrous tissue. The brown colour is from vascularity, hemorrhage and hemosiderin. Often cystic. Giant cells are smaller and nodular, stroma is delicate, with osseous metaplasia; it resembles giant cell tumor, so diagnosis rests on serum Ca, phosphate, ALP and PTH.",
"<b>Generalised osteitis fibrosa cystica (von Recklinghausen disease of bone):</b> increased bone cell activity, peritrabecular fibrosis and cystic brown tumors.",
]))
st.append(fig("dissecting.png", "Hyperparathyroidism: osteoclasts boring into the center of a trabecula (dissecting osteitis). Robbins & Kumar Basic Pathology, Fig. 19.8.", 85, 60))
st.append(P("3.4 Renal osteodystrophy", h2))
st.append(P("Collective skeletal changes of chronic kidney disease: osteopenia/osteoporosis, osteomalacia, secondary hyperparathyroidism and growth retardation. "
"Causes: raised PTH, low 1,25(OH)2-vitamin D, hyperphosphatemia and metabolic acidosis. Histological patterns: <b>high-turnover</b> (resorption exceeds formation), "
"<b>low-turnover / adynamic</b> (little osteoclast or osteoblast activity, less commonly osteomalacia), and <b>mixed</b>."))
st.append(P("4. Paget disease of bone (osteitis deformans)", h1))
st.append(bullets([
"<b>Definition:</b> increased but disordered, structurally abnormal bone formation, in three phases: (1) osteolytic, (2) mixed osteoclastic-osteoblastic, (3) burned-out sclerotic.",
"<b>Epidemiology:</b> late adult life; about 1% of people over 40 in the US; common in the UK, central Europe and Greece, rare in Scandinavia, China, Japan and Africa.",
"<b>Pathogenesis:</b> about 50% of familial and 10% of sporadic cases carry <b>SQSTM1</b> (sequestosome-1) mutations, which increase NF-kB activity and so osteoclast activity. Activating RANK mutations and inactivating OPG mutations cause juvenile Paget disease. A paramyxovirus (measles) infection of osteoclast precursors has been proposed.",
"<b>Morphology:</b> lytic phase has huge osteoclasts (100 or more nuclei) with resorption pits; mixed phase has prominent osteoblasts too; sclerotic phase shows the hallmark <b>mosaic (jigsaw puzzle) pattern</b> of lamellar bone with prominent cement lines. Bone is thick but weak.",
"<b>Clinical:</b> about 85% polyostotic; axial skeleton and proximal femur in up to 80%. Mostly asymptomatic. Bone pain; leontiasis ossea; platybasia; anterior bowing of femur and tibia; secondary osteoarthritis; chalk-stick fractures; spinal compression.",
"<b>Biochemistry:</b> raised ALP with normal calcium and phosphate. <b>Complications</b> (general knowledge): osteosarcoma (under 1%), high-output cardiac failure, deafness.",
]))
st.append(fig("paget.png", "Phases of Paget disease of bone. Robbins & Kumar Basic Pathology, Fig. 19.9.", 70, 85))
st.append(P("5. Fibrous dysplasia and other tumor-like lesions", h1))
st.append(P("Fibrous dysplasia", h2))
st.append(bullets([
"Benign developmental arrest: all components of bone are present but do not mature. <b>Monostotic</b> (70-85%) or polyostotic. <b>McCune-Albright:</b> polyostotic disease, cafe-au-lait spots, endocrine disturbance (precocious puberty). <b>Mazabraud:</b> fibrous dysplasia with soft-tissue myxoma.",
"<b>Pathogenesis:</b> somatic gain-of-function mutation of <b>GNAS1</b>; constitutively active Gs protein raises cAMP, driving proliferation and blocking osteoblast differentiation.",
"<b>Gross:</b> tan-white, gritty intramedullary lytic lesion, may expand and bow bone; periosteal reaction usually absent.",
"<b>Microscopy:</b> curved (C-shaped, Chinese-letter) trabeculae of <b>woven bone without osteoblastic rimming</b> in a moderately cellular fibroblastic stroma; cystic change, hemorrhage and foamy macrophages may occur.",
"<b>Clinical:</b> monostotic lesions usually stop growing at growth plate closure; pain and fracture; curettage for symptomatic lesions, recurrence common. Polyostotic disease: deformity such as shepherd's crook femur.",
]))
st.append(P("Fibrous cortical defect and non-ossifying fibroma", h2))
st.append(P("Storiform spindle cells with scattered osteoclast-type giant cells; eccentric metaphyseal cortical lesions of children."))
st.append(P("Simple and aneurysmal bone cysts", h2))
st.append(P("Simple bone cyst: fluid-filled cavity in the proximal long bones of children, often presenting with fracture. Aneurysmal bone cyst: see Part 2."))
st.append(P("5A. Langerhans cell histiocytosis (LCH, histiocytosis X)", h1))
st.append(P("<b>Definition:</b> a proliferation of Langerhans cells (immature dendritic cells that capture antigen). Ranges from a single self-healing bone lesion to a fatal multisystem disease. Robbins calls it a group of uncommon tumors of Langerhans cells; Campbell's notes eosinophilic granuloma \"may not represent a true neoplasm\"."))
st += table(["Feature", "Unifocal (eosinophilic granuloma)", "Multifocal unisystem (Hand-Schuller-Christian)", "Multisystem (Letterer-Siwe)"], [
["Age", "Mostly under 10 years; adults can be affected", "Children", "Under 2 years"],
["Distribution", "Single bone: skull, femur, mandible, pelvis, ribs, spine", "Multiple bones, soft-tissue extension", "Skin, liver, spleen, nodes, lung, marrow, bone"],
["Course", "Indolent; may heal spontaneously", "Chronic", "Rapidly fatal if untreated"],
["Features", "Pain, tenderness, pathologic fracture", "Calvarial defects + diabetes insipidus + exophthalmos (diabetes insipidus in about 50%)", "Seborrhoea-like rash, hepatosplenomegaly, pancytopenia, infections"],
["Outcome", "Excellent", "Variable", "About 50% 5-year survival with intensive chemotherapy"],
], [24, 46, 52, 52])
st.append(bullets([
"<b>Pathogenesis:</b> clonal proliferation; <b>BRAF V600E</b> (MAPK pathway) mutations in about half of cases (general knowledge). The Langerhans cells are mixed with a rich reactive infiltrate.",
"<b>Gross:</b> soft grey-tan to yellow friable tissue in the medullary cavity, eroding cortex (general knowledge).",
"<b>Microscopy:</b> sheets of Langerhans cells with abundant, often vacuolated cytoplasm and vesicular, folded (grooved, coffee-bean) nuclei; background of lymphocytes, plasma cells, neutrophils and <b>prominent eosinophils</b>; giant cells, foamy macrophages and necrosis may be present.",
"<b>Immunohistochemistry:</b> <b>CD1a, langerin (CD207), S-100</b>, MHC class II positive. <b>EM:</b> <b>Birbeck granules</b> (pentalaminar rod-like structures, \"tennis racket\" when the end is dilated); langerin is found in these granules.",
]))
st.append(fig("lch_histo.jpg", "LCH, H&E: sheets of Langerhans cells with grooved nuclei and eosinophils, with cortical erosion.", 85, 62))
st.append(P("Radiology", h2))
st.append(bullets([
"Skeletal sites: skull (punched-out geographic lesions with beveled edges), femur, mandible (teeth \"floating in air\"), pelvis, ribs, spine.",
"<b>Vertebra plana</b> (pancake vertebra) is the classic spinal sign: a single collapsed vertebral body, thoracic then lumbar then cervical, with the <b>adjacent discs preserved</b> and only mild soft-tissue extension.",
"Long bones: lytic diaphyseal or metaphyseal lesion with endosteal scalloping and possible lamellated periosteal reaction; can mimic Ewing sarcoma or osteomyelitis.",
"MRI: T1 isointense, T2 hyperintense, strong enhancement, with marked marrow and soft-tissue edema (the \"flare\" reaction) that can be mistaken for malignancy.",
"Differential: Ewing sarcoma, osteomyelitis (including tuberculosis), leukemia, lymphoma, neuroblastoma metastases, aneurysmal bone cyst. Radiographic findings are not pathognomonic, so <b>biopsy is needed</b>.",
]))
st.append(fig("lch_femur.jpg", "Pediatric femur with ill-defined diaphyseal lucency, endosteal scalloping and layered periosteal reaction, typical of LCH.", 55, 75))
st.append(P("Treatment and prognosis", h2))
st.append(bullets([
"Solitary lesions: observation or immobilisation, curettage, intralesional steroid or low-dose radiotherapy; may regress spontaneously. Vertebra plana often reconstitutes height; surgery for instability or neurological deficit.",
"Multifocal or multisystem disease: systemic chemotherapy (for example vinblastine with prednisolone); BRAF/MEK inhibitors for refractory disease (general knowledge).",
"Prognosis: excellent for unifocal disease; poor in infants with multisystem disease and organ dysfunction.",
]))
st.append(P("Exam points: CD1a+/langerin+/S-100+; Birbeck granules; eosinophils; vertebra plana with preserved disc; Hand-Schuller-Christian triad; Letterer-Siwe is the acute infantile multisystem form.", box))
st.append(P("6. Osteonecrosis (avascular necrosis)", h1))
st.append(bullets([
"<b>Definition:</b> infarction (ischemic necrosis) of bone and marrow. <b>Causes:</b> trauma and vascular injury, corticosteroids, sickle cell disease, radiation, vasculitis, idiopathic (about 25%). Mechanisms: mechanical vessel disruption, thrombotic occlusion, extravascular compression. Peaks in middle adulthood; about 10% of hip replacements in the US.",
"<b>Medullary infarcts</b> involve trabecular bone and marrow but spare the cortex (periosteal collateral flow). <b>Subchondral infarcts</b> are wedge-shaped with the subchondral plate as the base; the overlying cartilage survives on synovial fluid.",
"Dead bone shows <b>empty lacunae</b>. Viable trabeculae act as scaffolds for new bone while osteoclasts resorb necrotic trabeculae. Slow repair in subchondral infarcts leads to <b>collapse</b>, cartilage sloughing and secondary osteoarthritis.",
"Clinical: pain on activity, later constant. Treatment from limited weight bearing to surgery.",
]))
st.append(P("7. Fractures and fracture healing", h1))
st.append(P("<b>Types:</b> simple, compound, comminuted, displaced, stress, greenstick (children), pathologic (through diseased bone, for example tumor)."))
st.append(numbered([
"<b>Hematoma</b> fills the gap and forms a fibrin scaffold; platelets and inflammatory cells release PDGF, TGF-beta and FGF.",
"<b>Soft callus (procallus)</b> bridges the ends by about the end of week 1.",
"<b>Bony callus</b> by about week 2: woven bone is laid down, and cartilage along the fracture line undergoes endochondral ossification.",
"<b>Remodeling</b> under weight bearing resorbs unstressed callus; woven bone is replaced by lamellar bone and the medullary cavity is restored.",
]))
st.append(P("Impeded healing: infection, inadequate immobilisation, devitalised bone, poor nutrition or blood supply. Complications: delayed union, non-union (pseudoarthrosis), malunion."))
st.append(P("8. Quick revision table", h1))
st += table(["Disease", "Key defect", "Hallmark morphology", "Key biochemistry / marker"], [
["Osteoporosis", "Low bone mass, normal quality", "Thin, perforated trabeculae", "Ca, PO4, ALP normal"],
["Rickets / osteomalacia", "Defective mineralisation", "Excess unmineralised osteoid", "Low vitamin D; ALP raised"],
["Hyperparathyroidism", "Raised PTH", "Dissecting osteitis, brown tumor", "Ca high, PO4 low, ALP high"],
["Paget disease", "Overactive osteoclasts (SQSTM1)", "Mosaic pattern of lamellar bone", "ALP high, Ca normal"],
["Osteopetrosis", "Failed osteoclast function", "Solid bone, no marrow cavity", "Anemia, pancytopenia"],
["Osteogenesis imperfecta", "Type I collagen defect", "Thin bone, blue sclerae", "Ca, PO4 normal"],
["Fibrous dysplasia", "GNAS1 mutation", "C-shaped woven bone, no osteoblast rimming", "Usually normal"],
["LCH", "Clonal Langerhans cells (BRAF V600E in about half)", "Grooved nuclei, abundant eosinophils", "CD1a, langerin, S-100; Birbeck granules"],
["Osteonecrosis", "Ischemia", "Empty lacunae, subchondral wedge", "Normal"],
], [34, 44, 52, 44])
st.append(P("Exam tips: start with a classification table; quote the genetics (FGFR3, COL1A1/COL1A2, SQSTM1, GNAS1, RANKL/OPG, BRAF); draw the mosaic pattern of Paget disease and dissecting osteitis; note that \"dissecting osteitis\" and \"osteitis deformans\" are misnomers.", box))
# ---------------- PART 2 ----------------
st.append(PageBreak())
st.append(P("PART 2. Non-neoplastic giant cell lesions of bone", part))
st.append(P("Overview", h1))
st.append(P("These lesions contain multinucleated osteoclast-type giant cells but are reactive, genetic or metabolic. They are not true giant cell tumors (GCT). "
"They look alike histologically, so diagnosis depends on clinical, biochemical and radiological correlation."))
st.append(bullets([
"Giant cell reparative granuloma (central giant cell granuloma, giant cell reaction of bone)",
"Brown tumor of hyperparathyroidism",
"Aneurysmal bone cyst (ABC), including its solid variant",
"Cherubism",
"Others that can contain giant cells: fibrous dysplasia, non-ossifying fibroma, chondroblastoma, Paget disease, fracture callus",
]))
st.append(P("1. Giant cell reparative granuloma (central giant cell granuloma)", h1))
st.append(bullets([
"<b>Definition:</b> benign; granuloma-like aggregates of giant cells in a fibrovascular stroma. First described by Jaffe in 1953 in the jaws. (Scott-Brown's, Vol 1)",
"<b>Who and where:</b> children and young adults, F:M about 2:1. Mandible and maxilla most often, then sphenoid and temporal bones. Most occur before age 30 and can cross the midline in the anterior maxilla (K J Lee). Extragnathic cases occur in hand and foot bones.",
"<b>Presentation:</b> pain and swelling; skull base lesions can cause diplopia, hearing loss, vertigo or tinnitus.",
"<b>Imaging:</b> CT shows an expansile lytic lesion with a \"soap bubble\" centre and well-demarcated edges; unilocular or multilocular.",
"<b>Histology:</b> cellular fibroblastic stroma with giant cell aggregates. Giant cells are smaller and have fewer nuclei than in true GCT. Mitoses may be present but the lesion is benign.",
"<b>Pitfalls:</b> indistinguishable histologically from the solid variant of ABC (Campbell's: the solid variant is often called giant cell reparative granuloma). Also mimics brown tumor, so check serum calcium, phosphate, ALP and PTH.",
"<b>Treatment:</b> curettage or excision. Curettage alone has about 15% recurrence, so excision is preferred where possible. Jaw lesions: intralesional steroids, calcitonin or interferon are options. Prognosis is good.",
]))
st.append(P("2. Brown tumor of hyperparathyroidism", h1))
st.append(bullets([
"Primary hyperparathyroidism (parathyroid adenoma) or secondary hyperparathyroidism (chronic renal failure). Usually only diffuse demineralisation; focal brown tumor is rare. It resembles GCT and is hard to tell apart.",
"<b>Diagnosis</b> from serum calcium, phosphorus, ALP and PTH, not from histology of the focal lesion.",
"<b>Histology favouring hyperparathyroidism:</b> smaller, often nodular giant cells (especially around hemorrhage); more spindle-shaped, delicate stromal cells; prominent osseous metaplasia; surrounding bone with intense osteoclastic and osteoblastic activity and peritrabecular fibrosis.",
"<b>Treatment:</b> treat the endocrine disease; orthopaedic care covers actual or impending pathologic fractures. (Campbell's)",
]))
st.append(P("3. Aneurysmal bone cyst (ABC)", h1))
st.append(bullets([
"<b>Nature:</b> locally destructive, blood-filled reactive lesion, \"not considered to be true neoplasms\" in Campbell's. Robbins notes a USP6 rearrangement in the spindle cells, so some authors regard it as neoplastic.",
"<b>Epidemiology:</b> most under 20, slight female predominance; proximal humerus, distal femur, proximal tibia and spine (15-20%, posterior elements).",
"<b>Presentation:</b> mild to moderate pain for weeks to months; rapid growth can mimic malignancy; spinal lesions may cause neurological deficit.",
"<b>Radiology:</b> eccentric, expansile, lytic metaphyseal lesion elevating the periosteum, with a thin cortical shell. MRI: multiloculated cavities with double-density fluid-fluid levels and septations (helps separate from unicameral bone cyst). Bone scan: central photopenia with peripheral uptake.",
"<b>Pathology:</b> cavitary lesion with blood-filled septate spaces; septa of cellular stroma with giant cells and reactive woven bone; no endothelial lining.",
"<b>Pathogenesis:</b> possibly a local circulatory disturbance with raised venous pressure and hemorrhage. Primary ABC: 17p13 rearrangement fusing USP6 to COL1A1 with USP6 overexpression; USP6 is a deubiquitinating enzyme that upregulates NF-kB and matrix metalloproteases. Secondary ABC-like change occurs in GCT, chondroblastoma, osteoblastoma, fibrous dysplasia, non-ossifying fibroma and chondromyxoid fibroma, so sample adequately.",
"<b>Treatment:</b> extended curettage with bone graft or substitute (Campbell's); embolization and sclerotherapy are other options.",
]))
st.append(fig("abc.png", "Aneurysmal bone cyst. (A) MRI with fluid-fluid levels. (B) Gross hemorrhagic, spongelike appearance. Robbins & Kumar Basic Pathology, Fig. 19.26.", 140, 80))
st.append(P("4. Cherubism", h1))
st.append(bullets([
"<b>Genetics:</b> autosomal dominant, mapping to 4p16.3 (SH3BP2). Weaker penetrance in females, so males more often affected. (Scott-Brown's)",
"<b>Onset:</b> usually age 2 to 5, before age 7.",
"<b>Clinical:</b> painless bilateral swelling of the mandibular angles (and posterior maxillae in severe cases) giving a chubby face; upturned eyes with maxillary involvement; tooth displacement; speech and swallowing problems; cervical lymphadenopathy from reactive hyperplasia.",
"<b>Imaging:</b> multiple bilateral multilocular radiolucencies with fine bony septa in upper and lower jaws.",
"<b>Histology:</b> early lesions resemble giant cell granuloma (giant cells in cellular vascular fibrous tissue, perivascular hyaline cuffing); older lesions show increasing bony repair.",
"<b>Course:</b> rapid growth first, slowing at puberty, then gradual regression. Observation; curettage or contouring rarely needed.",
]))
st.append(P("Comparison with true giant cell tumor", h1))
st += table(["Feature", "GCT (neoplastic)", "Giant cell granuloma", "Brown tumor", "ABC", "Cherubism"], [
["Age", "20 to 40, closed physis", "Under 30", "Any, with metabolic disease", "Under 20", "2 to 5 years"],
["Site", "Epiphysis of long bone", "Jaw; small bones of hand and foot", "Any; often jaw, pelvis, ribs", "Metaphysis, spine", "Mandible and maxilla, bilateral"],
["Giant cells", "Large, many nuclei, evenly spread", "Smaller, clustered", "Smaller, nodular near hemorrhage", "Scattered in septa", "Clustered in vascular stroma"],
["Key test", "Imaging, histology", "Exclude hyperparathyroidism", "Ca, PO4, ALP, PTH", "MRI fluid levels, USP6", "Family history, SH3BP2"],
], [20, 30, 30, 32, 28, 34])
st.append(P("Practical approach: check Ca, PO4, ALP and PTH first; consider age, site and physeal status; look for fluid-fluid levels (ABC) and bilateral jaw lesions or family history (cherubism); sample thoroughly because secondary ABC change can sit on another primary lesion; use molecular tests when needed (USP6 for ABC, H3F3A for GCT; H3F3A is general knowledge).", box))
# ---------------- PART 3 ----------------
st.append(PageBreak())
st.append(P("PART 3. Radiological appearances indicating pathological change in bone tumors", part))
st.append(P("Radiographs are still the most useful first test for a bone lesion. Look at the lesion's behavior (margin, destruction, periosteal reaction, cortex) and its matrix. "
"Margin and destruction pattern show how aggressive the lesion is; matrix shows what tissue it makes. (Grainger & Allison's, Ch. 40-41)"))
st.append(P("1. Clinical context", h1))
st.append(bullets([
"<b>Age:</b> first 2 years, neuroblastoma metastases; 1st and 2nd decades, osteosarcoma and Ewing sarcoma; 3rd and 4th decades, GCT, lymphoma, parosteal osteosarcoma; after 40, metastasis, myeloma and chondrosarcoma.",
"<b>Predisposing conditions:</b> hereditary multiple exostoses, Ollier and Maffucci syndromes, Paget disease, prior radiotherapy, Rothmund-Thomson syndrome, retinoblastoma. <b>Multiple lesions</b> make metastasis more likely than a primary tumor.",
]))
st.append(P("2. Site: which bone and where in the bone", h1))
st.append(bullets([
"<b>Epiphysis / subarticular:</b> GCT, chondroblastoma, malignant GCT, clear cell chondrosarcoma.",
"<b>Metaphysis / metadiaphysis:</b> conventional osteosarcoma (50-75% at distal femur or proximal tibia).",
"<b>Diaphysis, intramedullary:</b> Ewing sarcoma; adamantinoma and osteofibrous dysplasia in the tibial diaphysis.",
"<b>Bone surface:</b> parosteal osteosarcoma (70% posterior distal femur) and periosteal osteosarcoma.",
"<b>Hands and feet:</b> cartilage lesions such as enchondroma. <b>Sacrum and clivus:</b> chordoma. <b>Posterior spinal elements:</b> osteoblastoma, ABC.",
]))
st.append(P("3. Margin and pattern of destruction (rate of growth)", h1))
st += table(["Pattern", "Appearance", "Meaning"], [
["Type 1A (geographic)", "Well-defined lytic lesion with sclerotic rim", "Slow growth, benign or low grade"],
["Type 1B", "Well-defined lytic lesion, no sclerotic rim", "Benign or low grade, a little more active"],
["Type 1C", "Slightly less sharp, non-sclerotic margin", "Intermediate"],
["Type 2 (moth-eaten)", "Multiple 2-5 mm lucent areas separated by intact trabeculae", "Aggressive (lymphoma, high-grade sarcoma)"],
["Type 3 (permeative)", "Coalescing lucencies of 1 mm or less; zone of transition of several centimetres", "Most aggressive (Ewing sarcoma, round cell tumors)"],
], [36, 82, 56])
st.append(bullets([
"<b>Benign or low-grade</b> lesions stay in the medullary cavity until late; endosteal scalloping plus periosteal new bone gives <b>bone expansion</b>. <b>High-grade</b> tumors usually breach the cortex by presentation, with cortical destruction and an extra-osseous mass.",
"<b>Cortical saucerisation</b> (outer cortex eroded from beneath a tumor restrained by periosteum) is typical of Ewing sarcoma. Radiographs underestimate medullary extent; MRI shows it better.",
]))
st.append(P("4. Periosteal reaction", h1))
st.append(P("No type is pathognomonic; the type reflects aggressiveness."))
st += table(["Type", "Meaning"], [
["Solid, thick, well-formed", "Slow growth. Not always benign: can occur with grade 2 chondrosarcoma; osteoid osteoma causes it too."],
["Laminated (onion skin)", "Subperiosteal tumor extension, infection or hematoma. Classic for Ewing sarcoma."],
["Multilaminated", "Periodic or episodic growth."],
["Codman triangle (angle)", "Elevated interrupted periosteum marking the longitudinal limit of subperiosteal tumor. Osteosarcoma and Ewing sarcoma (27% of Ewing cases)."],
["Spiculated, sunburst, hair-on-end", "Mineralisation perpendicular to cortex; a rapidly evolving process. Osteosarcoma and Ewing sarcoma (about 50% of Ewing cases)."],
], [48, 126])
st.append(fig("periosteal.png", "Types of periosteal reaction: (A) solid, (B) osteoid osteoma nidus on CT, (C) multilaminated, (D) Codman triangle in Ewing sarcoma, (E) sunburst in surface osteosarcoma, (F) hair-on-end. Grainger & Allison's, Fig. 40.4.", 100, 105))
st.append(fig("onion.png", "Lamellated \"onion skin\" periosteal reaction in the tibia, an aggressive sign in sarcomas such as Ewing sarcoma. Fig. 41.16.", 38, 85))
st.append(P("5. Matrix mineralisation", h1))
st.append(P("Matrix does not separate benign from malignant; it shows the tissue of origin."))
st.append(bullets([
"<b>Chondral:</b> ring-and-arc, punctate, stippled or \"popcorn\" calcification (enchondroma, chondrosarcoma).",
"<b>Osseous:</b> solid, amorphous, cloud-like or ivory-like (osteosarcoma).",
"<b>Ground glass:</b> fibrous dysplasia.",
"<b>None:</b> GCT, myeloma, lymphoma. Ewing sarcoma makes no tumor bone; any sclerosis is reactive.",
]))
st.append(fig("matrix.png", "Types of matrix mineralisation: (A) chondral (enchondroma), (B) osseous cloud-like (high-grade osteosarcoma), (C) ground glass (fibrous dysplasia). Fig. 40.5.", 160, 55))
st.append(P("6. Cortex, soft tissue and the rest of the bone", h1))
st.append(bullets([
"Cortical destruction with soft-tissue extension means high grade. Soft-tissue mass is present in about 80% of Ewing sarcomas.",
"Pathological fracture can complicate any lytic lesion.",
"Skip metastases: about 5% of osteosarcoma and 12% of Ewing sarcoma. Image the whole bone on at least one MRI sequence.",
]))
st.append(P("7. Appearances of specific tumors", h1))
st.append(P("Malignant", h2))
st.append(bullets([
"<b>Conventional osteosarcoma:</b> metaphyseal; moth-eaten or permeative destruction; entirely lytic (13%) through mixed to entirely sclerotic; frequent cortical destruction with eccentric soft-tissue mass containing amorphous osseous matrix; complex periosteal reaction (sunburst, onion skin, Codman). MRI is mandatory for staging and skip lesions; lung metastases are peripheral and may be mineralised.",
"<b>Parosteal osteosarcoma:</b> densely mineralised broad-based mass on the posterior distal femur; thin radiolucent line may separate the peripheral part from cortex; medullary invasion in about 15%; low signal on all MRI sequences.",
"<b>Periosteal osteosarcoma:</b> surface lesion, marked T2 high signal from chondroid content. <b>Telangiectatic:</b> lytic expansile lesion with fluid-fluid levels, mimics ABC. <b>Low-grade central:</b> lytic, dense or mixed; one third look well defined and mimic fibrous dysplasia. <b>Multicentric:</b> several sclerotic metaphyseal lesions.",
"<b>Ewing sarcoma:</b> permeative lesion with wide zone of transition in the diaphysis/metadiaphysis; soft-tissue mass in 80%; onion skin classic but uncommon; Codman angle 27%; hair-on-end 50%; cortical saucerisation. Flat bones and spine can look sclerotic, mimicking osteosarcoma (reactive sclerosis and end-on spicules, not tumor bone). Differential: osteomyelitis, LCH, stress fracture. MRI: intermediate T1, intermediate to high T2/STIR.",
"<b>Central chondrosarcoma:</b> lytic lesion, well defined in low grade and ill-defined in higher grades; chondroid calcification in 75%; endosteal scalloping with cortical expansion; MRI hyperintense lobulated pattern on T2 with low-signal calcification and peripheral/septal enhancement. Features favouring chondrosarcoma over enchondroma: deep endosteal scalloping, cortical destruction, soft-tissue mass, large size, new pain, growth. A lytic permeative low-T2 area next to the lobulated tumor suggests <b>dedifferentiation</b> (up to 30%); biopsy it. Ribs account for about 9%.",
"<b>Others:</b> chordoma (midline sacrococcygeal or clival destructive mass); lymphoma (moth-eaten lysis); myeloma and metastases in older patients with multiple lesions.",
]))
st.append(P("Benign and intermediate", h2))
st += table(["Tumor", "Key radiological signs"], [
["Giant cell tumor", "Subarticular, eccentric lytic lesion with geographic non-sclerotic margin, usually 5-7 cm. Subchondral or apophyseal bone involved in 95-99%. Trabeculation and expansion common; cortical destruction with extension up to 50%; poorly defined margin 10-15%; periosteal reaction 10-15% (healed fracture). Knee 55%, distal radius, proximal humerus. Metaphysis in the immature skeleton. CT shows cortex best."],
["Osteoid osteoma", "Small nidus (usually under 1.5 cm) with surrounding sclerosis and cortical thickening; CT shows the nidus, which may calcify. Spine: dense pedicle with painful scoliosis. Three-phase bone scan hypervascular with high uptake; a negative scan excludes it."],
["Osteoblastoma", "Nidus over 1.5-2 cm; expansile, lucent or sclerotic with sclerotic rim; posterior spinal elements; cortex may break; surrounding edema."],
["Enchondroma", "Lobulated lytic lesion with stippled or ring-and-arc calcification; proximal phalanges; pathological fracture in 60%."],
["Osteochondroma", "Outgrowth continuous with the medullary cavity and cortex of the parent bone. A thick cartilage cap suggests chondrosarcoma. Malignant change under 1% solitary, under 5% in hereditary multiple exostoses, about 20% in Ollier, about 30% in Maffucci."],
["Fibrous dysplasia", "Ground-glass matrix with sclerotic rim; shepherd's crook deformity of the proximal femur in polyostotic disease."],
["Aneurysmal bone cyst", "Eccentric expansile lytic metaphyseal lesion with thin shell; MRI fluid-fluid levels."],
["Simple bone cyst", "Central fluid-signal lesion in proximal long bones of children; may present with fracture."],
["Non-ossifying fibroma", "Cortically based eccentric lucent lesion with sclerotic scalloped margin."],
["Chondroblastoma", "Well-circumscribed epiphyseal lytic lesion in the skeletally immature (under 30) with stippled calcification; MRI edema out of proportion to the lesion. (Miller's)"],
], [32, 142])
st.append(fig("chondro.png", "Central chondrosarcoma of the femur with chondroid matrix, cortical expansion and deep endosteal scalloping. Grainger & Allison's, Fig. 41.19.", 45, 90))
st.append(P("8. Comparison of the commonest malignant primaries", h1))
st += table(["Feature", "Osteosarcoma", "Ewing sarcoma", "Chondrosarcoma", "GCT"], [
["Age", "Under 30", "5 to 20", "Over 50", "18 to 45"],
["Site", "Metaphysis, knee", "Diaphysis, flat bones", "Pelvis, proximal femur, ribs", "Epiphysis, subarticular"],
["Destruction", "Moth-eaten or permeative", "Permeative", "Lytic, scalloped", "Geographic, no rim"],
["Matrix", "Cloud-like osteoid", "None", "Rings and arcs", "None"],
["Periosteal reaction", "Sunburst, Codman", "Onion skin, hair-on-end, Codman", "Solid, thick", "Rare (healed fracture)"],
["Soft-tissue mass", "Common, mineralised", "Common, large (80%)", "Common in high grade", "Up to 50% extend"],
], [30, 36, 38, 38, 32])
st.append(P("Practical approach: use age and site first; assess margin and zone of transition; classify the periosteal reaction; identify the matrix; use CT for small nidi, occult matrix and cortex, and MRI for full extent, soft-tissue mass, skip lesions and neurovascular involvement; plan biopsy with the treating surgical team and do not label an aggressive lesion benign on imaging alone.", box))
st.append(P("Not retrieved from the library (general knowledge): Lodwick grading names, myeloma and metastasis patterns, Paget disease radiology, osteopetrosis radiology details, BRAF status in LCH, H3F3A in GCT. "
"A PubMed check of recent systematic reviews found nothing that changes the core textbook points above. Verify against your own references before the exam.", small))
doc.multiBuild(st)
print("ok")
cd /tmp/workspace/md-path-revision && python3 make_pdf.py && python3 -c " import pdfplumber p=pdfplumber.open('MD_Pathology_Bone_Lesions_Revision.pdf'); print('pages',len(p.pages)) for i,pg in enumerate(p.pages): t=pg.extract_text() or '' print(i+1, len(t), t[:90].replace('\n',' | ')) "; ls -la
cd /tmp/workspace/md-path-revision && python3 - <<'EOF' from PIL import Image import glob, os for f in glob.glob('img/*'): im = Image.open(f).convert('RGB') if im.width > 1100: im = im.resize((1100, int(im.height*1100/im.width)), Image.LANCZOS) out = os.path.splitext(f)[0] + '.jpg' im.save(out, 'JPEG', quality=85) if out != f: os.remove(f) print(os.listdir('img')) EOF sed -i 's/\.png"/.jpg"/g' make_pdf.py python3 - <<'EOF' p='/tmp/workspace/md-path-revision/make_pdf.py' s=open(p).read() s=s.replace('Spacer(1, 40 * mm), P("MD Pathology Revision", title)','Spacer(1, 30 * mm), P("MD Pathology Revision", title)') s=s.replace(' Spacer(1, 8)]\ntoc = TableOfContents()',' PageBreak()]\ntoc = TableOfContents()') s=s.replace('"Aneurysmal bone cyst. (A) MRI with fluid-fluid levels. (B) Gross hemorrhagic, spongelike appearance. Robbins & Kumar Basic Pathology, Fig. 19.26.", 140, 80','"Aneurysmal bone cyst. (A) MRI with fluid-fluid levels. (B) Gross hemorrhagic, spongelike appearance. Robbins & Kumar Basic Pathology, Fig. 19.26.", 120, 60') open(p,'w').write(s) EOF grep -n "\.png" make_pdf.py | head; python3 make_pdf.py && python3 -c " import pdfplumber p=pdfplumber.open('MD_Pathology_Bone_Lesions_Revision.pdf'); print('pages',len(p.pages)) for i,pg in enumerate(p.pages): t=pg.extract_text() or '' print(i+1, len(t), t[:80].replace('\n',' | ')) "; ls -la MD_Pathology_Bone_Lesions_Revision.pdf
MD Pathology Bone Lesions Revision
PDF Document · PDF