Explain Heart in full description

| Layer | Description |
|---|---|
| Endocardium | Inner smooth lining of endothelial cells; lines chambers and covers valves |
| Myocardium | Thick middle layer of cardiac muscle; responsible for contraction |
| Epicardium | Outer layer (visceral pericardium); contains coronary vessels and fat |
The left ventricle is organized into complex muscle fiber layers. The subepicardial (outer) fibers spiral in a left-handed helix and the subendocardial (inner) fibers spiral in a right-handed (opposite) helix, creating a double helix. This produces a wringing/twisting motion during systole - the apex rotates counterclockwise and the base rotates clockwise (viewed from apex). This torsion aids both ejection and rapid filling during diastole.

Without calcium from the T-tubules, cardiac contraction would be severely reduced, because the sarcoplasmic reticulum of cardiac muscle is less well developed than in skeletal muscle. This is why extracellular calcium concentration directly affects cardiac contractile strength - unlike skeletal muscle.
The unique distribution pattern of the cardiac conduction system establishes a unidirectional pathway of excitation/contraction. Large branches are insulated from surrounding myocardium by connective tissue to prevent inappropriate stimulation.
| Phase | Events | ECG | Valves | Heart Sounds |
|---|---|---|---|---|
| A - Atrial Systole | Atria contract; final ventricular filling | P wave | - | S4 (if present) |
| B - Isovolumetric Ventricular Contraction | Ventricles contract; pressure rises; all valves closed; volume unchanged | QRS complex | Mitral closes | S1 (lub) |
| C - Rapid Ventricular Ejection | Ventricular pressure exceeds aortic; blood ejected rapidly; ventricular volume falls | ST segment | Aortic opens | - |
| D - Reduced Ventricular Ejection | Slower ejection; ventricular volume reaches minimum; aortic pressure begins to fall | T wave | - | - |
| E - Isovolumetric Ventricular Relaxation | Ventricles relax; pressure falls; all valves closed; volume unchanged | - | Aortic closes | S2 (dub) |
| F - Rapid Ventricular Filling | AV valves open; ventricles fill passively; volume rises rapidly | - | Mitral opens | S3 (physiologic in young) |
| G - Reduced Ventricular Filling (Diastasis) | Slow passive filling; heart at lowest volume | - | - | - |
| Factor | Definition | Influencing Conditions |
|---|---|---|
| Heart Rate (HR) | Beats per minute | Autonomic tone, hormones, temperature |
| Preload | Volume of blood in ventricle before contraction; reflected by end-diastolic volume (EDV) | Venous return, blood volume |
| Afterload | Resistance the ventricle must overcome to eject; approximated by aortic/pulmonary pressure | Systemic vascular resistance, aortic stenosis |
| Contractility (Inotropy) | Intrinsic strength of contraction independent of loading conditions | Sympathetic stimulation, catecholamines, calcium |
Pathophysiology on Heart Failure
"heart failure"[MeSH Terms] AND "pathophysiology"[MeSH Terms]
Normal cardiac output is ~5 L/min. Systolic dysfunction (HFrEF) has EF <45% (normal >60%). Diastolic dysfunction (HFpEF) has reduced filling with a relatively preserved EF.

| Category | Examples |
|---|---|
| Pressure overload | Systemic hypertension, aortic stenosis, pulmonary hypertension |
| Volume overload | Valvular regurgitation (mitral/aortic), septal defects, AV fistulas |
| Primary myocardial loss | Myocardial infarction, ischemic heart disease (IHD) |
| Cardiomyopathies | Dilated, hypertrophic, restrictive, toxic (alcohol, anthracyclines) |
| Tachyarrhythmia-mediated | Persistent atrial fibrillation with rapid ventricular response |
| Genetic/infiltrative | Familial cardiomyopathies (sarcomere mutations), amyloidosis, hemochromatosis |
| High-output states | Severe anemia, hyperthyroidism, AV shunts, beriberi |

Cardiac hypertrophy is associated with heightened metabolic demands and inadequate capillary density, making the hypertrophied heart vulnerable to ischemia-related decompensation.

| Effect | Result |
|---|---|
| Angiotensin II | Potent vasoconstriction → ↑ afterload |
| Aldosterone | Sodium and water retention → ↑ preload and congestion |
| Angiotensin II | Promotes myocardial and vascular fibrosis (remodeling) |
| Angiotensin II | Stimulates further norepinephrine release from sympathetic nerve endings |
| Combined | Self-amplifying loop accelerating dysfunction |
Remodeling includes proliferation of connective tissue cells and abnormal myocytes with biochemical characteristics of fetal myocytes. Ultimately, myocytes die at an accelerated rate via apoptosis, and remaining myocytes are subject to even greater stress.
| Organ | Effect |
|---|---|
| Subcutaneous tissue | Dependent/pedal edema, pretibial edema, sacral edema, anasarca |
| Liver | "Nutmeg liver" - centrilobular congestion (red-brown mottling); cardiac cirrhosis with chronic congestion |
| Spleen | Congestive splenomegaly |
| GI tract | Gut congestion → malabsorption, "cardiac cachexia" |
| Kidneys | Venous congestion + reduced arterial flow → azotemia, sodium retention |
| Jugular veins | Elevated JVP, hepatojugular reflux |
Initial insult (MI, hypertension, valve disease)
↓
↓ Cardiac output
↓
Baroreceptor activation → SNS + RAAS stimulation
↓
↑ HR, ↑ contractility, ↑ vasoconstriction (afterload ↑), ↑ sodium/water retention (preload ↑)
↓
Short-term: maintained CO (compensation)
↓
Prolonged: β1-downregulation, Ca²⁺ cycling impairment, RAAS-mediated fibrosis,
myocyte apoptosis, ventricular remodeling, mitral regurgitation
↓
Further ↓ EF → more neurohormonal activation → progressive remodeling
↓
End-stage: severe biventricular failure, arrhythmias, renal failure, death
| Biomarker | Source | Significance |
|---|---|---|
| BNP / NT-proBNP | Ventricular myocytes (wall stress) | Elevated: confirms HF, tracks severity and prognosis |
| Troponin I/T | Cardiomyocyte necrosis | Elevated in acute decompensation and HFrEF |
| Norepinephrine | Sympathetic activation | Elevated levels associated with worse prognosis |
| Aldosterone | RAAS activation | Drives sodium retention and myocardial fibrosis |
| Endothelin-1 | Vascular endothelium | Vasoconstriction, pulmonary hypertension |
| Creatinine/GFR | Cardiorenal syndrome | Worsening = adverse prognostic marker |
Connective tissue It's types, Function, Cells, Fiber, ECM, and It's location
The variety of connective tissue types in the body reflects differences in composition and amount of the cells, fibers, and ground substance, which together are responsible for the remarkable structural, functional, and pathologic diversity of connective tissue.

| Type | Structure | Function | Location |
|---|---|---|---|
| Mesenchyme | Sparse, undifferentiated spindle cells in sparse collagen matrix | Contains stem/progenitor cells for all adult connective tissue | Mesodermal layer of early embryo |
| Mucoid (Mucous) Connective Tissue | Random fibroblasts and collagen fibers in viscous hyaluronan-rich matrix | Supports and cushions large blood vessels | Wharton's jelly of fetal umbilical cord |

| Type | Key Features | Location |
|---|---|---|
| Reticular Connective Tissue | Delicate type III collagen (reticulin) network; argyrophilic (silver-staining); produced by reticular cells | Bone marrow, liver, spleen, lymph nodes, all lymphoid organs, endocrine glands |
| Adipose Tissue | Dominated by adipocytes; ECM is sparse; subdivided into unilocular (white) and multilocular (brown) | Subcutaneous tissue, omentum, bone marrow, periorbital |
| Cartilage | Rigid ECM rich in type II collagen and proteoglycans; avascular; chondrocytes in lacunae | Articular surfaces, trachea, ear, nose, intervertebral discs |
| Bone | Mineralized ECM (hydroxyapatite); type I collagen; osteocytes in lacunae | Skeleton |
| Blood | Liquid ECM (plasma); circulating cells | Cardiovascular system |
| Function | Mechanism |
|---|---|
| Structural support | ECM fibers provide tensile strength and framework for all tissues and organs |
| Binding and connection | Connects epithelia to underlying structures; binds muscles to bone (tendons), bone to bone (ligaments) |
| Metabolic exchange | Interstitial fluid within ground substance serves as the direct medium for diffusion of O₂, nutrients, CO₂, and metabolic wastes between cells and blood |
| Immune defense | Contains macrophages, lymphocytes, plasma cells, neutrophils, eosinophils, and mast cells that survey and respond to pathogens and foreign material |
| Energy storage | Adipocytes store neutral lipids; mobilized as fatty acids during energy demands |
| Transport | Ground substance is the medium through which substances travel from blood to parenchymal cells |
| Tissue repair and regeneration | Fibroblasts proliferate and deposit new ECM after injury; wound healing |
| Scaffolding for organogenesis | Provides the framework on which developing organs are shaped |
| Thermoregulation | Brown adipose tissue generates heat via uncoupling of oxidative phosphorylation |

| Cell | Origin | Key Function |
|---|---|---|
| Fibroblast/Fibrocyte | Mesenchyme | ECM synthesis and maintenance |
| Adipocyte | Mesenchyme | Fat storage, endocrine |
| Mast cell | Bone marrow | Allergy, inflammation, defense |
| Macrophage | Bone marrow monocyte | Phagocytosis, antigen presentation, cytokines |
| Plasma cell | B lymphocyte | Antibody secretion |
| Lymphocyte | Bone marrow | Immune surveillance |
| Neutrophil | Bone marrow | Bacterial phagocytosis |
| Eosinophil | Bone marrow | Anti-parasite, allergy modulation |
| Type | Fiber Structure | Major Locations |
|---|---|---|
| Type I | Thick fibers/bundles; most abundant (90% of all collagen) | Bone, dermis, tendons, ligaments, organ capsules, cornea, fascia |
| Type II | Thin fibrils | Hyaline and elastic cartilage, vitreous humor of eye, nucleus pulposus |
| Type III | Thin reticular fibers; forms reticulin | Lymphoid organs, bone marrow, liver, lung, blood vessels (early wound healing) |
| Type IV | Non-fibrillar sheet; meshwork | Basal laminae (basement membranes) of all epithelia |
| Type V | Mixed with type I | Cornea, bone, placenta |
| Type VII | Anchoring fibrils | Skin - anchors epidermis to dermis |
| Type IX, X, XI | Fibril-associated collagens | Cartilage matrix regulation |
| Feature | Collagen (Type I) | Reticular (Type III) | Elastic |
|---|---|---|---|
| Protein | Collagen I | Collagen III | Elastin + fibrillin |
| Diameter | 1-20 μm (bundles) | 0.5-2 μm | 0.2-1 μm |
| Arrangement | Parallel or random bundles | Delicate networks | Branching networks or lamellae |
| H&E stain | Pink | Poorly visible | Pale/barely visible |
| Special stain | Masson trichrome (blue) | Silver stain (black) | Orcein (dark) |
| Strength | High tensile strength | Delicate support | Elastic recoil |

| GAG | Key Features | Location |
|---|---|---|
| Hyaluronan (Hyaluronic acid) | Largest GAG; not sulfated; not covalently bound to protein; extremely hydrophilic | Ubiquitous: synovial fluid, vitreous humor, umbilical cord, embryonic tissues |
| Chondroitin sulfate | Sulfated; most abundant GAG in body | Cartilage, bone, tendon, skin |
| Dermatan sulfate | Sulfated; associated with type I collagen | Skin, blood vessels, heart valves, tendons |
| Heparan sulfate | Sulfated; component of basal laminae | Basement membranes, cell surfaces |
| Heparin | Highly sulfated; stored in mast cell granules | Mast cells, anticoagulation |
| Keratan sulfate | Sulfated; lacks uronic acid | Cornea, cartilage, intervertebral disc |
| Glycoprotein | Binds to | Function |
|---|---|---|
| Fibronectin | Collagen, heparan sulfate, integrins, fibrin | Cell adhesion, migration, wound healing; essential for fibroblast and immune cell movement through matrix |
| Laminin | Type IV collagen, nidogen, perlecan, integrins | Major glycoprotein of basal laminae; promotes cell attachment, differentiation, and polarization |
| Nidogen/Entactin | Laminin + type IV collagen | Bridging molecule linking the two lamina components |
| Tenascin | Fibronectin, proteoglycans | Anti-adhesive; modulates cell-matrix interactions; expressed in wound healing and tumor stroma |
| SPARC (Osteopontin) | Collagen, integrins | Regulates ECM assembly and cell-matrix signaling |
| CT Type | Key ECM Feature | Cells Present | Body Location |
|---|---|---|---|
| Loose (areolar) | Abundant ground substance, mixed loose fibers | Fibroblasts, macrophages, mast cells, plasma cells, leukocytes | Lamina propria (GI, respiratory tracts), dermis, mesenteries, nerve/muscle sheaths |
| Dense irregular | Thick collagen bundles, random arrangement | Mainly fibroblasts | Skin dermis, organ capsules (kidney, testis), submucosa, periosteum |
| Dense regular | Parallel collagen bundles | Fibroblasts (tenocytes) | Tendons, ligaments, aponeuroses, corneal stroma |
| Reticular | Type III collagen network | Reticular cells (fibroblasts) | Bone marrow, liver, spleen, lymph nodes, endocrine glands |
| Adipose (white) | Minimal ECM; unilocular adipocytes dominate | Adipocytes | Subcutaneous fat, omentum, retroperitoneum, breast |
| Adipose (brown) | Minimal ECM; multilocular adipocytes | Adipocytes | Interscapular region (infants), perirenal, neck |
| Hyaline cartilage | Type II collagen + aggrecan | Chondrocytes | Articular surfaces, trachea, bronchi, costal cartilage, larynx |
| Elastic cartilage | Type II collagen + elastic fibers | Chondrocytes | Ear pinna, epiglottis, auditory tube |
| Fibrocartilage | Mostly type I collagen | Chondrocytes | Intervertebral discs, pubic symphysis, menisci |
| Bone (compact) | Mineralized type I collagen in osteons | Osteocytes, osteoblasts, osteoclasts | Diaphysis of long bones, flat bones |
| Bone (spongy) | Mineralized type I collagen; trabeculae | Same as compact | Epiphyses, vertebral bodies, diploe of flat bones |
| Blood | Plasma (liquid ECM) | RBCs, WBCs, platelets | Cardiovascular system |
| Mucoid | Hyaluronan-rich viscous matrix | Fibroblasts | Umbilical cord (Wharton's jelly) |
| Mesenchyme | Sparse collagen; viscous proteoglycan matrix | Mesenchymal stem cells | Embryo |
Create a summary PDF comparing all CT types with histology images
mkdir -p /home/daytona/workspace/connective-tissue-pdf && ls /home/daytona/workspace/
~/connective-tissue-pdf/build_pdf.py
#!/usr/bin/env python3
"""
Build a comprehensive Connective Tissue comparison PDF with histology images.
"""
import urllib.request
import os
import io
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import cm, mm
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
Image, PageBreak, HRFlowable, KeepTogether
)
from reportlab.platypus.flowables import HRFlowable
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont
# ── Output path ────────────────────────────────────────────────────────────────
OUTPUT = "/home/daytona/workspace/connective-tissue-pdf/Connective_Tissue_Summary.pdf"
IMG_DIR = "/home/daytona/workspace/connective-tissue-pdf/images"
os.makedirs(IMG_DIR, exist_ok=True)
# ── Image URLs (from Junqueira's + Ross Histology textbooks) ──────────────────
IMAGES = {
"ct_components": "https://cdn.orris.care/cdss_images/00c882cccb96ef3d8ba8a0692508941fe3abcd7bf4541485469b212df382324e.png",
"loose_dense_histo": "https://cdn.orris.care/cdss_images/296617e98af409f96cb62ba5366913cd0185e7cb888ea3b03b407ecfdaed61a8.png",
"loose_ct_diagram": "https://cdn.orris.care/cdss_images/3519723abb817746727ef1a5567889d7244a66e15ca00966b8fec139151f2327.png",
"loose_ct_section": "https://cdn.orris.care/cdss_images/3d89ba8e1f0f6e698d8d155713d82030d1ea02e24a7ab389c7db7eb7697741a7.png",
"dense_irregular": "https://cdn.orris.care/cdss_images/b6bd8d7a398ea733232bae89b74a6390f768b9bb191c2ffea42b239bd50d8ae6.png",
"tendon_longitudinal": "https://cdn.orris.care/cdss_images/9c70ef39f4ed67ed512c16f75c01ddd2ea4da49785ba35369e277cf327a35152.png",
"reticular_fibers_1": "https://cdn.orris.care/cdss_images/b769964d13f7fb39002a12dd72cd1cf744a21171b8496c40cc67a0f6da148502.png",
"reticular_fibers_2": "https://cdn.orris.care/cdss_images/f091cb15dfdc09138c9a732bdd4090c0a724e8305b01ab423852a8866308edfb.png",
"elastic_fibers": "https://cdn.orris.care/cdss_images/f823c0233b3b6128b63f20f5172bbbb7fad7a97fa13cd1fec665da497d61dbc6.png",
"collagen_triple_helix": "https://cdn.orris.care/cdss_images/edb4b159545616a2a56fca8ee0d33e0f29f2161bfbc28b63f45210336d469f2f.png",
"ecm_overview": "https://cdn.orris.care/cdss_images/587dc018680ba9587b33609fa74007b74bfa1dae94c0a90c1f1d1eed79815f01.png",
"mesenchyme": "https://cdn.orris.care/cdss_images/c787a22d227a732e462532e6bbea76b7e6b627e90ccf952cace14d0736ccd221.png",
"lv_hypertrophy_normal": "https://cdn.orris.care/cdss_images/d52449c76c8b9dabef9b79bf6f5f4952f0c87432de5573454f25676dcabe9de0.png", # normal vs hypertrophied myocardium (histology comparison)
}
def download_image(name, url):
path = os.path.join(IMG_DIR, f"{name}.png")
if not os.path.exists(path):
try:
req = urllib.request.Request(url, headers={"User-Agent": "Mozilla/5.0"})
with urllib.request.urlopen(req, timeout=15) as r:
data = r.read()
with open(path, "wb") as f:
f.write(data)
print(f" ✓ {name}")
except Exception as e:
print(f" ✗ {name}: {e}")
return None
return path
print("Downloading images...")
img_paths = {k: download_image(k, v) for k, v in IMAGES.items()}
print("Done.\n")
# ── Styles ────────────────────────────────────────────────────────────────────
styles = getSampleStyleSheet()
def make_style(name, parent="Normal", **kw):
s = ParagraphStyle(name, parent=styles[parent], **kw)
return s
title_style = make_style("DocTitle", "Heading1", fontSize=22, textColor=colors.HexColor("#1a3d6b"),
spaceAfter=6, alignment=TA_CENTER, fontName="Helvetica-Bold")
subtitle_style= make_style("DocSubtitle", "Normal", fontSize=11, textColor=colors.HexColor("#4a6fa5"),
spaceAfter=16, alignment=TA_CENTER)
h1_style = make_style("H1", "Heading1", fontSize=16, textColor=colors.HexColor("#1a3d6b"),
spaceBefore=14, spaceAfter=6, fontName="Helvetica-Bold",
borderPad=4, backColor=colors.HexColor("#e8f0f9"),
borderColor=colors.HexColor("#1a3d6b"), borderWidth=0.5)
h2_style = make_style("H2", "Heading2", fontSize=13, textColor=colors.HexColor("#2c5f8a"),
spaceBefore=10, spaceAfter=4, fontName="Helvetica-Bold")
h3_style = make_style("H3", "Heading3", fontSize=11, textColor=colors.HexColor("#2c5f8a"),
spaceBefore=8, spaceAfter=3, fontName="Helvetica-BoldOblique")
body_style = make_style("Body", "Normal", fontSize=9.5, leading=14,
spaceAfter=4, alignment=TA_JUSTIFY)
caption_style = make_style("Caption", "Normal", fontSize=8, textColor=colors.HexColor("#555555"),
alignment=TA_CENTER, spaceAfter=8, fontName="Helvetica-Oblique")
bullet_style = make_style("Bullet", "Normal", fontSize=9.5, leading=13,
leftIndent=12, spaceAfter=2)
source_style = make_style("Source", "Normal", fontSize=7.5, textColor=colors.HexColor("#777777"),
alignment=TA_CENTER, spaceAfter=2)
toc_style = make_style("TOC", "Normal", fontSize=10, leading=16, leftIndent=8)
PAGE_W, PAGE_H = A4
def img_flowable(key, width_cm, caption=""):
p = img_paths.get(key)
if not p or not os.path.exists(p):
return Spacer(1, 0.3*cm)
w = width_cm * cm
items = [Image(p, width=w, height=None)] # auto height
if caption:
items.append(Paragraph(caption, caption_style))
return items
# ── Helper: colored section header ───────────────────────────────────────────
def section_header(text, color="#1a3d6b", bg="#e8f0f9"):
data = [[Paragraph(text, make_style("SH", "Normal", fontSize=13,
fontName="Helvetica-Bold",
textColor=colors.HexColor(color)))]]
t = Table(data, colWidths=[17*cm])
t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), colors.HexColor(bg)),
("TOPPADDING", (0,0), (-1,-1), 6),
("BOTTOMPADDING", (0,0), (-1,-1), 6),
("LEFTPADDING", (0,0), (-1,-1), 10),
("RIGHTPADDING", (0,0), (-1,-1), 6),
("LINEBELOW", (0,0), (-1,-1), 1.5, colors.HexColor(color)),
]))
return t
# ── Build document ─────────────────────────────────────────────────────────────
def build():
doc = SimpleDocTemplate(
OUTPUT,
pagesize=A4,
leftMargin=2*cm, rightMargin=2*cm,
topMargin=2.2*cm, bottomMargin=2.2*cm,
title="Connective Tissue – Complete Summary",
author="Medical Library (Junqueira's, Ross Histology)",
)
story = []
W = 17*cm # usable width
# ── COVER ──────────────────────────────────────────────────────────────────
story += [
Spacer(1, 1*cm),
Paragraph("CONNECTIVE TISSUE", title_style),
Paragraph("Types · Functions · Cells · Fibers · ECM · Locations", subtitle_style),
HRFlowable(width=W, thickness=2, color=colors.HexColor("#1a3d6b")),
Spacer(1, 0.4*cm),
]
# Cover diagram
for fl in img_flowable("ct_components", 14,
"Fig. 1 – Connective tissue components: collagen fibers (pink), elastic fibers (thin branching),\n"
"reticular fibers (fine), and ground substance with resident cells.\n"
"(Junqueira's Basic Histology, 17e)"):
story.append(fl)
story += [
Spacer(1, 0.5*cm),
Paragraph(
"Connective tissue (CT) forms the structural framework of the body. Unlike epithelium, muscle, "
"and nerve – which are cell-dominant – CT is characterized by a large extracellular matrix (ECM) "
"that exceeds the cellular volume in virtually all subtypes. All CT originates from embryonic "
"<b>mesenchyme</b> (mesoderm-derived). The diversity of CT types reflects varying compositions "
"of cells, fibers, and ground substance.",
body_style),
Spacer(1, 0.3*cm),
Paragraph("<b>Sources:</b> Junqueira's Basic Histology 17e · Ross Histology 9e · Basic Medical Biochemistry 6e",
source_style),
PageBreak(),
]
# ── SECTION 1 – CLASSIFICATION TABLE ──────────────────────────────────────
story.append(section_header("1. Classification of Connective Tissue"))
story.append(Spacer(1, 0.3*cm))
# Main classification table
header = ["CT Type", "ECM / Structure", "Cells", "Key Functions", "Body Locations"]
rows = [
# Embryonic
["Mesenchyme\n(Embryonic)", "Sparse collagen; viscous hyaluronan-rich matrix; few fibers",
"Undifferentiated mesenchymal stem cells", "Progenitor of all adult CT cells",
"Embryonic mesoderm"],
["Mucoid / Mucous\n(Embryonic)", "Abundant hyaluronan; viscous gel; sparse collagen",
"Fibroblasts", "Cushions and supports umbilical vessels",
"Wharton's jelly\n(umbilical cord)"],
# Connective tissue proper
["Loose (Areolar)\nCT Proper", "Equal parts cells, random collagen & elastic fibers, abundant ground substance",
"Fibroblasts, macrophages, mast cells, plasma cells, leukocytes, adipocytes",
"Metabolic exchange; immune defense; flexible support; microvasculature support",
"Lamina propria (GI, respiratory); dermis; mesenteries; perivascular sheaths"],
["Dense Irregular\nCT Proper", "Thick type I collagen bundles in random multi-directional arrangement; little ground substance",
"Mainly fibroblasts", "Resist tearing from all directions; protect & support organs",
"Skin dermis; organ capsules (kidney, testis, spleen); submucosa; periosteum"],
["Dense Regular\nCT Proper", "Parallel packed type I collagen bundles; minimal ground substance",
"Fibroblasts (tenocytes/tendinocytes)", "Transmit tensile forces; strong unidirectional connections",
"Tendons, ligaments, aponeuroses, corneal stroma"],
# Specialized
["Reticular CT\n(Specialized)", "Delicate type III collagen (reticulin) network; argyrophilic",
"Reticular cells (specialized fibroblasts)", "Stroma for lymphoid/hematopoietic cells",
"Bone marrow, liver, spleen, lymph nodes, endocrine glands"],
["Adipose – White\n(Specialized)", "Sparse ECM; unilocular adipocytes dominate",
"White adipocytes (single large lipid droplet)", "Energy storage; insulation; cushioning; leptin secretion",
"Subcutaneous fat, omentum, retroperitoneum, breast, bone marrow"],
["Adipose – Brown\n(Specialized)", "Sparse ECM; multilocular adipocytes; mitochondria-rich",
"Brown adipocytes (multiple lipid droplets)", "Non-shivering thermogenesis (UCP-1)",
"Interscapular (infants), perirenal, neck"],
["Hyaline Cartilage\n(Specialized)", "Type II collagen + aggrecan proteoglycans; avascular; glassy matrix",
"Chondrocytes in lacunae", "Smooth articulation; resist compression; framework",
"Articular surfaces, trachea, costal cartilage, larynx, bronchi"],
["Elastic Cartilage\n(Specialized)", "Type II collagen + abundant elastic fibers",
"Chondrocytes", "Flexible support; maintains shape after deformation",
"Ear pinna, epiglottis, auditory tube"],
["Fibrocartilage\n(Specialized)", "Predominantly type I collagen; densely packed fibers",
"Chondrocytes in rows", "Resist compression and shear forces; shock absorption",
"Intervertebral discs, pubic symphysis, menisci, TMJ disc"],
["Compact Bone\n(Specialized)", "Mineralized type I collagen; hydroxyapatite; Haversian system (osteons)",
"Osteocytes, osteoblasts, osteoclasts", "Rigid support; leverage for movement; Ca²⁺ reservoir",
"Diaphysis of long bones, outer layer of flat bones"],
["Spongy Bone\n(Specialized)", "Mineralized type I collagen; trabecular lattice with marrow spaces",
"Same as compact bone", "Lightweight strength; houses red marrow (hematopoiesis)",
"Epiphyses, vertebral bodies, diploe of flat bones"],
["Blood\n(Specialized)", "Liquid plasma (90% water, proteins, ions) = liquid ECM",
"Erythrocytes, leukocytes, platelets", "O₂/CO₂ transport; immunity; hemostasis",
"Cardiovascular system (circulation)"],
]
# Style the table
col_widths = [3.0*cm, 3.8*cm, 3.0*cm, 3.5*cm, 3.7*cm]
all_data = [
[Paragraph(f"<b>{h}</b>", make_style("TH","Normal",fontSize=8.5,
fontName="Helvetica-Bold", textColor=colors.white,
alignment=TA_CENTER)) for h in header]
]
for i, row in enumerate(rows):
bg = colors.HexColor("#f0f4fa") if i % 2 == 0 else colors.white
all_data.append([Paragraph(c, make_style(f"TC{i}","Normal",fontSize=8,
leading=11)) for c in row])
tbl = Table(all_data, colWidths=col_widths, repeatRows=1)
tbl_style = TableStyle([
# Header row
("BACKGROUND", (0, 0), (-1, 0), colors.HexColor("#1a3d6b")),
("TEXTCOLOR", (0, 0), (-1, 0), colors.white),
("FONTNAME", (0, 0), (-1, 0), "Helvetica-Bold"),
("FONTSIZE", (0, 0), (-1, 0), 8.5),
("ALIGN", (0, 0), (-1, 0), "CENTER"),
# Alternating row colours
*[("BACKGROUND", (0, i+1), (-1, i+1),
colors.HexColor("#f0f4fa") if i % 2 == 0 else colors.white)
for i in range(len(rows))],
# Grid
("GRID", (0, 0), (-1, -1), 0.4, colors.HexColor("#c0cce0")),
("TOPPADDING", (0, 0), (-1, -1), 4),
("BOTTOMPADDING",(0, 0), (-1, -1), 4),
("LEFTPADDING", (0, 0), (-1, -1), 4),
("RIGHTPADDING", (0, 0), (-1, -1), 4),
("VALIGN", (0, 0), (-1, -1), "TOP"),
# Section dividers (embryonic / CT proper / specialized)
("LINEABOVE", (0, 1), (-1, 1), 1.2, colors.HexColor("#2c5f8a")), # after header
("LINEABOVE", (0, 3), (-1, 3), 1.2, colors.HexColor("#2c5f8a")), # CT Proper starts
("LINEABOVE", (0, 6), (-1, 6), 1.2, colors.HexColor("#2c5f8a")), # Specialized starts
# First column bold
("FONTNAME", (0, 1), (0, -1), "Helvetica-Bold"),
("FONTSIZE", (0, 1), (0, -1), 8),
])
tbl.setStyle(tbl_style)
story.append(tbl)
story.append(Spacer(1, 0.5*cm))
# Section labels
legend_data = [
[Paragraph("<b>Shading guide:</b>", body_style),
Paragraph("Rows 1–2: Embryonic CT | Rows 3–5: Connective Tissue Proper | Rows 6–14: Specialized CT",
make_style("leg","Normal",fontSize=8, textColor=colors.HexColor("#444444")))],
]
legend = Table(legend_data, colWidths=[3.5*cm, 13.5*cm])
legend.setStyle(TableStyle([("TOPPADDING",(0,0),(-1,-1),2),("BOTTOMPADDING",(0,0),(-1,-1),2)]))
story.append(legend)
story.append(PageBreak())
# ── SECTION 2 – HISTOLOGY IMAGES ──────────────────────────────────────────
story.append(section_header("2. Histology of Connective Tissue Types"))
story.append(Spacer(1, 0.4*cm))
# ── 2a Loose CT ──────────────────────────────────────────────────────────
story.append(Paragraph("2a. Loose (Areolar) Connective Tissue", h2_style))
story.append(Paragraph(
"Loose CT is the most widely distributed CT in the body. It contains cells, collagen fibers, "
"elastic fibers, and reticular fibers in roughly equal proportions, with abundant ground "
"substance (hydrated proteoglycans). It is flexible and metabolically active, housing immune "
"cells that survey for pathogens. Fibroblasts are the dominant cell type.",
body_style))
# Two images side by side: photomicrograph + diagram
loose_img_path = img_paths.get("loose_ct_section")
loose_diag_path = img_paths.get("loose_ct_diagram")
img_row_data = [[]]
img_row_captions = [[]]
if loose_img_path and os.path.exists(loose_img_path):
img_row_data[0].append(Image(loose_img_path, width=8*cm, height=6*cm))
img_row_captions[0].append(Paragraph(
"H&E: Loose CT (L) with fine fibers and\nmany varied nuclei; Dense CT (D) below\n(Junqueira's 17e)",
caption_style))
if loose_diag_path and os.path.exists(loose_diag_path):
img_row_data[0].append(Image(loose_diag_path, width=8*cm, height=6*cm))
img_row_captions[0].append(Paragraph(
"Diagram of loose CT components:\nfibroblast, macrophage, mast cell,\nplasma cell, all fiber types\n(Ross Histology 9e)",
caption_style))
if img_row_data[0]:
img_tbl = Table(img_row_data, colWidths=[8.5*cm, 8.5*cm])
img_tbl.setStyle(TableStyle([("ALIGN",(0,0),(-1,-1),"CENTER"),
("VALIGN",(0,0),(-1,-1),"MIDDLE"),
("LEFTPADDING",(0,0),(-1,-1),0),
("RIGHTPADDING",(0,0),(-1,-1),0)]))
cap_tbl = Table(img_row_captions, colWidths=[8.5*cm, 8.5*cm])
cap_tbl.setStyle(TableStyle([("ALIGN",(0,0),(-1,-1),"CENTER"),
("TOPPADDING",(0,0),(-1,-1),2)]))
story += [img_tbl, cap_tbl, Spacer(1, 0.3*cm)]
# Key features box
features_loose = [
["Feature", "Details"],
["Fibers", "Collagen (type I), elastic, reticular — all present, randomly arranged"],
["Dominant Cell", "Fibroblasts; also macrophages, mast cells, plasma cells, leukocytes"],
["Ground Substance", "Abundant; hydrophilic; allows metabolic exchange"],
["Vascularity", "Richly vascularized; supports nearby epithelia"],
["Stain on H&E", "Pale pink; few dense structures; many nuclei of various shapes"],
["Locations", "Lamina propria, dermis, mesenteries, perivascular tissue, adventitia"],
]
story.append(_mini_table(features_loose))
story.append(Spacer(1, 0.5*cm))
# ── 2b Dense Irregular CT ────────────────────────────────────────────────
story.append(Paragraph("2b. Dense Irregular Connective Tissue", h2_style))
story.append(Paragraph(
"Dense irregular CT has the same components as loose CT but collagen greatly predominates. "
"Thick bundles of type I collagen are arranged randomly in multiple directions, providing "
"resistance to forces from any direction. Cells are sparse (almost exclusively fibroblasts). "
"Ground substance is minimal.",
body_style))
di_path = img_paths.get("dense_irregular")
ld_path = img_paths.get("loose_dense_histo")
img_row2 = [[]]
cap_row2 = [[]]
if ld_path and os.path.exists(ld_path):
img_row2[0].append(Image(ld_path, width=8*cm, height=5.5*cm))
cap_row2[0].append(Paragraph(
"Mallory-Azan: LCT (loose) above, DCT (dense)\nirregular below. Note sparser nuclei\nand denser collagen in DCT (Ross Histology)",
caption_style))
if di_path and os.path.exists(di_path):
img_row2[0].append(Image(di_path, width=8*cm, height=5.5*cm))
cap_row2[0].append(Paragraph(
"H&E: Dense irregular CT — randomly oriented\nthick collagen bundles, minimal cells\n(Junqueira's 17e)",
caption_style))
if img_row2[0]:
t1 = Table(img_row2, colWidths=[8.5*cm, 8.5*cm])
t1.setStyle(TableStyle([("ALIGN",(0,0),(-1,-1),"CENTER"),("VALIGN",(0,0),(-1,-1),"MIDDLE"),
("LEFTPADDING",(0,0),(-1,-1),0),("RIGHTPADDING",(0,0),(-1,-1),0)]))
t2 = Table(cap_row2, colWidths=[8.5*cm, 8.5*cm])
t2.setStyle(TableStyle([("ALIGN",(0,0),(-1,-1),"CENTER"),("TOPPADDING",(0,0),(-1,-1),2)]))
story += [t1, t2, Spacer(1, 0.3*cm)]
features_di = [
["Feature", "Details"],
["Fibers", "Thick type I collagen bundles, multi-directional; few elastic fibers"],
["Dominant Cell", "Fibroblasts only (sparse)"],
["Ground Substance", "Minimal"],
["Stain on H&E", "Densely pink; few, widely spaced nuclei"],
["Locations", "Dermis, organ capsules (kidney, testis), submucosa, periosteum, perichondrium"],
]
story.append(_mini_table(features_di))
story.append(Spacer(1, 0.5*cm))
# ── 2c Dense Regular CT ──────────────────────────────────────────────────
story.append(Paragraph("2c. Dense Regular Connective Tissue (Tendon)", h2_style))
story.append(Paragraph(
"Dense regular CT has parallel, tightly packed type I collagen bundles with fibroblasts "
"(tenocytes/tendinocytes) aligned in rows between them. It provides maximum tensile strength "
"along the axis of force. The tissue is glistening white macroscopically and largely avascular "
"(slow healing after injury).",
body_style))
ten_path = img_paths.get("tendon_longitudinal")
if ten_path and os.path.exists(ten_path):
story.append(Image(ten_path, width=13*cm, height=5*cm))
story.append(Paragraph(
"H&E ×100: Dense regular CT (tendon, longitudinal section). Homogeneous pink collagen fascicles (TF) with "
"tenocyte nuclei in single-file rows. Outer epitendineum (dense irregular CT) is visible at top.\n(Ross Histology 9e)",
caption_style))
story.append(Spacer(1, 0.3*cm))
features_dr = [
["Feature", "Details"],
["Fibers", "Parallel bundles of type I collagen; minimal elastic fibers"],
["Dominant Cell", "Tenocytes/tendinocytes (fibroblasts) in linear rows between bundles"],
["Ground Substance", "Minimal"],
["Stain on H&E", "Homogeneous pink; elongate nuclei in rows"],
["Vascularity", "Poorly vascularized → slow healing"],
["Locations", "Tendons, ligaments, aponeuroses, corneal stroma"],
]
story.append(_mini_table(features_dr))
story.append(PageBreak())
# ── 2d Reticular CT ──────────────────────────────────────────────────────
story.append(section_header("2. Histology (continued)", bg="#f5f7fa"))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("2d. Reticular Connective Tissue", h2_style))
story.append(Paragraph(
"Reticular CT consists of a delicate, 3-dimensional network of type III collagen fibers "
"(reticulin) produced by specialized fibroblasts called reticular cells. The fibers are "
"heavily glycosylated, making them argyrophilic (stain black with silver salts). They support "
"rapidly changing populations of hematopoietic and immune cells.",
body_style))
ret1 = img_paths.get("reticular_fibers_1")
ret2 = img_paths.get("reticular_fibers_2")
img_row3 = [[]]
cap_row3 = [[]]
if ret1 and os.path.exists(ret1):
img_row3[0].append(Image(ret1, width=7.5*cm, height=6*cm))
cap_row3[0].append(Paragraph("Silver stain: Reticular fibers (black)\nin adrenal cortex ×100\n(Junqueira's 17e)", caption_style))
if ret2 and os.path.exists(ret2):
img_row3[0].append(Image(ret2, width=7.5*cm, height=6*cm))
cap_row3[0].append(Paragraph("Silver stain: Reticular network\nin lymph node ×100\n(Junqueira's 17e)", caption_style))
if img_row3[0]:
t1 = Table(img_row3, colWidths=[8.5*cm, 8.5*cm])
t1.setStyle(TableStyle([("ALIGN",(0,0),(-1,-1),"CENTER"),("VALIGN",(0,0),(-1,-1),"MIDDLE"),
("LEFTPADDING",(0,0),(-1,-1),0),("RIGHTPADDING",(0,0),(-1,-1),0)]))
t2 = Table(cap_row3, colWidths=[8.5*cm, 8.5*cm])
t2.setStyle(TableStyle([("ALIGN",(0,0),(-1,-1),"CENTER"),("TOPPADDING",(0,0),(-1,-1),2)]))
story += [t1, t2, Spacer(1, 0.3*cm)]
features_ret = [
["Feature", "Details"],
["Fiber Type", "Type III collagen (reticulin) — thin, delicate, branching network"],
["Staining", "Argyrophilic (black with silver); PAS-positive; poorly visible on H&E"],
["Dominant Cell", "Reticular cells (specialized fibroblasts)"],
["Function", "Stroma for hematopoietic cells, lymphocytes, and secretory cells"],
["Carbohydrate Content", "~10% (vs 1% in type I collagen) — responsible for argyrophilia"],
["Locations", "Bone marrow, liver (sinusoids), spleen, all lymphoid organs, endocrine glands"],
]
story.append(_mini_table(features_ret))
story.append(Spacer(1, 0.5*cm))
# ── 2e Mesenchyme ─────────────────────────────────────────────────────────
story.append(Paragraph("2e. Embryonic Connective Tissue — Mesenchyme", h2_style))
story.append(Paragraph(
"Mesenchyme is the precursor of all adult connective tissues. It contains "
"undifferentiated, multipotent cells with large euchromatic nuclei and prominent nucleoli, "
"embedded in a sparse matrix rich in hyaluronan with very little collagen.",
body_style))
mes_path = img_paths.get("mesenchyme")
if mes_path and os.path.exists(mes_path):
story.append(Image(mes_path, width=11*cm, height=6*cm))
story.append(Paragraph(
"Mallory trichrome ×200: Embryonic mesenchyme — undifferentiated elongated cells\n"
"with large pale nuclei; sparse matrix with minimal collagen. (Junqueira's 17e)",
caption_style))
story.append(Spacer(1, 0.6*cm))
# ── SECTION 3 – FIBERS ────────────────────────────────────────────────────
story.append(PageBreak())
story.append(section_header("3. Connective Tissue Fibers"))
story.append(Spacer(1, 0.3*cm))
# Fiber comparison table
fiber_data = [
["Property", "Collagen (Type I)", "Reticular (Type III)", "Elastic Fibers"],
["Protein", "Collagen type I", "Collagen type III", "Elastin + fibrillin microfibrils"],
["Diameter", "1–20 μm (bundles)", "0.5–2 μm", "0.2–1 μm"],
["Structure", "Triple helix; parallel cross-linked fibrils", "Thin branching network (reticulum)", "Core of cross-linked elastin + fibrillin sheath"],
["Cross-links", "Lysyl oxidase (hydroxylysine aldehyde)", "Same; plus desmosine-like bonds", "Desmosine rings (from lysine); unique to elastin"],
["H&E stain", "Pink (eosinophilic)", "Poorly visible", "Pale, barely visible"],
["Special stain", "Masson trichrome (blue/green)", "Silver impregnation (black/argyrophilic)", "Orcein / Weigert's elastic stain (dark brown)"],
["PAS stain", "Weakly positive", "Strongly positive (~10% carbohydrate)", "Negative"],
["Tensile strength", "High — resists pulling forces", "Low — delicate support only", "Extensible (up to 150% length) then recoils"],
["Synthesized by", "Fibroblasts (+ osteoblasts, chondrocytes)", "Fibroblasts / reticular cells", "Fibroblasts + smooth muscle cells"],
["Key locations", "Tendons, dermis, bone, cornea", "Bone marrow, liver, lymph nodes", "Large arteries, lung, ligamentum flavum, skin"],
["Vitamin C\ndependence", "Yes — hydroxylation of Pro/Lys in RER", "Yes", "No"],
["Clinical disorders", "Scurvy (↓Vit C), Osteogenesis imperfecta\n(COL1A1/2 mutations), Ehlers-Danlos",
"Liver cirrhosis (↑ reticulin), fibrosis", "Marfan syndrome (FBN1), cutis laxa (elastin)"],
]
fcol = [3.5*cm, 4.3*cm, 4.3*cm, 4.4*cm]
fiber_tbl = Table(
[[Paragraph(f"<b>{c}</b>" if r == 0 else c,
make_style(f"ft{r}{i}", "Normal", fontSize=8, leading=11,
fontName="Helvetica-Bold" if r == 0 else "Helvetica",
textColor=colors.white if r == 0 else colors.black,
alignment=TA_CENTER if r == 0 else TA_LEFT))
for i, c in enumerate(row)]
for r, row in enumerate(fiber_data)],
colWidths=fcol, repeatRows=1
)
fiber_tbl.setStyle(TableStyle([
("BACKGROUND", (0, 0), (-1, 0), colors.HexColor("#2c5f8a")),
("BACKGROUND", (1, 0), (1, 0), colors.HexColor("#8b2c2c")), # col headers color
("BACKGROUND", (0, 1), (0, -1), colors.HexColor("#f0f4fa")), # property column
*[("BACKGROUND", (0, i+1), (-1, i+1),
colors.HexColor("#f7f9fc") if i % 2 == 0 else colors.white)
for i in range(len(fiber_data)-1)],
("GRID", (0, 0), (-1, -1), 0.4, colors.HexColor("#c0cce0")),
("TOPPADDING", (0, 0), (-1, -1), 4),
("BOTTOMPADDING",(0, 0), (-1, -1), 4),
("LEFTPADDING", (0, 0), (-1, -1), 4),
("RIGHTPADDING", (0, 0), (-1, -1), 4),
("VALIGN", (0, 0), (-1, -1), "TOP"),
("FONTNAME", (0, 0), (-1, 0), "Helvetica-Bold"),
("FONTSIZE", (0, 0), (-1, 0), 8.5),
("ALIGN", (0, 0), (-1, 0), "CENTER"),
("TEXTCOLOR", (0, 0), (-1, 0), colors.white),
("FONTNAME", (0, 1), (0, -1), "Helvetica-Bold"),
]))
story.append(fiber_tbl)
story.append(Spacer(1, 0.4*cm))
# Elastic fibers image
el_path = img_paths.get("elastic_fibers")
if el_path and os.path.exists(el_path):
story.append(Image(el_path, width=14*cm, height=5*cm))
story.append(Paragraph(
"Elastic fibers in connective tissue. Left: H&E (fibers barely visible). "
"Center/Right: orcein or aldehyde fuchsin stain highlights elastic fibers as dark threads. "
"(Junqueira's Basic Histology 17e)",
caption_style))
story.append(PageBreak())
# ── SECTION 4 – CELLS TABLE ───────────────────────────────────────────────
story.append(section_header("4. Cells of Connective Tissue"))
story.append(Spacer(1, 0.3*cm))
cell_data = [
["Cell", "Origin", "Morphology", "Key Functions", "Special Features"],
["Fibroblast /\nFibrocyte", "Mesenchyme\n(permanent resident)", "Spindle-shaped; pale euchromatic nucleus; abundant RER (active form)",
"Synthesize ALL ECM: collagen, elastin, GAGs, proteoglycans, glycoproteins",
"Fibrocyte = inactive form; activated in wound healing"],
["Adipocyte\n(White)", "Mesenchyme", "Large; single lipid droplet; peripherally displaced nucleus; 'signet ring'",
"Energy storage; thermal insulation; secretes leptin, adiponectin",
"Cytoplasm and lipid clear on H&E"],
["Adipocyte\n(Brown)", "Mesenchyme", "Smaller; multiple lipid droplets; central nucleus; mitochondria-rich",
"Non-shivering thermogenesis (UCP-1 uncouples oxidative phosphorylation)",
"Abundant in neonates; diminishes with age"],
["Mast Cell", "Bone marrow\nprogenitors", "Ovoid; metachromatic granules (purple/toluidine blue); bilobed nucleus",
"Release histamine, heparin, cytokines, leukotrienes; immediate hypersensitivity; anti-parasite",
"IgE receptors on surface; perivascular and mucosal locations; sentinel cells"],
["Macrophage\n(Histiocyte)", "Bone marrow monocyte", "Irregular; kidney-shaped nucleus; pseudopods; many lysosomes",
"Phagocytosis; antigen presentation (MHC II); secrete cytokines (TNF-α, IL-1, IL-6)",
"Specialized forms: Kupffer (liver), microglia (brain), osteoclasts (bone)"],
["Plasma Cell", "B lymphocyte", "Large ovoid; basophilic (RER-rich); 'clock-face' nucleus; perinuclear halo (Golgi)",
"Secrete immunoglobulins (antibodies)",
"Abundant in GI lamina propria and mucosal sites"],
["Lymphocyte", "Bone marrow", "Small; large dark nucleus; scant cytoplasm",
"Adaptive immunity: T cells (cellular), B cells (humoral), NK cells",
"Normally sparse; increase dramatically at infection sites"],
["Neutrophil", "Bone marrow", "Multilobed nucleus (3–5 lobes); granules contain lysozyme, myeloperoxidase",
"First responder; phagocytosis of bacteria; acute inflammation",
"Short-lived (~days); most abundant WBC"],
["Eosinophil", "Bone marrow", "Bilobed nucleus; large eosinophilic (pink) cytoplasmic granules",
"Defense against parasites; modulate IgE/allergic reactions; phagocytose immune complexes",
"Major basic protein in granules is toxic to parasites"],
]
ccol = [2.5*cm, 2.8*cm, 3.5*cm, 4.2*cm, 4.0*cm]
cell_tbl = Table(
[[Paragraph(f"<b>{c}</b>" if r == 0 else c,
make_style(f"ct{r}{i}", "Normal", fontSize=7.8, leading=11,
fontName="Helvetica-Bold" if r == 0 else "Helvetica",
textColor=colors.white if r == 0 else colors.black))
for i, c in enumerate(row)]
for r, row in enumerate(cell_data)],
colWidths=ccol, repeatRows=1
)
cell_tbl.setStyle(TableStyle([
("BACKGROUND", (0, 0), (-1, 0), colors.HexColor("#1a3d6b")),
("TEXTCOLOR", (0, 0), (-1, 0), colors.white),
("FONTNAME", (0, 0), (-1, 0), "Helvetica-Bold"),
("ALIGN", (0, 0), (-1, 0), "CENTER"),
*[("BACKGROUND", (0, i+1), (-1, i+1),
colors.HexColor("#f0f4fa") if i % 2 == 0 else colors.white)
for i in range(len(cell_data)-1)],
("GRID", (0, 0), (-1, -1), 0.4, colors.HexColor("#c0cce0")),
("TOPPADDING", (0, 0), (-1, -1), 4),
("BOTTOMPADDING",(0, 0), (-1, -1), 4),
("LEFTPADDING", (0, 0), (-1, -1), 4),
("RIGHTPADDING", (0, 0), (-1, -1), 4),
("VALIGN", (0, 0), (-1, -1), "TOP"),
("FONTNAME", (0, 1), (0, -1), "Helvetica-Bold"),
]))
story.append(cell_tbl)
story.append(PageBreak())
# ── SECTION 5 – ECM / GROUND SUBSTANCE ───────────────────────────────────
story.append(section_header("5. Extracellular Matrix (ECM)"))
story.append(Spacer(1, 0.3*cm))
# ECM overview image
ecm_path = img_paths.get("ecm_overview")
if ecm_path and os.path.exists(ecm_path):
story.append(Image(ecm_path, width=13*cm, height=7*cm))
story.append(Paragraph(
"ECM structure: Basal lamina beneath the epithelial cell layer, with collagen fibers, "
"elastic fibers, and proteoglycans forming the interstitial matrix. (Basic Medical Biochemistry 6e)",
caption_style))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("5a. Glycosaminoglycans (GAGs)", h3_style))
story.append(Paragraph(
"Long, unbranched polysaccharide chains of repeating disaccharide units (hexosamine + uronic acid). "
"Highly negatively charged (sulfated except hyaluronan) → attract water → gel-like ground substance. "
"Degraded by lysosomal enzymes; deficiency causes <b>mucopolysaccharidoses</b> (e.g., Hurler, Hunter syndromes).",
body_style))
gag_data = [
["GAG", "Sulfated?", "Key Features", "Major Locations"],
["Hyaluronan", "No", "Largest GAG; not covalently linked to protein; extremely hydrophilic; backbone of proteoglycan aggregates",
"Ubiquitous: synovial fluid, vitreous, umbilical cord, embryonic tissues"],
["Chondroitin sulfate", "Yes", "Most abundant GAG in body; linked to core proteins (aggrecan)",
"Cartilage, bone, tendon, skin, cornea"],
["Dermatan sulfate", "Yes", "Associated with type I collagen; modulates fibrillogenesis",
"Skin, blood vessel walls, heart valves, tendons"],
["Heparan sulfate", "Yes", "Component of basal laminae; cell surface proteoglycans (syndecan)",
"Basement membranes, cell surfaces"],
["Heparin", "Highly\nsulfated", "Stored in mast cell granules; anticoagulant",
"Mast cells; used clinically as anticoagulant"],
["Keratan sulfate", "Yes", "Lacks uronic acid; linked to protein via Asn or Ser",
"Cornea (type I), cartilage (type II), nucleus pulposus"],
]
gcol = [3*cm, 2*cm, 6.5*cm, 5.5*cm]
gag_tbl = Table(
[[Paragraph(f"<b>{c}</b>" if r == 0 else c,
make_style(f"gg{r}{i}", "Normal", fontSize=8, leading=11,
fontName="Helvetica-Bold" if r == 0 else "Helvetica",
textColor=colors.white if r == 0 else colors.black))
for i, c in enumerate(row)]
for r, row in enumerate(gag_data)],
colWidths=gcol, repeatRows=1
)
gag_tbl.setStyle(TableStyle([
("BACKGROUND", (0, 0), (-1, 0), colors.HexColor("#2c5f8a")),
("TEXTCOLOR", (0, 0), (-1, 0), colors.white),
("FONTNAME", (0, 0), (-1, 0), "Helvetica-Bold"),
*[("BACKGROUND", (0, i+1), (-1, i+1),
colors.HexColor("#f0f4fa") if i % 2 == 0 else colors.white)
for i in range(len(gag_data)-1)],
("GRID", (0, 0), (-1, -1), 0.4, colors.HexColor("#c0cce0")),
("TOPPADDING", (0, 0), (-1, -1), 3),
("BOTTOMPADDING",(0, 0), (-1, -1), 3),
("LEFTPADDING", (0, 0), (-1, -1), 4),
("RIGHTPADDING", (0, 0), (-1, -1), 4),
("VALIGN", (0, 0), (-1, -1), "TOP"),
("FONTNAME", (0, 1), (0, -1), "Helvetica-Bold"),
]))
story.append(gag_tbl)
story.append(Spacer(1, 0.4*cm))
story.append(Paragraph("5b. Multiadhesive Glycoproteins", h3_style))
glyco_data = [
["Glycoprotein", "Binds To", "Function"],
["Fibronectin", "Collagen, heparan sulfate, integrins, fibrin",
"Cell adhesion & migration; wound healing; matrix assembly; fibroblast movement"],
["Laminin", "Type IV collagen, nidogen, perlecan, integrins",
"Major component of basal laminae; cell attachment, differentiation, polarization"],
["Nidogen (Entactin)", "Laminin + type IV collagen",
"Bridges laminin and type IV collagen in basal lamina"],
["Tenascin", "Fibronectin, proteoglycans",
"Anti-adhesive; modulates cell-matrix interactions; wound healing and tumor stroma"],
]
gcol2 = [3.5*cm, 5.5*cm, 8*cm]
glyco_tbl = _data_table(glyco_data, gcol2)
story.append(glyco_tbl)
story.append(Spacer(1, 0.4*cm))
story.append(Paragraph("5c. Integrins and MMPs", h3_style))
story.append(Paragraph(
"<b>Integrins</b>: Transmembrane heterodimeric receptors (α+β subunits) that bind ECM components "
"(fibronectin, laminin, collagen) extracellularly and link to the actin cytoskeleton intracellularly "
"(via talin, vinculin). They transduce bi-directional signals between the ECM and cell interior, "
"regulating migration, differentiation, proliferation, and survival.",
body_style))
story.append(Paragraph(
"<b>MMPs (Matrix Metalloproteinases)</b>: Zinc-dependent endopeptidases that degrade ECM components. "
"Regulated by <b>TIMPs</b> (tissue inhibitors of MMPs). Dysregulation promotes cancer invasion, "
"metastasis, atherosclerotic plaque rupture, and fibrosis.",
body_style))
story.append(PageBreak())
# ── SECTION 6 – QUICK REFERENCE ──────────────────────────────────────────
story.append(section_header("6. Quick Reference – Locations & Special Stains"))
story.append(Spacer(1, 0.3*cm))
loc_data = [
["Location / Organ", "Primary CT Type", "Predominant Fiber", "Key Cells"],
["GI tract lamina propria", "Loose (areolar)", "Collagen I + reticular", "Plasma cells, lymphocytes, macrophages, mast cells"],
["Skin dermis (upper)", "Loose → Dense irregular", "Collagen I (+ elastic)", "Fibroblasts, macrophages, mast cells"],
["Skin dermis (deep)", "Dense irregular", "Collagen I (thick bundles)", "Fibroblasts"],
["Tendons", "Dense regular", "Collagen I (parallel)", "Tenocytes"],
["Ligaments", "Dense regular", "Collagen I (parallel, + elastic in ligamentum flavum)", "Fibroblasts"],
["Bone marrow stroma", "Reticular", "Collagen III (reticulin)", "Reticular cells, hematopoietic cells"],
["Liver sinusoids (space of Disse)", "Reticular", "Collagen III (reticulin)", "Reticular cells, Kupffer cells"],
["Lymph nodes / Spleen", "Reticular", "Collagen III", "Reticular cells, lymphocytes, macrophages"],
["Large artery wall (tunica media)", "Elastic (smooth muscle + elastic lamellae)", "Elastin lamellae + collagen I", "Smooth muscle cells"],
["Organ capsules (kidney, testis)", "Dense irregular", "Collagen I", "Fibroblasts"],
["Articular cartilage", "Hyaline cartilage", "Collagen II", "Chondrocytes"],
["Intervertebral disc (annulus)", "Fibrocartilage", "Collagen I (predominant)", "Fibrocartilage chondrocytes"],
["Cornea", "Dense regular (orthogonal layers)", "Collagen I (+ V)", "Keratocytes (fibroblasts)"],
["Umbilical cord", "Mucoid (Wharton's jelly)", "Sparse collagen + hyaluronan", "Fibroblasts"],
["Subcutaneous tissue", "Loose + White adipose", "Collagen I + reticular", "Adipocytes, fibroblasts"],
["Lung alveolar walls", "Loose", "Elastic + reticular + collagen III", "Fibroblasts, macrophages"],
["Mesentery", "Loose", "Collagen I, elastic, reticular", "All CT cell types"],
]
lcol = [4.5*cm, 3.5*cm, 3.8*cm, 5.2*cm]
loc_tbl = Table(
[[Paragraph(f"<b>{c}</b>" if r == 0 else c,
make_style(f"lc{r}{i}", "Normal", fontSize=8, leading=11,
fontName="Helvetica-Bold" if r == 0 else "Helvetica",
textColor=colors.white if r == 0 else colors.black))
for i, c in enumerate(row)]
for r, row in enumerate(loc_data)],
colWidths=lcol, repeatRows=1
)
loc_tbl.setStyle(TableStyle([
("BACKGROUND", (0, 0), (-1, 0), colors.HexColor("#1a3d6b")),
("TEXTCOLOR", (0, 0), (-1, 0), colors.white),
("FONTNAME", (0, 0), (-1, 0), "Helvetica-Bold"),
*[("BACKGROUND", (0, i+1), (-1, i+1),
colors.HexColor("#f0f4fa") if i % 2 == 0 else colors.white)
for i in range(len(loc_data)-1)],
("GRID", (0, 0), (-1, -1), 0.4, colors.HexColor("#c0cce0")),
("TOPPADDING", (0, 0), (-1, -1), 3),
("BOTTOMPADDING",(0, 0), (-1, -1), 3),
("LEFTPADDING", (0, 0), (-1, -1), 4),
("RIGHTPADDING", (0, 0), (-1, -1), 4),
("VALIGN", (0, 0), (-1, -1), "TOP"),
("FONTNAME", (0, 1), (0, -1), "Helvetica-Bold"),
("FONTSIZE", (0, 1), (0, -1), 8),
]))
story.append(loc_tbl)
story.append(Spacer(1, 0.4*cm))
# Special stains table
story.append(Paragraph("Histological Staining Reference", h3_style))
stain_data = [
["Stain", "What It Colors", "CT Component Highlighted"],
["H&E (Hematoxylin & Eosin)", "Nuclei: blue/purple; cytoplasm/collagen: pink", "General morphology; collagen appears eosinophilic"],
["Masson's Trichrome", "Collagen: blue or green; muscle: red; nuclei: dark", "Collagen fibers (all types visible)"],
["Gomori / Reticulin (silver)", "Reticular fibers: black; other tissue: pale", "Type III collagen (reticulin) specifically"],
["Orcein / Aldehyde Fuchsin", "Elastic fibers: dark brown/black", "Elastic fibers and lamellae"],
["Weigert's Elastic Stain", "Elastic fibers: blue-black", "Elastic fibers"],
["PAS (Periodic acid-Schiff)", "Polysaccharides, glycoproteins: magenta", "Basement membranes; reticular fibers (high CHO content)"],
["Toluidine Blue", "GAGs: metachromatic (purple/red)", "Mast cell granules; cartilage matrix; heparin"],
["Alcian Blue", "Acid GAGs: blue", "Cartilage proteoglycans; mucins"],
["Sudan IV / Oil Red O", "Neutral lipids: red", "Adipocytes; lipid droplets"],
["Von Kossa", "Calcium phosphate: black/brown", "Calcified bone; cartilage ossification"],
]
scol = [4.5*cm, 5.5*cm, 7*cm]
story.append(_data_table(stain_data, scol))
story.append(Spacer(1, 0.4*cm))
# ── FOOTER / REFERENCES ───────────────────────────────────────────────────
story.append(HRFlowable(width=W, thickness=1, color=colors.HexColor("#1a3d6b")))
story.append(Spacer(1, 0.2*cm))
ref_style = make_style("Ref","Normal", fontSize=8, leading=13,
textColor=colors.HexColor("#333333"))
story.append(Paragraph("<b>References</b>", ref_style))
story.append(Paragraph(
"1. Mescher AL. <i>Junqueira's Basic Histology: Text and Atlas</i>, 17th ed. McGraw Hill, 2024. (ISBN 9781264930395)\n"
"2. Ross MH, Pawlina W. <i>Histology: A Text and Atlas with Correlated Cell and Molecular Biology</i>, 9th ed. Wolters Kluwer, 2021. (ISBN 9781975181512)\n"
"3. Lieberman M, Peet A. <i>Basic Medical Biochemistry: A Clinical Approach</i>, 6th ed. LWW, 2022. (ISBN 9781975150143)",
make_style("refs2","Normal",fontSize=8,leading=13,textColor=colors.HexColor("#444444"))))
doc.build(story)
print(f"\n✅ PDF created: {OUTPUT}")
# ── Helper tables ──────────────────────────────────────────────────────────────
def _mini_table(data):
col_w = [4.5*cm, 12.5*cm]
rows = []
for i, row in enumerate(data):
bg = colors.HexColor("#1a3d6b") if i == 0 else (
colors.HexColor("#f0f4fa") if i % 2 == 1 else colors.white)
fc = colors.white if i == 0 else colors.black
fn = "Helvetica-Bold" if i == 0 else "Helvetica"
rows.append([
Paragraph(row[0], make_style(f"mt{i}a","Normal",fontSize=8.5,
fontName="Helvetica-Bold", textColor=fc)),
Paragraph(row[1], make_style(f"mt{i}b","Normal",fontSize=8.5,
textColor=fc, fontName=fn)),
])
t = Table(rows, colWidths=col_w)
t.setStyle(TableStyle([
("BACKGROUND", (0, 0), (-1, 0), colors.HexColor("#1a3d6b")),
*[("BACKGROUND", (0, i+1), (-1, i+1),
colors.HexColor("#f0f4fa") if i % 2 == 0 else colors.white)
for i in range(len(data)-1)],
("GRID", (0, 0), (-1, -1), 0.3, colors.HexColor("#c0cce0")),
("TOPPADDING", (0, 0), (-1, -1), 3),
("BOTTOMPADDING",(0, 0), (-1, -1), 3),
("LEFTPADDING", (0, 0), (-1, -1), 5),
("RIGHTPADDING", (0, 0), (-1, -1), 5),
("VALIGN", (0, 0), (-1, -1), "MIDDLE"),
]))
return t
def _data_table(data, col_widths):
rows = []
for i, row in enumerate(data):
rows.append([
Paragraph(f"<b>{c}</b>" if i == 0 else c,
make_style(f"dt{i}{j}","Normal", fontSize=8, leading=11,
fontName="Helvetica-Bold" if i == 0 else "Helvetica",
textColor=colors.white if i == 0 else colors.black))
for j, c in enumerate(row)
])
t = Table(rows, colWidths=col_widths, repeatRows=1)
t.setStyle(TableStyle([
("BACKGROUND", (0, 0), (-1, 0), colors.HexColor("#2c5f8a")),
("TEXTCOLOR", (0, 0), (-1, 0), colors.white),
*[("BACKGROUND", (0, i+1), (-1, i+1),
colors.HexColor("#f0f4fa") if i % 2 == 0 else colors.white)
for i in range(len(data)-1)],
("GRID", (0, 0), (-1, -1), 0.4, colors.HexColor("#c0cce0")),
("TOPPADDING", (0, 0), (-1, -1), 3),
("BOTTOMPADDING",(0, 0), (-1, -1), 3),
("LEFTPADDING", (0, 0), (-1, -1), 4),
("RIGHTPADDING", (0, 0), (-1, -1), 4),
("VALIGN", (0, 0), (-1, -1), "TOP"),
("FONTNAME", (0, 1), (0, -1), "Helvetica-Bold"),
]))
return t
if __name__ == "__main__":
build()
cd /home/daytona/workspace/connective-tissue-pdf && python3 build_pdf.py 2>&1
~/connective-tissue-pdf/build_pdf.py
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/connective-tissue-pdf/build_pdf.py'
~/connective-tissue-pdf/build_pdf.py
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/connective-tissue-pdf/build_pdf.py'
~/connective-tissue-pdf/build_pdf.py
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/connective-tissue-pdf/build_pdf.py'
~/connective-tissue-pdf/build_pdf.py
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/connective-tissue-pdf/build_pdf.py'
~/connective-tissue-pdf/build_pdf.py
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/connective-tissue-pdf/build_pdf.py'
~/connective-tissue-pdf/build_pdf.py
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/connective-tissue-pdf/build_pdf.py'
~/connective-tissue-pdf/build_pdf.py
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/connective-tissue-pdf/build_pdf.py'
~/connective-tissue-pdf/build_pdf.py
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/connective-tissue-pdf/build_pdf.py'
cd /home/daytona/workspace/connective-tissue-pdf && python3 build_pdf.py 2>&1 && echo "SUCCESS" && ls -lh Connective_Tissue_Summary.pdf