Explain counter current mechanism
| Segment | Water Permeability | NaCl Active Transport | Urea Permeability |
|---|---|---|---|
| Thin descending limb | High (aquaporin-1) | None | Moderate |
| Thin ascending limb | None | None (passive NaCl efflux) | Moderate |
| Thick ascending limb (TAL) | None | High (NKCC2 cotransporter) | None |


| Component | Structure | Function | Mechanism |
|---|---|---|---|
| Counter-current multiplier | Loop of Henle (TAL mainly) | Creates medullary hyperosmolarity | Active NaCl pump in water-impermeable TAL |
| Urea recycling | Inner medullary CD + thin descending limb | Amplifies medullary osmolarity | Urea diffusion via UT-A transporters |
| Counter-current exchanger | Vasa recta | Preserves medullary gradient | Passive exchange of NaCl, urea, and water |
| Final concentrator | Collecting duct | Concentrates urine | Water reabsorption driven by ADH |
Make it a pdf
ls -la /tmp/workspace/ 2>/dev/null || mkdir -p /tmp/workspace && echo "created"
mkdir -p /tmp/workspace/counter-current-pdf && python3 << 'EOF' import urllib.request import os # Download the two images img1_url = "https://cdn.orris.care/cdss_images/13f4bd852130a9ca71206809ea4e183392f159010c47e8dfa4ca25283fcf36e1.png" img2_url = "https://cdn.orris.care/cdss_images/d45fba3c2264dfc8815191a67afa3ba2e3509b0bb3942bc63faff5b301c3c2a1.png" urllib.request.urlretrieve(img1_url, "/tmp/workspace/counter-current-pdf/fig1_multiplier.png") urllib.request.urlretrieve(img2_url, "/tmp/workspace/counter-current-pdf/fig2_exchanger.png") print("Images downloaded:", os.path.exists("/tmp/workspace/counter-current-pdf/fig1_multiplier.png"), os.path.exists("/tmp/workspace/counter-current-pdf/fig2_exchanger.png")) EOF
~/counter-current-pdf/build_pdf.py
from reportlab.lib.pagesizes import A4
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import cm, mm
from reportlab.lib import colors
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
Image, HRFlowable, KeepTogether
)
from reportlab.lib.enums import TA_LEFT, TA_CENTER, TA_JUSTIFY
from reportlab.pdfbase import pdfmetrics
OUTPUT = "/tmp/workspace/counter-current-pdf/Counter_Current_Mechanism.pdf"
doc = SimpleDocTemplate(
OUTPUT,
pagesize=A4,
leftMargin=2*cm, rightMargin=2*cm,
topMargin=2.2*cm, bottomMargin=2.2*cm,
title="Counter-Current Mechanism",
author="Orris Medical"
)
W, H = A4
CONTENT_W = W - 4*cm
styles = getSampleStyleSheet()
# Custom styles
title_style = ParagraphStyle(
"MyTitle",
parent=styles["Title"],
fontSize=22,
leading=28,
textColor=colors.HexColor("#1a3a5c"),
spaceAfter=4,
)
subtitle_style = ParagraphStyle(
"Subtitle",
parent=styles["Normal"],
fontSize=11,
textColor=colors.HexColor("#5a7a9a"),
spaceAfter=14,
alignment=TA_CENTER,
)
h1_style = ParagraphStyle(
"H1",
parent=styles["Heading1"],
fontSize=14,
leading=18,
textColor=colors.white,
backColor=colors.HexColor("#1a3a5c"),
spaceBefore=14,
spaceAfter=6,
leftIndent=-6,
rightIndent=-6,
borderPad=6,
)
h2_style = ParagraphStyle(
"H2",
parent=styles["Heading2"],
fontSize=12,
leading=15,
textColor=colors.HexColor("#1a3a5c"),
spaceBefore=10,
spaceAfter=4,
borderWidth=0,
borderPadding=0,
)
h3_style = ParagraphStyle(
"H3",
parent=styles["Heading3"],
fontSize=10.5,
leading=13,
textColor=colors.HexColor("#2e6da4"),
spaceBefore=8,
spaceAfter=3,
fontName="Helvetica-BoldOblique",
)
body_style = ParagraphStyle(
"Body",
parent=styles["Normal"],
fontSize=10,
leading=15,
spaceAfter=6,
alignment=TA_JUSTIFY,
)
bullet_style = ParagraphStyle(
"Bullet",
parent=styles["Normal"],
fontSize=10,
leading=14,
leftIndent=16,
spaceBefore=1,
spaceAfter=2,
bulletIndent=4,
)
caption_style = ParagraphStyle(
"Caption",
parent=styles["Normal"],
fontSize=8.5,
leading=11,
textColor=colors.HexColor("#555555"),
alignment=TA_CENTER,
spaceAfter=8,
fontName="Helvetica-Oblique",
)
source_style = ParagraphStyle(
"Source",
parent=styles["Normal"],
fontSize=8,
leading=11,
textColor=colors.HexColor("#777777"),
spaceBefore=16,
spaceAfter=2,
fontName="Helvetica-Oblique",
)
def h1(text):
return Paragraph(f" {text}", h1_style)
def h2(text):
return Paragraph(text, h2_style)
def h3(text):
return Paragraph(text, h3_style)
def p(text):
return Paragraph(text, body_style)
def b(text):
return Paragraph(f"• {text}", bullet_style)
def sp(n=6):
return Spacer(1, n)
def hr():
return HRFlowable(width="100%", thickness=0.5, color=colors.HexColor("#ccddee"), spaceAfter=4, spaceBefore=4)
# ------- TABLE HELPER -------
def make_table(header, rows, col_widths=None):
data = [header] + rows
if col_widths is None:
n = len(header)
col_widths = [CONTENT_W / n] * n
ts = TableStyle([
# Header
("BACKGROUND", (0, 0), (-1, 0), colors.HexColor("#1a3a5c")),
("TEXTCOLOR", (0, 0), (-1, 0), colors.white),
("FONTNAME", (0, 0), (-1, 0), "Helvetica-Bold"),
("FONTSIZE", (0, 0), (-1, 0), 9),
("ALIGN", (0, 0), (-1, 0), "CENTER"),
("BOTTOMPADDING", (0, 0), (-1, 0), 6),
("TOPPADDING", (0, 0), (-1, 0), 6),
# Body
("FONTNAME", (0, 1), (-1, -1), "Helvetica"),
("FONTSIZE", (0, 1), (-1, -1), 9),
("ALIGN", (0, 1), (-1, -1), "LEFT"),
("VALIGN", (0, 0), (-1, -1), "MIDDLE"),
("TOPPADDING", (0, 1), (-1, -1), 4),
("BOTTOMPADDING", (0, 1), (-1, -1), 4),
("LEFTPADDING", (0, 0), (-1, -1), 6),
("RIGHTPADDING", (0, 0), (-1, -1), 6),
# Alternating rows
*[("BACKGROUND", (0, i), (-1, i), colors.HexColor("#eef4fb")) for i in range(2, len(data), 2)],
("ROWBACKGROUNDS", (0, 1), (-1, -1), [colors.white, colors.HexColor("#eef4fb")]),
# Grid
("GRID", (0, 0), (-1, -1), 0.5, colors.HexColor("#aaccee")),
("LINEBELOW", (0, 0), (-1, 0), 1.5, colors.HexColor("#1a3a5c")),
])
# Convert strings to Paragraphs for wrapping
cell_style = ParagraphStyle("tc", parent=styles["Normal"], fontSize=9, leading=12)
hdr_style = ParagraphStyle("th", parent=styles["Normal"], fontSize=9, leading=12,
fontName="Helvetica-Bold", textColor=colors.white, alignment=TA_CENTER)
pdata = []
for ri, row in enumerate(data):
prow = []
for ci, cell in enumerate(row):
st = hdr_style if ri == 0 else cell_style
prow.append(Paragraph(str(cell), st))
pdata.append(prow)
t = Table(pdata, colWidths=col_widths)
t.setStyle(ts)
return t
# ============================================================
# BUILD CONTENT
# ============================================================
story = []
# Title block
story.append(sp(4))
story.append(Paragraph("Counter-Current Mechanism", title_style))
story.append(Paragraph("Renal Physiology — Urine Concentration", subtitle_style))
story.append(HRFlowable(width="100%", thickness=2, color=colors.HexColor("#1a3a5c"), spaceAfter=10))
# Intro
story.append(p(
"The counter-current mechanism is the process by which the kidney creates a highly concentrated "
"medullary interstitium, enabling formation of concentrated (hypertonic) urine. It has two main components: "
"the <b>counter-current multiplier</b> (loop of Henle) and the <b>counter-current exchanger</b> (vasa recta)."
))
# ---- SECTION 1 ----
story.append(h1("1. What Is a Counter-Current System?"))
story.append(p(
"A counter-current system is one in which inflow runs <b>parallel to, in close proximity to, and in the "
"opposite direction of</b> outflow over some distance. Both the loop of Henle and the vasa recta function "
"this way in the renal medulla."
))
story.append(p(
"The goal is to maintain an <b>osmotic gradient</b> that increases progressively from the cortex "
"(~300 mOsm/kg) down to the tip of the medullary papilla (~1200-1400 mOsm/kg). This gradient is "
"<i>produced</i> by the loop of Henle and <i>maintained</i> by the vasa recta."
))
# ---- SECTION 2 ----
story.append(h1("2. Counter-Current Multiplier (Loop of Henle)"))
story.append(p(
"The loop of Henle acts as a <b>multiplier</b> because a small osmotic gradient at any single level is "
"amplified into a large gradient along the entire length of the loop by the continuous flow of tubular fluid."
))
story.append(h2("Key Structural Properties"))
story.append(make_table(
["Segment", "Water Permeability", "NaCl Active Transport", "Urea Permeability"],
[
["Thin descending limb", "High (aquaporin-1)", "None", "Moderate"],
["Thin ascending limb", "None", "None (passive NaCl efflux)", "Moderate"],
["Thick ascending limb (TAL)", "None", "High (NKCC2 cotransporter)", "None"],
],
col_widths=[5.2*cm, 4.2*cm, 5.2*cm, 3.4*cm]
))
story.append(sp(6))
story.append(p(
"The <b>thick ascending limb (TAL)</b> is the engine of the entire system. It actively pumps Na<super>+</super>, "
"K<super>+</super>, and Cl<super>-</super> out into the interstitium via the NKCC2 cotransporter, but is "
"<b>completely impermeable to water</b>. This is the key distinction: it adds solute <i>without</i> losing "
"water, thereby building up hyperosmolarity in the medullary interstitium."
))
story.append(h2("Step-by-Step Process"))
story.append(p(
"Starting from a uniform 300 mOsm/kg throughout the loop and interstitium:"
))
steps = [
("<b>Step A:</b>", "Everything starts at 300 mOsm/kg throughout."),
("<b>Step B:</b>", "The TAL pumps NaCl out, raising interstitial osmolality to 400 mOsm/kg. The thin "
"descending limb equilibrates (water leaves) and also reaches 400. The TAL fluid drops to 200 (lost "
"salt, kept water)."),
("<b>Step C:</b>", "New isotonic fluid (300 mOsm/kg) enters the top of the descending limb from the "
"proximal tubule, pushing concentrated fluid downward toward the tip."),
("<b>Step D:</b>", "Pumping resumes. The cycle repeats. The descending limb progressively concentrates "
"as fluid moves down; the ascending limb progressively dilutes as it pumps NaCl out."),
("<b>Final result:</b>", "An axial gradient from ~300 mOsm/kg at the cortex to ~1200 mOsm/kg at the "
"papillary tip. Juxtamedullary nephrons with longer loops reach higher osmolalities."),
]
for label, text in steps:
story.append(Paragraph(f" {label} {text}", body_style))
# Figure 1
story.append(sp(8))
fig1_path = "/tmp/workspace/counter-current-pdf/fig1_multiplier.png"
img1 = Image(fig1_path, width=CONTENT_W, height=CONTENT_W * 0.52)
story.append(KeepTogether([
img1,
Paragraph(
"FIGURE 1 — Operation of the loop of Henle as a counter-current multiplier (steps A-H). "
"TDL = thin descending limb; MI = medullary interstitium; TAL = thick ascending limb. "
"Numbers represent osmolality in mOsm/kg H\u2082O.",
caption_style
)
]))
# ---- SECTION 3 ----
story.append(h1("3. Role of Urea"))
story.append(p(
"Urea contributes approximately 400-500 mOsm/kg to the medullary interstitial concentration and is "
"essential for maximum urinary concentration:"
))
story.append(b("The inner medullary collecting duct is permeable to urea (via <b>UT-A1/UT-A3</b> transporters), "
"especially when <b>ADH (vasopressin)</b> is present."))
story.append(b("Urea diffuses out of the collecting duct into the interstitium."))
story.append(b("It enters the thin descending limb and recycles through the loop — a process called "
"<b>urea recycling</b> or counter-current amplification of urea."))
story.append(b("High protein diet → more urea → better concentrating ability."))
story.append(b("Low protein diet / malnutrition → reduced urea → impaired concentrating ability."))
story.append(sp(4))
story.append(p(
"Urea transport in the collecting duct is mediated by UT-A1 and UT-A3; both are regulated by vasopressin. "
"During antidiuresis (high vasopressin), the amount of urea deposited in the medullary interstitium "
"increases, thus increasing the concentrating capacity of the kidney."
))
# ---- SECTION 4 ----
story.append(h1("4. Counter-Current Exchanger (Vasa Recta)"))
story.append(p(
"The vasa recta are specialised peritubular capillaries that loop down into the medulla in parallel "
"with the loop of Henle. They act as a <b>passive counter-current exchanger</b> that preserves the "
"medullary osmotic gradient rather than washing it away."
))
story.append(h2("Mechanism"))
story.append(b("As blood <b>descends</b> into the medulla: NaCl and urea diffuse <b>into</b> the vessel "
"from the concentrated interstitium; water diffuses <b>out</b>. Blood becomes progressively more concentrated."))
story.append(b("As blood <b>ascends</b> out of the medulla: the reverse occurs — NaCl and urea diffuse "
"<b>out</b> back into the interstitium; water re-enters the vessel."))
story.append(b("Net effect: the vasa recta remove only the water reabsorbed from tubules, carrying "
"away excess water without dissipating the osmotic gradient."))
story.append(sp(4))
story.append(p(
"The blood returning to the cortex (osmolality ~325 mOsm/kg vs. incoming ~300 mOsm/kg) confirms "
"a small net amount of water is removed while the gradient is maintained."
))
# Figure 2
story.append(sp(8))
fig2_path = "/tmp/workspace/counter-current-pdf/fig2_exchanger.png"
img2 = Image(fig2_path, width=CONTENT_W * 0.55, height=CONTENT_W * 0.72)
img2.hAlign = "CENTER"
story.append(KeepTogether([
img2,
Paragraph(
"FIGURE 2 — Operation of the vasa recta as counter-current exchangers. NaCl and urea diffuse "
"out of the ascending limb of the vessel and into the descending limb, whereas H\u2082O diffuses "
"out of the descending limb into the ascending limb. Numbers = osmolality (mOsm/kg).",
caption_style
)
]))
# ---- SECTION 5 ----
story.append(h1("5. Collecting Duct — Final Concentration Step"))
story.append(p(
"Once the medullary interstitium is hyperosmotic, the collecting duct traverses it from cortex to papilla. "
"In the presence of <b>ADH</b>:"
))
story.append(b("The collecting duct epithelium inserts aquaporin-2 (AQP2) channels in response to ADH."))
story.append(b("Water moves out by osmosis into the hyperosmotic interstitium."))
story.append(b("Urine becomes progressively more concentrated, reaching up to <b>1200 mOsm/kg</b>."))
story.append(b("Without ADH: the collecting duct remains impermeable to water and dilute urine is excreted."))
# ---- SECTION 6 — Summary Table ----
story.append(h1("6. Summary"))
story.append(make_table(
["Component", "Structure", "Function", "Mechanism"],
[
["Counter-current multiplier", "Loop of Henle (TAL)", "Creates medullary hyperosmolarity",
"Active NaCl pump in water-impermeable TAL"],
["Urea recycling", "Inner medullary CD + thin descending limb", "Amplifies medullary osmolarity",
"Urea diffusion via UT-A transporters"],
["Counter-current exchanger", "Vasa recta", "Preserves medullary gradient",
"Passive exchange of NaCl, urea, and water"],
["Final concentrator", "Collecting duct", "Concentrates urine",
"Water reabsorption driven by ADH / AQP2"],
],
col_widths=[4.2*cm, 4.4*cm, 4.4*cm, 4.6*cm]
))
# ---- SECTION 7 — Clinical ----
story.append(h1("7. Clinical Relevance"))
story.append(make_table(
["Condition / Drug", "Mechanism Affected", "Clinical Effect"],
[
["Loop diuretics (furosemide)", "Blocks NKCC2 cotransporter in TAL",
"Abolishes medullary gradient → dilute urine regardless of ADH"],
["Central diabetes insipidus", "No ADH secretion",
"Collecting duct impermeable → dilute polyuria (intact gradient)"],
["Nephrogenic DI", "ADH resistance (AQP2/V2R defect)",
"Same dilute polyuria despite normal/high ADH"],
["Low protein diet / malnutrition", "Reduced urea delivery",
"Impaired medullary osmolarity → reduced concentrating ability"],
["Short loops of Henle (renal disease)", "Less gradient buildup over length",
"Impaired urinary concentration"],
],
col_widths=[5.0*cm, 6.0*cm, 6.6*cm]
))
# Sources
story.append(hr())
story.append(Paragraph(
"Sources: Ganong's Review of Medical Physiology, 26th Ed., pp. 687-688 | "
"Guyton and Hall Textbook of Medical Physiology, pp. 373-375",
source_style
))
# ============================================================
doc.build(story)
print("PDF built successfully:", OUTPUT)
EOFpython3 /tmp/workspace/counter-current-pdf/build_pdf.py
ls -lh /tmp/workspace/counter-current-pdf/Counter_Current_Mechanism.pdf
Counter Current Mechanism
PDF Document · PDF