Explain the Hormones of the Anterior Pituitary with Their Actions and Regulation can u give me a detailed answer for 10 marks with all important points ans statement mentioning them highlighting and also giving me flowcharts to score mark
"The anterior pituitary is the MASTER GLAND of the endocrine system." (Harrison's Principles of Internal Medicine, 22E)


| Cell Type | Hormone(s) | % of Anterior Pituitary |
|---|---|---|
| Corticotrope | ACTH (+ β-LPH) | ~20% |
| Somatotrope | GH | ~50% |
| Lactotrope | Prolactin (PRL) | ~15-20% |
| Thyrotrope | TSH | ~5% |
| Gonadotrope | FSH + LH | ~10% |
HYPOTHALAMUS
│
┌────────────────┼────────────────┐
│ │ │
CRH TRH GnRH GHRH/GIH PIH/PRH
│ │ │ │ │
▼ ▼ ▼ ▼ ▼
ACTH + β-LPH TSH LH + FSH GH Prolactin
│ │ │ │ │ │
▼ ▼ ▼ ▼ ▼ ▼
Adrenal Cortex Thyroid Testes Ovaries Liver/Bone Breast
│ │ │ │ (IGF-1)
Cortisol T3, T4 Testosterone Estrogen/
Aldosterone Spermatogene Progesterone
Sex hormones sis Ovulation
Key Statement: "GH has both insulin-like (anabolic) and anti-insulin (diabetogenic) effects."
STIMULATORS of GH Release INHIBITORS of GH Release
───────────────────────── ────────────────────────
GHRH (hypothalamus) Somatostatin (GIH)
Ghrelin (stomach) IGF-1 (negative feedback)
Hypoglycemia Hyperglycemia
Sleep (stages 3-4 NREM) Obesity / Free fatty acids
Exercise / Stress GH itself (ultrashort loop)
Amino acids (arginine) Glucocorticoids (chronic)
Estrogen, testosterone Hypothyroidism
⭐ Key Statement: "GH secretion shows marked diurnal variation, peaking during slow-wave sleep." (Ganong's)
TRH (hypothalamus)
│ ↑
┌──────▼──────┐
│ Anterior │ → TSH → Thyroid → T₃ / T₄
│ Pituitary │
└─────────────┘
↑ (-) T₃/T₄ (negative long-loop feedback)
↑ (-) Somatostatin, Dopamine, Glucocorticoids
Stimulators: TRH, Cold exposure
Inhibitors: T₃/T₄ (main), Somatostatin, Dopamine, Glucocorticoids
⭐ Key Statement: "T₃/T₄ exert negative feedback at BOTH the hypothalamic (↓TRH) and pituitary (↓TSH) levels." (Costanzo Physiology)
POMC (266 amino acids)
│
┌────┴──────────────────┐
ACTH β-Lipotropin (β-LPH)
│ │
MSH, CLIP β-Endorphin, γ-LPH
⭐ Key Statement: "ACTH, β-LPH, and MSH are all derived from the same precursor molecule, POMC."
STRESS → Hypothalamus
│
CRH + AVP (vasopressin) → synergistic stimulation
│
Anterior Pituitary
│
ACTH
│
Adrenal Cortex
│
Cortisol ──────────(−)──────→ Hypothalamus + Pituitary
(negative feedback)
Stimulators: CRH, AVP, stress, cytokines (IL-1, IL-6)
Inhibitors: Cortisol/glucocorticoids (main)
⭐ Key Statement: "ACTH shows a diurnal rhythm - peaks in early morning (6-8 AM), lowest at midnight." (Ganong's)
⭐ Key Statement: "Prolactin is the ONLY anterior pituitary hormone whose predominant hypothalamic control is INHIBITORY (via dopamine/PIH)." (Ganong's, p.320)
INHIBITORS (dominant): STIMULATORS:
─────────────────── ─────────────
Dopamine (PIH) - main Suckling reflex (most potent physiologic)
TRH
Estrogen
VIP (vasoactive intestinal peptide)
Stress
Hypothyroidism (↑TRH → ↑PRL)
Suckling reflex
│
▼
Hypothalamus: ↓ Dopamine release (PIH) + ↑ PRH
│
▼
↑ Prolactin secretion
│
▼
Milk synthesis + ↓ GnRH → Amenorrhea
⭐ Clinical Point: Hyperprolactinemia (e.g., prolactinoma) → galactorrhea + amenorrhea in women; treated with dopamine agonists (bromocriptine, cabergoline).
| FSH | LH | |
|---|---|---|
| In Women | Stimulates follicular development; stimulates estrogen production (via aromatase) | Triggers ovulation (LH surge); stimulates corpus luteum → progesterone |
| In Men | Stimulates Sertoli cells → spermatogenesis; stimulates inhibin production | Stimulates Leydig cells → testosterone synthesis |
⭐ Key Statement: "Both FSH and LH are controlled by pulsatile GnRH; continuous GnRH paradoxically inhibits gonadotropin secretion."
Hypothalamus
│
GnRH (pulsatile)
│
Anterior Pituitary
│
LH + FSH
│ │
Gonads Gonads
│ │
Testosterone/ Estrogen/
Inhibin (men) Progesterone/Inhibin (women)
│ │
└────(−)───────────┘
Negative feedback on Hypothalamus + Pituitary
EXCEPTION ─ Positive feedback:
High sustained estrogen → (+) feedback → LH SURGE → ovulation
⭐ Key Statement: "Inhibin (from Sertoli cells/granulosa cells) selectively inhibits FSH but not LH."

| Hormone | Cell | Hypothalamic Stimulator | Hypothalamic Inhibitor | Main Actions | Negative Feedback by |
|---|---|---|---|---|---|
| GH | Somatotrope | GHRH, Ghrelin | Somatostatin | Growth, lipolysis, protein synthesis (via IGF-1) | IGF-1, GH itself |
| TSH | Thyrotrope | TRH | Somatostatin, Dopamine | Stimulates T₃/T₄ synthesis & release | T₃/T₄ |
| ACTH | Corticotrope | CRH, AVP | Cortisol (direct) | Stimulates cortisol, aldosterone, androgens | Cortisol |
| PRL | Lactotrope | TRH, VIP, Estrogen | Dopamine (PIH) | Lactation, inhibits GnRH | Dopamine (not target hormone) |
| FSH | Gonadotrope | GnRH | Sex steroids, Inhibin | Follicular development / Spermatogenesis | Inhibin, Estrogen |
| LH | Gonadotrope | GnRH | Sex steroids | Ovulation, corpus luteum / Testosterone (Leydig) | Testosterone, Estrogen |
let the answer be according to indu khuranah
Indu Khurrana physiology textbook anterior pituitary hormones chapters
https://dokumen.pub/concise-textbook-of-physiology-by-indu-k…
anterior pituitary hormones flowchart regulation hypothalamus

A combined anatomical diagram and physiological flowchart illustrating the regulation of the Hypothalamic-Pituitary-Adrenal (HPA) axis. On the left, a midsagittal line drawing of the human brain highlights three key neuroanatomical regions involved in stress processing: the hippocampus (indicated by a red curved shape), the amygdala (represented by a green circle), and the medial prefrontal cortex (depicted as a yellow rectangle). On the right, a vertical flowchart outlines the neuroendocrine cascade of the HPA axis. The pathway originates at the Hypothalamus, which releases Corticotropin-releasing hormone (CRH) to stimulate the Anterior Pituitary. The pituitary then secretes Adrenocorticotropic hormone (ACTH), which acts on the Adrenal Cortex to stimulate the production and release of Cortisol. Red lateral arrows indicate negative feedback loops from the adrenal cortex and pituitary back to the hypothalamus. The diagram serves as an educational tool to explain how cortical and limbic structures modulate the hormonal stress response pathway.

This pathophysiology diagram illustrates the Hypothalamic-Pituitary-Adrenal (HPA) axis, a primary neuroendocrine system involved in the body's stress response. The flowchart begins at the top with a grey-scaled brain highlighting the hypothalamus, which triggers the release of Corticotropin-Releasing Hormone (CRH). A downward arrow leads to the pituitary gland, colored in yellow and grey, representing the secretion of Adrenocorticotropic Hormone (ACTH). ACTH then acts upon the adrenal glands, shown as orange crescent-shaped structures located superior to the reddish-pink bean-shaped kidneys. The final step in the forward pathway is the production of Cortisol from the adrenal cortex. The diagram features long, curved upward-pointing arrows from Cortisol back to both the pituitary gland and the hypothalamus, representing the negative feedback mechanism essential for maintaining systemic homeostasis and regulating hormone levels in response to physiological or psychological stressors.

This pathophysiology diagram illustrates the hypothalamic-pituitary-adrenal (HPA) axis and its relationship with the hippocampus under chronic stress conditions. The left side depicts a sagittal section of the brain showing the 'Higher Functions' and the 'Hypothalamus' stimulating the 'Anterior Pituitary Gland' to release corticotropin-releasing hormone (CRH) and adrenocorticotropic hormone (ACTH). These hormones stimulate the 'Adrenal Gland' to secrete cortisol. A negative feedback loop is shown where cortisol inhibits further CRH and ACTH release. The right side of the diagram highlights the clinical impact of chronic cortisol elevation on the 'Hippocampus,' specifically illustrating hippocampal shrinkage and impaired memory. Color-coded arrows define functional relationships: green for stimulation, purple for release, red for inhibition, and blue for impairment. The illustration serves as an educational resource for understanding neuroendocrinology, the physiological stress response, and the long-term neurobiological effects of glucocorticoids on brain morphology and cognitive function.

Anatomical diagram and pathophysiology flowchart illustrating the Hypothalamic-Pituitary-Adrenal (HPA) axis and its neurobiological regulation. Panel A presents a mid-sagittal view of the human brain, identifying key anatomical structures involved in stress response: prefrontal cortex (PFCtx), amygdala (AMY), hypothalamus (HYP), hippocampus (HC), pituitary gland, and brainstem nuclei including the Raphe nucleus, Locus coeruleus, and Nucleus of the Tractus Solitarius (NTS). Panel B is a schematic representation of the HPA endocrine cascade. It depicts activation (+) pathways where the hypothalamus releases CRH/AVP to stimulate the pituitary gland, which then secretes ACTH to stimulate the adrenal gland to produce glucocorticoids (GCs/cortisol). The diagram also illustrates negative feedback loops (-) where glucocorticoids inhibit the hippocampus, hypothalamus, and pituitary. Additionally, it shows the hippocampus exerting inhibitory control over the hypothalamus via GABAergic pathways. This visual resource is intended for medical education regarding endocrinology, neuroanatomy, and the physiological response to stress.
growth hormone secretion regulation GHRH somatostatin IGF-1

An educational pathophysiology diagram and graph illustrating the neuroendocrine regulation and pulsatile secretion of Growth Hormone (GH). The image features three primary sections: a sagittal brain illustration, a line graph of GH levels, and peripheral target tissue icons. The top right depicts the brain with arrows showing that Ghrelin and Growth Hormone-Releasing Hormone (GHRH) exert a stimulatory (+) effect on GH secretion, while Somatostatin (SST) exerts an inhibitory (-) effect. A central arrow labeled 'GH' branches into 'GH central actions' returning to the brain and 'GH peripheral actions' targeting the liver, skeletal muscle/bone, and white adipose tissue (shown via histology). The liver icon is labeled with IGF-1, indicating the GH-IGF-1 axis that promotes somatic growth. On the left, a line graph shows blood GH (ng/mL) over time (8:00 to 12:00), highlighting a distinct pulsatile secretion pattern characterized by intermittent spikes reaching up to 15-20 ng/mL, rather than constant levels. This visual summarizes the feedback loops and physiological impacts of the somatotropic axis on metabolism and growth.

This medical illustration depicts the somatotropic axis, a key endocrine pathway for growth hormone (GH) regulation. On the left, a sagittal view of the human brain identifies the anatomical positions of the hypothalamus and the pituitary gland. To the right, a corresponding flow diagram outlines the physiological cascade. The hypothalamus initiates the pathway by secreting Growth Hormone-Releasing Hormone (GHRH), which stimulates the pituitary, and Growth Hormone-Inhibiting Hormone (GHIH/somatostatin), which acts as an inhibitor. In response to GHRH, the pituitary gland releases Growth Hormone (GH) into circulation. This hormone travels to the liver, where it triggers the production and release of Insulin-like Growth Factor 1 (IGF-1). The diagram concludes by showing that IGF-1 acts on peripheral target tissues, specifically muscles, bones, and fat cells, to promote growth and metabolic processes. The schematic provides a comprehensive overview of the neuroendocrine control and systemic effects of the GH/IGF-1 axis suitable for medical education.

This pathophysiology diagram illustrates the direct and indirect antitumor mechanisms of somatostatin analogs in the context of meningioma treatment. The visual is divided into two functional sections: indirect mechanisms (left) and direct cellular mechanisms (right). Indirectly, somatostatin analogs are shown to inhibit the pituitary gland, reducing the GH-Liver-IGF-1 axis, and to inhibit meningioma cells, decreasing VEGF secretion and subsequent angiogenesis, both of which normally promote tumor growth. Additionally, the analogs are shown to stimulate the immune system to inhibit tumor growth. Directly, on the right, somatostatin analogs bind to the SSTR2 receptor on a meningioma cell membrane. This binding triggers an intracellular signaling cascade activating SHP1 and SHP2. SHP1 acts as a central regulator by inhibiting the PI3K/Akt pathway (reducing proliferation), down-regulating Cyclin D1 (removing its inhibition on cell cycle arrest), and up-regulating p27/Kip1, which directly promotes cell cycle arrest. The diagram uses standard notation where red arrows signify promotion/activation and blue flat-headed lines signify inhibition.
📌 Key Point (Khurana): "The anterior pituitary is under the control of the hypothalamus via hypophysiotropic hormones transported through the portal blood vessels of the pituitary stalk."
| Cell Type | Hormone Secreted | % of cells |
|---|---|---|
| Somatotropes | Growth Hormone (GH) | ~50% |
| Corticotropes | ACTH + β-LPH | ~20% |
| Lactotropes | Prolactin (PRL) | ~15–20% |
| Thyrotropes | TSH | ~5% |
| Gonadotropes | FSH + LH | ~10% |
📌 Mnemonic (Khurana style): "FLAT PG" - FSH, LH, ACTH, TSH, PRL, GH


| Hypothalamic Hormone | Abbreviation | Effect on Anterior Pituitary |
|---|---|---|
| Corticotropin-releasing hormone | CRH | ↑ ACTH |
| Thyrotropin-releasing hormone | TRH | ↑ TSH, ↑ PRL |
| Gonadotropin-releasing hormone | GnRH | ↑ LH, ↑ FSH |
| Growth hormone-releasing hormone | GHRH | ↑ GH |
| Growth hormone release-inhibiting hormone | GRIH / Somatostatin | ↓ GH, ↓ TSH |
| Prolactin-inhibiting hormone (= Dopamine) | PIH | ↓ PRL |
| Prolactin-releasing hormone | PRH | ↑ PRL |
GH → Liver (+ other tissues)
↓
IGF-1 (Somatomedin C) released
↓
┌──────────────────────────────┐
│ • Stimulates chondrogenesis │
│ at epiphyseal plates │
│ • Promotes linear bone │
│ growth (increases height) │
│ • Stimulates organ growth │
│ (visceromegaly) │
└──────────────────────────────┘
| Effect | Details |
|---|---|
| Protein metabolism | ↑ Protein synthesis in all cells (anabolic) |
| Fat metabolism | ↑ Lipolysis → ↑ free fatty acids in blood |
| Carbohydrate metabolism | ↓ Glucose utilization → ↑ blood glucose (diabetogenic) |
| Mineral metabolism | Retains Na⁺, K⁺, Ca²⁺, Cl⁻, phosphate |
| Electrolyte | ↑ Intestinal Ca²⁺ absorption |
📌 Khurana Key Statement: "GH has both insulin-like (anabolic - via IGF-1) and anti-insulin (diabetogenic - direct) effects."

HYPOTHALAMUS
/ \
↓ ↓
GHRH (+) GRIH/Somatostatin (−)
↓ ↓
ANTERIOR PITUITARY (Somatotropes)
↓
GH (↑ or ↓)
↓
LIVER → IGF-1
↓
(−) Feedback to Hypothalamus + Pituitary
| Stimulators of GH | Inhibitors of GH |
|---|---|
| GHRH | Somatostatin (GRIH) |
| Ghrelin (from stomach) | IGF-1 / Somatomedins |
| Hypoglycaemia | Hyperglycaemia |
| Exercise, stress | Obesity, free fatty acids |
| Slow-wave sleep | Glucocorticoids (excess) |
| Amino acids (arginine) | Hypothyroidism |
| Oestrogen, testosterone | GH itself (short loop) |
| Starvation |
📌 Khurana Applied/Clinical Box:
- Excess GH before puberty → Gigantism (tall stature)
- Excess GH after puberty (after epiphyseal fusion) → Acromegaly (coarse features, large hands/feet)
- GH deficiency in childhood → Pituitary dwarfism (proportionate short stature, normal intelligence)
Cold exposure
↓
HYPOTHALAMUS
↓ TRH (+)
ANTERIOR PITUITARY (Thyrotropes)
↓ TSH
THYROID GLAND
↓ T₃ / T₄
Target tissues (heat production, metabolism)
│
└───(−) Long-loop negative feedback
→ inhibits both TRH and TSH
| Stimulators | Inhibitors |
|---|---|
| TRH | T₃/T₄ (negative feedback — main) |
| Cold exposure | Somatostatin |
| Dopamine | |
| Glucocorticoids |
📌 Khurana Key Statement: "T₃ (more potent) and T₄ exert negative feedback on both the hypothalamus (↓TRH) and anterior pituitary (↓TSH), completing the long-loop feedback."
POMC (266 amino acids — prohormone)
│
┌──────┴──────────┐
ACTH (1-39) β-Lipotropin (β-LPH)
│ │
┌──┴──┐ ┌──────┴──────┐
MSH CLIP γ-LPH β-Endorphin
📌 Key Statement: "ACTH, MSH and β-endorphin are all derived from the same precursor POMC — this explains why patients with adrenal insufficiency (Addison's disease) develop skin pigmentation due to excess ACTH/MSH."

STRESS (physical/emotional/hypoglycaemia)
↓
HYPOTHALAMUS
↓ CRH + AVP (synergistic)
ANTERIOR PITUITARY (Corticotropes)
↓ ACTH
ADRENAL CORTEX
↓ CORTISOL
Target tissues (metabolic effects)
│
└──(−) Negative feedback → Hypothalamus + Pituitary
| Stimulators | Inhibitors |
|---|---|
| CRH (main) | Cortisol / glucocorticoids (main) |
| AVP (vasopressin) — synergistic with CRH | |
| Stress, trauma, surgery | |
| Cytokines (IL-1, IL-6, TNF) | |
| Hypoglycaemia |
📌 Khurana Key Statement: "ACTH secretion shows a diurnal (circadian) rhythm — highest at 6–8 AM (early morning) and lowest around midnight."📌 Applied: Exogenous glucocorticoids cause adrenal atrophy by suppressing ACTH through negative feedback.
📌 Khurana Key Statement: "Prolactin is the ONLY anterior pituitary hormone that is predominantly under inhibitory hypothalamic control — dopamine (PIH) tonically suppresses prolactin secretion."
HYPOTHALAMUS
│
├── Dopamine (PIH) ─────────(−)─────┐
│ ↓
└── PRH / TRH / VIP ──────(+)──→ LACTOTROPES → PROLACTIN
↓
Mammary glands → Milk
SUCKLING REFLEX → most potent physiological stimulator
↓
Afferent nerve impulses to hypothalamus
↓
↓ Dopamine release + ↑ PRH
↓
↑ Prolactin → Milk ejection (with oxytocin)
| Stimulators of PRL | Inhibitors of PRL |
|---|---|
| Suckling reflex (most potent) | Dopamine / PIH (main) |
| TRH | |
| Oestrogen | |
| VIP | |
| Stress | |
| Hypothyroidism (↑TRH → ↑PRL) | |
| Antipsychotics (block dopamine) |
📌 Applied (Khurana Clinical Box):
- Hyperprolactinaemia → Galactorrhoea + amenorrhoea in women
- Caused by: Prolactinoma (most common pituitary tumour), antipsychotics, hypothyroidism
- Treatment: Dopamine agonists — bromocriptine, cabergoline
| FSH | LH | |
|---|---|---|
| Follicular phase | Stimulates follicular development; ↑ oestrogen (via aromatase) | Supports follicular growth |
| Ovulation | — | LH surge → triggers ovulation |
| Luteal phase | — | Maintains corpus luteum → progesterone |
| FSH | LH | |
|---|---|---|
| Target cell | Sertoli cells | Leydig cells |
| Action | Spermatogenesis; produces inhibin | Testosterone synthesis |
HYPOTHALAMUS
↓ GnRH (pulsatile — essential)
ANTERIOR PITUITARY (Gonadotropes)
↓ ↓
LH FSH
↓ ↓
Gonads (Ovary / Testis)
↓
Sex steroids + Inhibin
│
└──(−) Negative feedback → Hypothalamus + Pituitary
📌 Khurana Key Statement: "GnRH must be secreted in a PULSATILE manner to stimulate gonadotropin release. Continuous GnRH causes paradoxical downregulation of GnRH receptors and suppresses LH/FSH — this principle is used clinically."
| Stimulators | Inhibitors |
|---|---|
| GnRH (pulsatile) | Sex steroids (testosterone, oestrogen, progesterone) |
| Activins | Inhibin (selectively inhibits FSH only) |
| Oestrogen (positive feedback for LH surge) |
📌 Special: High sustained oestrogen → Positive feedback → LH surge → ovulation (this is the exception to the rule)
📌 Applied (Khurana):
- GnRH analogues (continuous) used to suppress gonadotropins in prostate cancer, endometriosis, precocious puberty
- Inhibin from Sertoli cells/granulosa cells → specifically suppresses FSH

| Feedback Type | Pathway |
|---|---|
| Long-loop | Target gland hormone → inhibits Hypothalamus + Pituitary |
| Short-loop | Anterior pituitary hormone → inhibits Hypothalamus |
| Ultrashort-loop | Hypothalamic hormone → inhibits its OWN secretion |
| Hormone | Cell | Nature | Hypothalamic Control | Main Actions | Feedback | Disorder (Excess / Deficiency) |
|---|---|---|---|---|---|---|
| GH | Somatotrope | Polypeptide (191 AA) | GHRH (+), GRIH (−) | Growth via IGF-1; Lipolysis; ↑ blood glucose | IGF-1 (−) | Gigantism / Acromegaly / Dwarfism |
| TSH | Thyrotrope | Glycoprotein | TRH (+), Somatostatin (−) | ↑ T₃/T₄ synthesis & release | T₃/T₄ (−) | Hyperthyroidism / Hypothyroidism |
| ACTH | Corticotrope | Polypeptide (39 AA) from POMC | CRH + AVP (+) | ↑ Cortisol, adrenal androgens | Cortisol (−) | Cushing's / Addison's |
| PRL | Lactotrope | Polypeptide (198 AA) | Dopamine (−), TRH/PRH (+) | Lactation; ↓ GnRH | Dopamine inhibits (not target hormone) | Prolactinoma → galactorrhoea + amenorrhoea |
| FSH | Gonadotrope | Glycoprotein | GnRH (+) | Folliculogenesis / Spermatogenesis | Inhibin (−), Oestrogen (−) | Hypogonadism / POF |
| LH | Gonadotrope | Glycoprotein | GnRH (+) | Ovulation / Testosterone synthesis | Testosterone/Oestrogen (−) | Hypogonadism |
References: Indu Khurana — Textbook of Medical Physiology & Concise Textbook of Physiology, Section VIII.2 (Endocrinal Functions of Hypothalamus and Pituitary Gland) | Ganong's Review of Medical Physiology 26E | Costanzo Physiology 7E | Harrison's Principles 22E
Generate a comprehensive PDF study guide with all pituitary hormone tables and flowcharts
mkdir -p /tmp/workspace/pituitary-study-guide && ls /tmp/workspace/
~/pituitary-study-guide/generate_pdf.py
"""
Anterior Pituitary Hormones - Comprehensive Study Guide PDF
Style: Indu Khurana Textbook of Medical Physiology
"""
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.units import cm, mm
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
HRFlowable, KeepTogether, PageBreak
)
from reportlab.platypus.flowables import Flowable
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
from reportlab.graphics.shapes import Drawing, Rect, String, Line, Arrow, Polygon
from reportlab.graphics import renderPDF
from reportlab.graphics.shapes import (
Drawing, Rect, String, Line, Polygon, Group, Path
)
from reportlab.lib.colors import (
HexColor, white, black, lightblue, lightyellow, lightgreen, lightgrey
)
import io
# ─── COLOR PALETTE ───────────────────────────────────────────────
C_HEADER = HexColor("#1B3A5C") # deep navy
C_SUBHDR = HexColor("#2E6DA4") # medium blue
C_ACCENT = HexColor("#E8F4FD") # very light blue bg
C_GOLD = HexColor("#F0A500") # gold for highlights
C_RED = HexColor("#C0392B") # red for inhibitors
C_GREEN = HexColor("#1E8449") # green for stimulators
C_TABLE_HDR = HexColor("#1B3A5C")
C_TABLE_ALT = HexColor("#EBF5FB")
C_TABLE_ALT2 = HexColor("#FDFEFE")
C_BOX_BG = HexColor("#FEF9E7") # key statement box
C_BOX_BORDER = HexColor("#F0A500")
C_FLOW_BOX = HexColor("#D6EAF8")
C_FLOW_ARROW = HexColor("#2E6DA4")
C_CLINICAL = HexColor("#FDEDEC")
C_CLIN_BDR = HexColor("#C0392B")
C_MNEM = HexColor("#E8F8F5")
C_MNEM_BDR = HexColor("#1E8449")
PAGE_W, PAGE_H = A4
# ─── STYLES ──────────────────────────────────────────────────────
styles = getSampleStyleSheet()
def make_style(name, parent='Normal', **kwargs):
return ParagraphStyle(name, parent=styles[parent], **kwargs)
ST_TITLE = make_style('ST_TITLE', 'Title',
fontSize=22, textColor=C_HEADER, spaceAfter=4,
fontName='Helvetica-Bold', alignment=TA_CENTER)
ST_SUBTITLE = make_style('ST_SUBTITLE', fontSize=13, textColor=C_SUBHDR,
spaceAfter=6, fontName='Helvetica-Bold', alignment=TA_CENTER)
ST_SECTION = make_style('ST_SECTION', fontSize=14, textColor=white,
fontName='Helvetica-Bold', spaceAfter=6, spaceBefore=14,
backColor=C_HEADER, leftIndent=-10, rightIndent=-10,
borderPadding=(4, 8, 4, 8))
ST_SUBSECTION = make_style('ST_SUBSECTION', fontSize=12, textColor=C_SUBHDR,
fontName='Helvetica-Bold', spaceAfter=4, spaceBefore=8,
borderPadding=(2, 0, 2, 0))
ST_BODY = make_style('ST_BODY', fontSize=9.5, leading=14,
spaceAfter=4, alignment=TA_JUSTIFY)
ST_BULLET = make_style('ST_BULLET', fontSize=9.5, leading=13,
leftIndent=14, bulletIndent=4, spaceAfter=2,
firstLineIndent=0)
ST_KEYBOX = make_style('ST_KEYBOX', fontSize=9.5, leading=13,
textColor=HexColor("#7D6608"), fontName='Helvetica-BoldOblique',
leftIndent=8, rightIndent=8)
ST_CLINICAL = make_style('ST_CLINICAL', fontSize=9.5, leading=13,
textColor=HexColor("#7B241C"), fontName='Helvetica',
leftIndent=8, rightIndent=8)
ST_MNEM = make_style('ST_MNEM', fontSize=10, leading=14,
textColor=HexColor("#145A32"), fontName='Helvetica-Bold',
leftIndent=8, rightIndent=8, alignment=TA_CENTER)
ST_TH = make_style('ST_TH', fontSize=9, textColor=white,
fontName='Helvetica-Bold', alignment=TA_CENTER, leading=12)
ST_TD = make_style('ST_TD', fontSize=8.5, leading=11,
fontName='Helvetica', alignment=TA_LEFT)
ST_TD_C = make_style('ST_TD_C', fontSize=8.5, leading=11,
fontName='Helvetica', alignment=TA_CENTER)
ST_CAPTION = make_style('ST_CAPTION', fontSize=8, textColor=C_SUBHDR,
fontName='Helvetica-Oblique', alignment=TA_CENTER,
spaceAfter=6)
ST_VIVA_Q = make_style('ST_VIVA_Q', fontSize=9.5, textColor=C_HEADER,
fontName='Helvetica-Bold', spaceBefore=6, spaceAfter=2)
ST_VIVA_A = make_style('ST_VIVA_A', fontSize=9.5, leading=13,
fontName='Helvetica', leftIndent=12, spaceAfter=4)
ST_PAGENUM = make_style('ST_PAGENUM', fontSize=8, alignment=TA_CENTER,
textColor=C_SUBHDR)
# ─── HELPER FLOWABLES ─────────────────────────────────────────────
def section_heading(text):
"""Blue banner section heading."""
data = [[Paragraph(f" {text}", make_style('sh_inner', fontSize=13,
textColor=white, fontName='Helvetica-Bold', leading=16))]]
t = Table(data, colWidths=[PAGE_W - 4*cm])
t.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,-1), C_HEADER),
('TOPPADDING', (0,0), (-1,-1), 6),
('BOTTOMPADDING', (0,0), (-1,-1), 6),
('LEFTPADDING', (0,0), (-1,-1), 10),
]))
return t
def subsection_heading(text):
return Paragraph(f"<font color='#{C_SUBHDR.hexval()[2:]}' size='11'><b>{text}</b></font>", ST_BODY)
def key_statement(text):
data = [[Paragraph(f"📌 <b>Key Statement:</b> {text}", ST_KEYBOX)]]
t = Table(data, colWidths=[PAGE_W - 4*cm])
t.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,-1), C_BOX_BG),
('BOX', (0,0), (-1,-1), 1.5, C_BOX_BORDER),
('TOPPADDING', (0,0), (-1,-1), 6),
('BOTTOMPADDING', (0,0), (-1,-1), 6),
('LEFTPADDING', (0,0), (-1,-1), 10),
('RIGHTPADDING', (0,0), (-1,-1), 10),
]))
return t
def clinical_box(lines):
content = "<b>🏥 Applied / Clinical (Khurana):</b><br/>" + "<br/>".join(f"• {l}" for l in lines)
data = [[Paragraph(content, ST_CLINICAL)]]
t = Table(data, colWidths=[PAGE_W - 4*cm])
t.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,-1), C_CLINICAL),
('BOX', (0,0), (-1,-1), 1.5, C_CLIN_BDR),
('TOPPADDING', (0,0), (-1,-1), 6),
('BOTTOMPADDING', (0,0), (-1,-1), 6),
('LEFTPADDING', (0,0), (-1,-1), 10),
('RIGHTPADDING', (0,0), (-1,-1), 10),
]))
return t
def mnemonic_box(text):
data = [[Paragraph(text, ST_MNEM)]]
t = Table(data, colWidths=[PAGE_W - 4*cm])
t.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,-1), C_MNEM),
('BOX', (0,0), (-1,-1), 1.5, C_MNEM_BDR),
('TOPPADDING', (0,0), (-1,-1), 6),
('BOTTOMPADDING', (0,0), (-1,-1), 6),
]))
return t
def make_table(headers, rows, col_widths=None):
"""Build a styled table with header row."""
header_cells = [Paragraph(h, ST_TH) for h in headers]
data = [header_cells]
for i, row in enumerate(rows):
cells = [Paragraph(str(c), ST_TD) for c in row]
data.append(cells)
if col_widths is None:
n = len(headers)
col_widths = [(PAGE_W - 4*cm) / n] * n
t = Table(data, colWidths=col_widths, repeatRows=1)
style = [
('BACKGROUND', (0,0), (-1,0), C_TABLE_HDR),
('TEXTCOLOR', (0,0), (-1,0), white),
('ALIGN', (0,0), (-1,-1), 'LEFT'),
('VALIGN', (0,0), (-1,-1), 'MIDDLE'),
('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'),
('FONTSIZE', (0,0), (-1,-1), 8.5),
('TOPPADDING', (0,0), (-1,-1), 4),
('BOTTOMPADDING', (0,0), (-1,-1), 4),
('LEFTPADDING', (0,0), (-1,-1), 5),
('GRID', (0,0), (-1,-1), 0.5, colors.grey),
]
for i in range(1, len(data)):
bg = C_TABLE_ALT if i % 2 == 0 else C_TABLE_ALT2
style.append(('BACKGROUND', (0,i), (-1,i), bg))
t.setStyle(TableStyle(style))
return t
def hr():
return HRFlowable(width="100%", thickness=0.5, color=C_SUBHDR, spaceAfter=4, spaceBefore=4)
def sp(h=6):
return Spacer(1, h)
# ─── FLOWCHART DRAWING HELPERS ─────────────────────────────────────
def flow_box(d, x, y, w, h, text, bg=C_FLOW_BOX, text_color=C_HEADER, font_size=8):
"""Draw a rounded rectangle with text centered."""
d.add(Rect(x, y, w, h, rx=5, ry=5, fillColor=bg, strokeColor=C_FLOW_ARROW, strokeWidth=1))
# Multi-line: split on \n
lines = text.split('\n')
line_h = font_size + 2
total_h = len(lines) * line_h
start_y = y + h/2 + total_h/2 - line_h
for i, line in enumerate(lines):
d.add(String(x + w/2, start_y - i*line_h, line,
textAnchor='middle', fontSize=font_size,
fillColor=text_color, fontName='Helvetica-Bold'))
def flow_text_box(d, x, y, w, h, text, bg=C_FLOW_BOX, text_color=C_HEADER, font_size=8, bold=False):
fn = 'Helvetica-Bold' if bold else 'Helvetica'
d.add(Rect(x, y, w, h, rx=4, ry=4, fillColor=bg, strokeColor=C_SUBHDR, strokeWidth=0.8))
lines = text.split('\n')
lh = font_size + 2
ty = y + h/2 + (len(lines)-1)*lh/2
for i, ln in enumerate(lines):
d.add(String(x+w/2, ty - i*lh, ln, textAnchor='middle',
fontSize=font_size, fillColor=text_color, fontName=fn))
def arrow_down(d, x, y, length=25, label='', color=C_FLOW_ARROW):
d.add(Line(x, y, x, y-length, strokeColor=color, strokeWidth=1.5))
# arrowhead
d.add(Polygon([x, y-length, x-4, y-length+7, x+4, y-length+7],
fillColor=color, strokeColor=color))
if label:
d.add(String(x+5, y-length/2, label, fontSize=7, fillColor=color,
fontName='Helvetica-Bold'))
def arrow_up(d, x, y, length=25, label='', color=C_RED):
d.add(Line(x, y, x, y+length, strokeColor=color, strokeWidth=1.2,
strokeDashArray=[3,2]))
d.add(Polygon([x, y+length, x-4, y+length-7, x+4, y+length-7],
fillColor=color, strokeColor=color))
if label:
d.add(String(x+5, y+length/2, label, fontSize=7, fillColor=color,
fontName='Helvetica-Bold'))
def plus_label(d, x, y):
d.add(String(x, y, '(+)', fontSize=7.5, fillColor=C_GREEN, fontName='Helvetica-Bold'))
def minus_label(d, x, y):
d.add(String(x, y, '(−)', fontSize=7.5, fillColor=C_RED, fontName='Helvetica-Bold'))
# ─── FLOWCHART 1: MASTER HPT AXIS ─────────────────────────────────
def draw_master_axis_flowchart():
"""Master flowchart: Hypothalamus → AP hormones → Target glands."""
W, H = 480, 400
d = Drawing(W, H)
d.add(Rect(0, 0, W, H, fillColor=HexColor("#F8FBFF"), strokeColor=C_SUBHDR, strokeWidth=0.5))
# Title
d.add(String(W/2, H-18, "Hypothalamus – Anterior Pituitary – Target Glands Axis",
textAnchor='middle', fontSize=9, fillColor=C_HEADER, fontName='Helvetica-Bold'))
# Hypothalamus box
flow_text_box(d, 150, H-55, 180, 28, 'HYPOTHALAMUS', bg=C_HEADER,
text_color=white, font_size=9, bold=True)
# Arrows down from hypothalamus to AP
d.add(Line(240, H-55, 240, H-90, strokeColor=C_FLOW_ARROW, strokeWidth=1.5))
d.add(Polygon([240, H-90, 236, H-83, 244, H-83], fillColor=C_FLOW_ARROW, strokeColor=C_FLOW_ARROW))
d.add(String(245, H-74, 'Hypophysiotropic\nhormones (portal\nblood)', fontSize=6.5,
fillColor=C_SUBHDR, fontName='Helvetica-Oblique'))
# Anterior Pituitary box
flow_text_box(d, 150, H-118, 180, 28, 'ANTERIOR PITUITARY\n(Adenohypophysis)',
bg=HexColor("#2E6DA4"), text_color=white, font_size=8.5, bold=True)
# 6 hormone boxes fanning out
hormones = [
('GH', 15, HexColor("#D5F5E3")),
('TSH', 95, HexColor("#D6EAF8")),
('ACTH', 175, HexColor("#FDEDEC")),
('PRL', 255, HexColor("#FEF9E7")),
('FSH', 335, HexColor("#F4ECF7")),
('LH', 405, HexColor("#FDFEFE")),
]
horm_y = H - 185
for name, hx, bg in hormones:
flow_text_box(d, hx, horm_y, 55, 22, name, bg=bg, text_color=C_HEADER, font_size=8.5, bold=True)
# arrow from AP to hormone
src_x = 240
dst_x = hx + 27
d.add(Line(src_x, H-118, dst_x, horm_y+22, strokeColor=C_FLOW_ARROW, strokeWidth=0.8))
d.add(Polygon([dst_x, horm_y+22, dst_x-3, horm_y+28, dst_x+3, horm_y+28],
fillColor=C_FLOW_ARROW, strokeColor=C_FLOW_ARROW))
# Target gland boxes
targets = [
('Liver/\nBone\n(IGF-1)', 15, HexColor("#D5F5E3")),
('Thyroid\n(T₃/T₄)', 95, HexColor("#D6EAF8")),
('Adrenal\nCortex\n(Cortisol)', 175, HexColor("#FDEDEC")),
('Breast\n(Milk)', 255, HexColor("#FEF9E7")),
('Ovary/\nTestis', 335, HexColor("#F4ECF7")),
('Ovary/\nLeydig\n(Test.)', 405, HexColor("#FDFEFE")),
]
tgt_y = H - 270
for (name, tx, bg), (_, hx, _) in zip(targets, hormones):
flow_text_box(d, tx, tgt_y, 55, 34, name, bg=bg, text_color=C_HEADER, font_size=7.5)
dst_x = tx + 27
src_x = hx + 27
d.add(Line(src_x, horm_y, dst_x, tgt_y+34, strokeColor=C_FLOW_ARROW, strokeWidth=0.8))
d.add(Polygon([dst_x, tgt_y+34, dst_x-3, tgt_y+38, dst_x+3, tgt_y+38],
fillColor=C_FLOW_ARROW, strokeColor=C_FLOW_ARROW))
# Neg feedback arrow (long loop)
d.add(Line(12, tgt_y+17, 12, H-104, strokeColor=C_RED, strokeWidth=1.2, strokeDashArray=[4,2]))
d.add(Polygon([12, H-104, 8, H-110, 16, H-110], fillColor=C_RED, strokeColor=C_RED))
d.add(String(2, H-168, '(−)\nNeg.\nFeedback\n(Long\nLoop)',
fontSize=6.5, fillColor=C_RED, fontName='Helvetica-Bold'))
# Legend
leg_y = 18
d.add(Line(W-150, leg_y+4, W-130, leg_y+4, strokeColor=C_FLOW_ARROW, strokeWidth=1.5))
d.add(String(W-125, leg_y, 'Stimulation', fontSize=7, fillColor=C_FLOW_ARROW))
d.add(Line(W-150, leg_y-10, W-130, leg_y-10, strokeColor=C_RED, strokeWidth=1.2, strokeDashArray=[3,2]))
d.add(String(W-125, leg_y-14, 'Inhibition', fontSize=7, fillColor=C_RED))
return d
# ─── FLOWCHART 2: GH REGULATION ───────────────────────────────────
def draw_gh_regulation():
W, H = 420, 310
d = Drawing(W, H)
d.add(Rect(0, 0, W, H, fillColor=HexColor("#F8FBFF"), strokeColor=C_SUBHDR, strokeWidth=0.5))
d.add(String(W/2, H-14, "Fig. VIII.2-4: Control of Growth Hormone Secretion (Indu Khurana)",
textAnchor='middle', fontSize=8, fillColor=C_HEADER, fontName='Helvetica-Bold'))
# Stimulators column
stims = ['Hypoglycaemia', 'Exercise/Stress', 'Slow-wave Sleep', 'Ghrelin (stomach)', 'Amino acids (Arg)']
inhib = ['Hyperglycaemia', 'Somatostatin (GRIH)', 'IGF-1 (neg. feedback)', 'Glucocorticoids', 'Obesity/FFA']
x_stim, x_inhib, x_hyp = 20, 270, 145
box_w, box_h = 110, 18
for i, s in enumerate(stims):
yy = H - 50 - i*22
flow_text_box(d, x_stim, yy, box_w, box_h, s, bg=HexColor("#D5F5E3"),
text_color=C_GREEN, font_size=7.5)
d.add(Line(x_stim+box_w, yy+9, x_hyp, H-90, strokeColor=C_GREEN, strokeWidth=0.7))
d.add(String(x_stim+box_w+2, yy+9, '+', fontSize=8, fillColor=C_GREEN, fontName='Helvetica-Bold'))
for i, s in enumerate(inhib):
yy = H - 50 - i*22
flow_text_box(d, x_inhib, yy, box_w, box_h, s, bg=HexColor("#FDEDEC"),
text_color=C_RED, font_size=7.5)
d.add(Line(x_inhib, yy+9, x_hyp+100, H-90, strokeColor=C_RED, strokeWidth=0.7,
strokeDashArray=[2,2]))
d.add(String(x_inhib-12, yy+9, '−', fontSize=9, fillColor=C_RED, fontName='Helvetica-Bold'))
# Hypothalamus
flow_text_box(d, x_hyp, H-105, 100, 28, 'HYPOTHALAMUS\n(GHRH / GRIH)',
bg=C_HEADER, text_color=white, font_size=8.5, bold=True)
# Arrows down
arrow_down(d, x_hyp+50, H-105, 28)
d.add(String(x_hyp+54, H-120, 'GHRH (+)\nGRIH (−)', fontSize=7, fillColor=C_SUBHDR))
# Anterior pituitary
flow_text_box(d, x_hyp, H-162, 100, 28, 'ANTERIOR PITUITARY\n(Somatotropes)',
bg=HexColor("#2E6DA4"), text_color=white, font_size=8, bold=True)
arrow_down(d, x_hyp+50, H-162, 22)
d.add(String(x_hyp+54, H-175, 'GH', fontSize=8, fillColor=C_SUBHDR, fontName='Helvetica-Bold'))
# GH box
flow_text_box(d, x_hyp, H-212, 100, 28, 'GROWTH\nHORMONE (GH)',
bg=HexColor("#D6EAF8"), text_color=C_HEADER, font_size=8.5, bold=True)
# Branch: Direct and indirect
d.add(Line(x_hyp+50, H-212, x_hyp-30, H-240, strokeColor=C_FLOW_ARROW, strokeWidth=1))
d.add(Line(x_hyp+50, H-212, x_hyp+130, H-240, strokeColor=C_FLOW_ARROW, strokeWidth=1))
flow_text_box(d, x_hyp-80, H-268, 90, 28, 'Direct Actions\n(Anti-insulin\nDiabetogenic)',
bg=HexColor("#FEF9E7"), text_color=HexColor("#7D6608"), font_size=7.5)
flow_text_box(d, x_hyp+90, H-268, 90, 28, 'Via IGF-1\n(Liver → Bone\nGrowth)',
bg=HexColor("#D5F5E3"), text_color=C_GREEN, font_size=7.5)
# Feedback arrow IGF-1 → hypothalamus
d.add(Line(x_hyp+135, H-240, x_hyp+170, H-180, strokeColor=C_RED, strokeWidth=1,
strokeDashArray=[3,2]))
d.add(Line(x_hyp+170, H-180, x_hyp+160, H-90, strokeColor=C_RED, strokeWidth=1,
strokeDashArray=[3,2]))
d.add(Polygon([x_hyp+160, H-90, x_hyp+155, H-97, x_hyp+165, H-97],
fillColor=C_RED, strokeColor=C_RED))
d.add(String(x_hyp+172, H-150, '(−)\nIGF-1\nfeedback', fontSize=6.5,
fillColor=C_RED, fontName='Helvetica-Bold'))
return d
# ─── FLOWCHART 3: FEEDBACK LOOPS ──────────────────────────────────
def draw_feedback_loops():
W, H = 460, 320
d = Drawing(W, H)
d.add(Rect(0, 0, W, H, fillColor=HexColor("#FDFEFE"), strokeColor=C_SUBHDR, strokeWidth=0.5))
d.add(String(W/2, H-14, "Fig. VIII.1-2: Feedback Loop Types in Hypothalamic-Pituitary Axis",
textAnchor='middle', fontSize=8.5, fillColor=C_HEADER, fontName='Helvetica-Bold'))
# Left: Negative feedback (3 types)
section_x = 20
d.add(String(section_x+50, H-30, 'NEGATIVE FEEDBACK', textAnchor='middle',
fontSize=8, fillColor=C_HEADER, fontName='Helvetica-Bold'))
bx, bw, bh = section_x, 90, 22
levels = [
(H-52, 'HYPOTHALAMUS', C_HEADER, white),
(H-100, 'ANTERIOR PITUITARY', HexColor("#2E6DA4"), white),
(H-148, 'TARGET GLAND', HexColor("#1E8449"), white),
(H-196, 'TARGET HORMONE', C_GOLD, C_HEADER),
]
for yy, label, bg, tc in levels:
flow_text_box(d, bx, yy, bw, bh, label, bg=bg, text_color=tc, font_size=7.5, bold=True)
for i in range(3):
y_top = levels[i][0]
y_bot = levels[i+1][0] + bh
cx = bx + bw/2
d.add(Line(cx, y_top, cx, y_bot, strokeColor=C_FLOW_ARROW, strokeWidth=1.2))
d.add(Polygon([cx, y_bot, cx-3, y_bot+5, cx+3, y_bot+5],
fillColor=C_FLOW_ARROW, strokeColor=C_FLOW_ARROW))
d.add(String(cx+5, (y_top+y_bot)//2, '(+)', fontSize=7, fillColor=C_GREEN,
fontName='Helvetica-Bold'))
# Long loop arrow (hormone back to hypothalamus + pituitary)
long_x = bx + bw + 8
d.add(Line(long_x-8, levels[3][0]+11, long_x+15, levels[3][0]+11, strokeColor=C_RED, strokeWidth=1, strokeDashArray=[3,2]))
d.add(Line(long_x+15, levels[3][0]+11, long_x+15, levels[0][0]+11, strokeColor=C_RED, strokeWidth=1, strokeDashArray=[3,2]))
d.add(Polygon([long_x+15, levels[0][0]+11, long_x+10, levels[0][0]+17, long_x+20, levels[0][0]+17],
fillColor=C_RED, strokeColor=C_RED))
d.add(String(long_x+17, H-150, 'LONG\nLOOP\n(−)', fontSize=6.5, fillColor=C_RED, fontName='Helvetica-Bold'))
# Short loop (pituitary back to hypothalamus)
short_x = bx - 18
d.add(Line(bx, levels[1][0]+11, short_x, levels[1][0]+11, strokeColor=C_RED, strokeWidth=1, strokeDashArray=[2,2]))
d.add(Line(short_x, levels[1][0]+11, short_x, levels[0][0]+11, strokeColor=C_RED, strokeWidth=1, strokeDashArray=[2,2]))
d.add(Polygon([short_x, levels[0][0]+11, short_x-4, levels[0][0]+6, short_x+4, levels[0][0]+6],
fillColor=C_RED, strokeColor=C_RED))
d.add(String(short_x-38, H-80, 'SHORT\nLOOP\n(−)', fontSize=6.5, fillColor=C_RED, fontName='Helvetica-Bold'))
# Ultra short (hypothalamus back to itself)
us_x = bx - 38
d.add(Line(bx, levels[0][0]+18, us_x, levels[0][0]+18, strokeColor=HexColor("#8E44AD"), strokeWidth=1, strokeDashArray=[2,2]))
d.add(Line(us_x, levels[0][0]+18, us_x, levels[0][0]+8, strokeColor=HexColor("#8E44AD"), strokeWidth=1, strokeDashArray=[2,2]))
d.add(Polygon([us_x, levels[0][0]+8, us_x-3, levels[0][0]+14, us_x+3, levels[0][0]+14],
fillColor=HexColor("#8E44AD"), strokeColor=HexColor("#8E44AD")))
d.add(String(us_x-2, levels[0][0]-6, 'Ultra-\nshort', fontSize=6, fillColor=HexColor("#8E44AD"), fontName='Helvetica-Bold'))
# Legend
ly = 30
d.add(String(20, ly+16, 'Legend:', fontSize=7.5, fillColor=C_HEADER, fontName='Helvetica-Bold'))
d.add(Line(20, ly+5, 50, ly+5, strokeColor=C_FLOW_ARROW, strokeWidth=1.5))
d.add(String(55, ly+1, 'Stimulation (+)', fontSize=7, fillColor=C_FLOW_ARROW))
d.add(Line(20, ly-8, 50, ly-8, strokeColor=C_RED, strokeWidth=1.2, strokeDashArray=[3,2]))
d.add(String(55, ly-12, 'Inhibition (−) — Negative Feedback', fontSize=7, fillColor=C_RED))
# Right panel: Key statements
rx = 240
d.add(Rect(rx, 20, 200, H-40, rx=6, ry=6, fillColor=C_BOX_BG, strokeColor=C_BOX_BORDER, strokeWidth=1))
d.add(String(rx+100, H-35, 'Types of Feedback', textAnchor='middle',
fontSize=8.5, fillColor=C_HEADER, fontName='Helvetica-Bold'))
entries = [
('LONG LOOP (−)', C_RED,
'Target hormone feeds back to\nhypothalamus AND pituitary.\nMost common type.\nE.g., Cortisol inhibits CRH + ACTH'),
('SHORT LOOP (−)', HexColor("#E74C3C"),
'Anterior pituitary hormone\nfeeds back to inhibit\nhypothalamic releasing hormone.\nE.g., GH inhibits GHRH'),
('ULTRA-SHORT LOOP (−)', HexColor("#8E44AD"),
'Hypothalamic hormone inhibits\nits own secretion.\nE.g., GHRH inhibits GHRH'),
('POSITIVE FEEDBACK (+)', C_GREEN,
'Hormone stimulates more of\nits own secretion.\nRARE. Example: Oestrogen\nLH surge before ovulation'),
]
ey = H - 60
for title, color, desc in entries:
d.add(String(rx+10, ey, title, fontSize=7.5, fillColor=color, fontName='Helvetica-Bold'))
ey -= 12
for ln in desc.split('\n'):
d.add(String(rx+15, ey, ln, fontSize=6.8, fillColor=C_HEADER))
ey -= 10
ey -= 6
return d
# ─── FLOWCHART 4: ACTH / HPA AXIS ─────────────────────────────────
def draw_hpa_axis():
W, H = 380, 290
d = Drawing(W, H)
d.add(Rect(0, 0, W, H, fillColor=HexColor("#FDFBF5"), strokeColor=C_SUBHDR, strokeWidth=0.5))
d.add(String(W/2, H-14, "HPA Axis: Regulation of ACTH Secretion",
textAnchor='middle', fontSize=8.5, fillColor=C_HEADER, fontName='Helvetica-Bold'))
cx = W//2
# Stress box
flow_text_box(d, cx-65, H-48, 130, 22, 'STRESS / Cytokines / Hypoglycaemia',
bg=HexColor("#FDEDEC"), text_color=C_RED, font_size=7.5, bold=True)
arrow_down(d, cx, H-48, 22, label='')
d.add(String(cx+5, H-62, '(+)', fontSize=7.5, fillColor=C_GREEN, fontName='Helvetica-Bold'))
flow_text_box(d, cx-60, H-95, 120, 22, 'HYPOTHALAMUS\nCRH + AVP (synergy)',
bg=C_HEADER, text_color=white, font_size=8, bold=True)
arrow_down(d, cx, H-95, 22)
d.add(String(cx+5, H-110, 'CRH(+)\nAVP(+)', fontSize=7, fillColor=C_GREEN, fontName='Helvetica-Bold'))
flow_text_box(d, cx-60, H-142, 120, 22, 'ANTERIOR PITUITARY\n(Corticotropes)',
bg=HexColor("#2E6DA4"), text_color=white, font_size=8, bold=True)
arrow_down(d, cx, H-142, 22)
d.add(String(cx+5, H-156, 'ACTH', fontSize=8, fillColor=C_SUBHDR, fontName='Helvetica-Bold'))
flow_text_box(d, cx-60, H-189, 120, 22, 'ADRENAL CORTEX\n(Zona Fasciculata)',
bg=HexColor("#D5F5E3"), text_color=C_GREEN, font_size=8, bold=True)
arrow_down(d, cx, H-189, 22)
d.add(String(cx+5, H-203, 'CORTISOL', fontSize=8, fillColor=C_SUBHDR, fontName='Helvetica-Bold'))
flow_text_box(d, cx-60, H-236, 120, 22, 'TARGET TISSUES\n(Metabolic effects)',
bg=C_GOLD, text_color=C_HEADER, font_size=8, bold=True)
# Negative feedback arrow (cortisol back)
fb_x = cx + 75
d.add(Line(cx+60, H-225, fb_x, H-225, strokeColor=C_RED, strokeWidth=1.2, strokeDashArray=[3,2]))
d.add(Line(fb_x, H-225, fb_x, H-80, strokeColor=C_RED, strokeWidth=1.2, strokeDashArray=[3,2]))
d.add(Polygon([fb_x, H-80, fb_x-4, H-87, fb_x+4, H-87], fillColor=C_RED, strokeColor=C_RED))
d.add(String(fb_x+3, H-155, '(−)\nNegative\nFeedback\n(Cortisol)', fontSize=6.5,
fillColor=C_RED, fontName='Helvetica-Bold'))
# Diurnal rhythm note
d.add(Rect(10, 10, 155, 40, rx=4, ry=4, fillColor=C_BOX_BG, strokeColor=C_BOX_BORDER, strokeWidth=0.8))
d.add(String(14, 38, '⏰ Diurnal Rhythm of ACTH:', fontSize=7.5, fillColor=C_HEADER, fontName='Helvetica-Bold'))
d.add(String(14, 26, 'Peak: 6–8 AM (early morning)', fontSize=7, fillColor=C_HEADER))
d.add(String(14, 14, 'Trough: ~Midnight', fontSize=7, fillColor=C_HEADER))
# POMC note
d.add(Rect(W-165, 10, 155, 40, rx=4, ry=4, fillColor=C_CLINICAL, strokeColor=C_CLIN_BDR, strokeWidth=0.8))
d.add(String(W-161, 38, 'POMC → ACTH + β-LPH', fontSize=7.5, fillColor=C_RED, fontName='Helvetica-Bold'))
d.add(String(W-161, 26, 'β-LPH → β-Endorphin', fontSize=7, fillColor=C_RED))
d.add(String(W-161, 14, 'ACTH → MSH (pigmentation)', fontSize=7, fillColor=C_RED))
return d
# ─── FLOWCHART 5: PROLACTIN REGULATION ───────────────────────────
def draw_prolactin_regulation():
W, H = 400, 260
d = Drawing(W, H)
d.add(Rect(0, 0, W, H, fillColor=HexColor("#FFF8F8"), strokeColor=C_SUBHDR, strokeWidth=0.5))
d.add(String(W/2, H-14, "Regulation of Prolactin Secretion",
textAnchor='middle', fontSize=8.5, fillColor=C_HEADER, fontName='Helvetica-Bold'))
cx = 200
# Suckling reflex
flow_text_box(d, cx-80, H-46, 80, 22, 'SUCKLING\nREFLEX',
bg=HexColor("#FFF3E0"), text_color=HexColor("#E65100"), font_size=8, bold=True)
flow_text_box(d, cx+10, H-46, 80, 22, 'STRESS /\nOESTROGEN',
bg=HexColor("#F3E5F5"), text_color=HexColor("#6A1B9A"), font_size=8)
# Arrows to hypothalamus
d.add(Line(cx-40, H-46, cx-15, H-78, strokeColor=C_FLOW_ARROW, strokeWidth=1))
d.add(Line(cx+50, H-46, cx+15, H-78, strokeColor=C_FLOW_ARROW, strokeWidth=1))
flow_text_box(d, cx-60, H-98, 120, 22, 'HYPOTHALAMUS\n↓ Dopamine (PIH)',
bg=C_HEADER, text_color=white, font_size=8, bold=True)
arrow_down(d, cx, H-98, 22)
d.add(String(cx+5, H-114, 'PIH ↓ PRH ↑', fontSize=7.5, fillColor=C_SUBHDR))
flow_text_box(d, cx-60, H-145, 120, 22, 'ANTERIOR PITUITARY\n(Lactotropes)',
bg=HexColor("#2E6DA4"), text_color=white, font_size=8, bold=True)
arrow_down(d, cx, H-145, 22)
d.add(String(cx+5, H-160, 'PROLACTIN ↑', fontSize=8, fillColor=C_SUBHDR, fontName='Helvetica-Bold'))
flow_text_box(d, cx-60, H-192, 120, 22, 'MAMMARY GLANDS\n→ Milk Synthesis',
bg=HexColor("#D5F5E3"), text_color=C_GREEN, font_size=8, bold=True)
# Dopamine inhibition arrow (from hypothalamus directly suppressing)
inh_x = cx - 90
d.add(Rect(inh_x-60, H-135, 55, 28, rx=4, ry=4, fillColor=HexColor("#FDEDEC"),
strokeColor=C_RED, strokeWidth=1))
d.add(String(inh_x-32, H-114, 'DOPAMINE', fontSize=7.5, textAnchor='middle',
fillColor=C_RED, fontName='Helvetica-Bold'))
d.add(String(inh_x-32, H-126, '(PIH)', fontSize=7.5, textAnchor='middle', fillColor=C_RED))
d.add(Line(inh_x-5, H-121, cx-60, H-133, strokeColor=C_RED, strokeWidth=1.2,
strokeDashArray=[3,2]))
d.add(String(inh_x+5, H-118, '(−)', fontSize=8, fillColor=C_RED, fontName='Helvetica-Bold'))
# Key note
d.add(Rect(10, 10, 180, 28, rx=4, ry=4, fillColor=C_BOX_BG, strokeColor=C_BOX_BORDER))
d.add(String(14, 28, '⭐ Unique: ONLY anterior pituitary', fontSize=7, fillColor=C_HEADER, fontName='Helvetica-Bold'))
d.add(String(14, 17, 'hormone under DOMINANT inhibitory\ncontrol (Dopamine/PIH)', fontSize=7, fillColor=C_HEADER))
# Amenorrhoea note
d.add(Rect(W-180, 10, 170, 28, rx=4, ry=4, fillColor=C_CLINICAL, strokeColor=C_CLIN_BDR))
d.add(String(W-176, 28, '↑ PRL → inhibits GnRH', fontSize=7, fillColor=C_RED, fontName='Helvetica-Bold'))
d.add(String(W-176, 17, '→ Lactational Amenorrhoea\n(physiological contraception)', fontSize=7, fillColor=C_RED))
return d
# ─── FLOWCHART 6: GNRH / GONADOTROPINS ───────────────────────────
def draw_gonadotropins():
W, H = 460, 280
d = Drawing(W, H)
d.add(Rect(0, 0, W, H, fillColor=HexColor("#F9F4FF"), strokeColor=C_SUBHDR, strokeWidth=0.5))
d.add(String(W/2, H-14, "Regulation of FSH and LH (Gonadotropins)",
textAnchor='middle', fontSize=8.5, fillColor=C_HEADER, fontName='Helvetica-Bold'))
cx = W//2
flow_text_box(d, cx-65, H-48, 130, 22, 'HYPOTHALAMUS\n(GnRH — PULSATILE)',
bg=C_HEADER, text_color=white, font_size=8.5, bold=True)
arrow_down(d, cx, H-48, 22)
d.add(String(cx+5, H-63, 'GnRH (+)', fontSize=7.5, fillColor=C_GREEN, fontName='Helvetica-Bold'))
flow_text_box(d, cx-65, H-95, 130, 22, 'ANTERIOR PITUITARY\n(Gonadotropes)',
bg=HexColor("#2E6DA4"), text_color=white, font_size=8.5, bold=True)
# Two arrows - LH and FSH
lh_x, fsh_x = cx - 60, cx + 30
d.add(Line(cx, H-95, lh_x+25, H-125, strokeColor=C_FLOW_ARROW, strokeWidth=1))
d.add(Line(cx, H-95, fsh_x+25, H-125, strokeColor=C_FLOW_ARROW, strokeWidth=1))
flow_text_box(d, lh_x-15, H-147, 80, 22, 'LH', bg=HexColor("#FDEDEC"),
text_color=C_RED, font_size=10, bold=True)
flow_text_box(d, fsh_x, H-147, 80, 22, 'FSH', bg=HexColor("#D6EAF8"),
text_color=C_SUBHDR, font_size=10, bold=True)
# LH targets
d.add(Line(lh_x+25, H-147, lh_x-5, H-178, strokeColor=C_FLOW_ARROW, strokeWidth=0.8))
d.add(Line(lh_x+25, H-147, lh_x+55, H-178, strokeColor=C_FLOW_ARROW, strokeWidth=0.8))
flow_text_box(d, lh_x-45, H-205, 75, 28, 'OVULATION\n(LH Surge)\nCorpus Luteum',
bg=HexColor("#FCF3CF"), text_color=HexColor("#9A7D0A"), font_size=7)
flow_text_box(d, lh_x+20, H-205, 75, 28, 'LEYDIG CELLS\n→ Testosterone',
bg=HexColor("#D5F5E3"), text_color=C_GREEN, font_size=7)
# FSH targets
d.add(Line(fsh_x+40, H-147, fsh_x+10, H-178, strokeColor=C_FLOW_ARROW, strokeWidth=0.8))
d.add(Line(fsh_x+40, H-147, fsh_x+70, H-178, strokeColor=C_FLOW_ARROW, strokeWidth=0.8))
flow_text_box(d, fsh_x-20, H-205, 75, 28, 'FOLLICULAR\nDev. + Oestrogen\n(Aromatase)',
bg=HexColor("#F4ECF7"), text_color=HexColor("#6C3483"), font_size=7)
flow_text_box(d, fsh_x+60, H-205, 75, 28, 'SERTOLI CELLS\n→ Sperm.\n+ Inhibin',
bg=HexColor("#D6EAF8"), text_color=C_SUBHDR, font_size=7)
# Negative feedback
fb_x = W - 30
d.add(Line(W-60, H-191, fb_x, H-191, strokeColor=C_RED, strokeWidth=1, strokeDashArray=[3,2]))
d.add(Line(fb_x, H-191, fb_x, H-33, strokeColor=C_RED, strokeWidth=1, strokeDashArray=[3,2]))
d.add(Polygon([fb_x, H-33, fb_x-4, H-40, fb_x+4, H-40], fillColor=C_RED, strokeColor=C_RED))
d.add(String(fb_x-28, H-110, '(−)\nSex\nSteroids\nInhibin\n(FSH only)', fontSize=6.5,
fillColor=C_RED, fontName='Helvetica-Bold'))
# Positive feedback box
d.add(Rect(8, H-220, 130, 36, rx=4, ry=4, fillColor=HexColor("#E8F8F5"),
strokeColor=C_GREEN, strokeWidth=1.2))
d.add(String(12, H-192, '⭐ EXCEPTION — Positive Feedback:', fontSize=7, fillColor=C_GREEN, fontName='Helvetica-Bold'))
d.add(String(12, H-202, 'High sustained Oestrogen →', fontSize=7, fillColor=C_HEADER))
d.add(String(12, H-212, '(+) feedback → LH SURGE → Ovulation', fontSize=7, fillColor=C_HEADER))
# Pulsatile note
d.add(Rect(8, H-260, 130, 34, rx=4, ry=4, fillColor=C_BOX_BG,
strokeColor=C_BOX_BORDER, strokeWidth=1))
d.add(String(12, H-232, '⭐ GnRH must be PULSATILE:', fontSize=7, fillColor=C_HEADER, fontName='Helvetica-Bold'))
d.add(String(12, H-242, 'Continuous GnRH → receptor', fontSize=7, fillColor=C_HEADER))
d.add(String(12, H-252, 'downregulation → ↓ FSH/LH', fontSize=7, fillColor=C_HEADER))
return d
# ─── FLOWCHART WRAPPER ────────────────────────────────────────────
class DrawingFlowable(Flowable):
def __init__(self, drawing, caption=''):
self.drawing = drawing
self.caption_text = caption
self._width = drawing.width
self._height = drawing.height + (14 if caption else 0)
def wrap(self, availWidth, availHeight):
return self._width, self._height
def draw(self):
self.drawing.drawOn(self.canv, 0, 14 if self.caption_text else 0)
if self.caption_text:
self.canv.setFont('Helvetica-Oblique', 7.5)
self.canv.setFillColor(C_SUBHDR)
self.canv.drawCentredString(self._width/2, 2, self.caption_text)
# ─── HEADER / FOOTER ─────────────────────────────────────────────
def on_page(canvas, doc):
canvas.saveState()
w, h = A4
# Header bar
canvas.setFillColor(C_HEADER)
canvas.rect(0, h-28, w, 28, fill=1, stroke=0)
canvas.setFont('Helvetica-Bold', 10)
canvas.setFillColor(white)
canvas.drawCentredString(w/2, h-18, "ANTERIOR PITUITARY HORMONES — COMPREHENSIVE STUDY GUIDE")
canvas.setFont('Helvetica', 8)
canvas.drawRightString(w-20, h-18, "Indu Khurana Style")
# Footer
canvas.setFillColor(C_SUBHDR)
canvas.rect(0, 0, w, 18, fill=1, stroke=0)
canvas.setFont('Helvetica', 7.5)
canvas.setFillColor(white)
canvas.drawCentredString(w/2, 5, f"Page {doc.page} | Based on Indu Khurana — Textbook of Medical Physiology | Section VIII.2")
canvas.restoreState()
# ─── BUILD PDF ────────────────────────────────────────────────────
def build_pdf(path):
doc = SimpleDocTemplate(
path,
pagesize=A4,
leftMargin=1.8*cm, rightMargin=1.8*cm,
topMargin=1.5*cm, bottomMargin=1.5*cm,
title="Anterior Pituitary Hormones Study Guide",
author="Medical Study Guide — Indu Khurana Style",
subject="Endocrinology — Anterior Pituitary"
)
story = []
W = PAGE_W - 3.6*cm # usable width
# ── COVER ──────────────────────────────────────────────────────
story.append(Spacer(1, 0.8*cm))
story.append(Paragraph("ANTERIOR PITUITARY HORMONES", ST_TITLE))
story.append(Paragraph("Their Actions and Regulation", ST_SUBTITLE))
story.append(Paragraph("A Comprehensive 10-Mark Study Guide", make_style('cov3',
fontSize=11, textColor=C_GOLD, fontName='Helvetica-BoldOblique', alignment=TA_CENTER)))
story.append(Spacer(1, 0.3*cm))
cover_data = [[
Paragraph("<b>Reference:</b> Indu Khurana — <i>Textbook of Medical Physiology</i><br/>"
"Section VIII.2: Endocrinal Functions of Hypothalamus & Pituitary Gland", ST_BODY),
Paragraph("<b>Also covers:</b> Ganong's Review of Medical Physiology 26E,<br/>"
"Costanzo Physiology 7E, Harrison's Principles of Internal Medicine 22E", ST_BODY)
]]
ct = Table(cover_data, colWidths=[W*0.5, W*0.5])
ct.setStyle(TableStyle([
('BOX', (0,0), (-1,-1), 1, C_SUBHDR),
('INNERGRID', (0,0), (-1,-1), 0.5, colors.lightgrey),
('BACKGROUND', (0,0), (-1,-1), C_ACCENT),
('TOPPADDING', (0,0), (-1,-1), 6),
('BOTTOMPADDING', (0,0), (-1,-1), 6),
('LEFTPADDING', (0,0), (-1,-1), 8),
]))
story.append(ct)
story.append(sp(8))
story.append(mnemonic_box("🧠 MNEMONIC — \"FLAT PG\" | FSH · LH · ACTH · TSH · Prolactin · GH"))
story.append(sp(8))
# Master flowchart
story.append(DrawingFlowable(draw_master_axis_flowchart(),
"Fig. VIII.2-3: Hypothalamus – Anterior Pituitary – Target Glands (Master Axis)"))
story.append(sp(10))
# ── CELL TYPES TABLE ──────────────────────────────────────────
story.append(section_heading("A. CELL TYPES OF THE ANTERIOR PITUITARY"))
story.append(sp(4))
ct_headers = ["Cell Type", "Hormone Secreted", "Approx. %", "Tissue-Specific\nTranscription Factor"]
ct_rows = [
["Somatotropes", "Growth Hormone (GH)", "~50%", "Pit-1, Prop-1"],
["Corticotropes", "ACTH + β-LPH (from POMC)", "~20%", "T-Pit"],
["Lactotropes", "Prolactin (PRL)", "~15–20%", "Pit-1, Prop-1"],
["Thyrotropes", "TSH", "~5%", "Pit-1, Prop-1, TEF"],
["Gonadotropes", "FSH + LH", "~10%", "SF-1, DAX-1"],
]
story.append(make_table(ct_headers, ct_rows,
[W*0.22, W*0.32, W*0.14, W*0.32]))
story.append(sp(6))
# ── HYPOTHALAMIC HORMONES TABLE ──────────────────────────────
story.append(section_heading("B. HYPOTHALAMIC (HYPOPHYSIOTROPIC) HORMONES"))
story.append(sp(4))
hh_headers = ["Hypothalamic Hormone", "Abbrev.", "Effect", "Anterior Pituitary Hormone"]
hh_rows = [
["Corticotropin-releasing hormone", "CRH", "↑ Stimulates", "ACTH + β-LPH"],
["Thyrotropin-releasing hormone", "TRH", "↑ Stimulates", "TSH (also PRL)"],
["Gonadotropin-releasing hormone", "GnRH", "↑ Stimulates", "LH + FSH"],
["GH-releasing hormone", "GHRH", "↑ Stimulates", "GH"],
["GH release-inhibiting hormone (Somatostatin)", "GRIH", "↓ Inhibits", "GH (also TSH)"],
["Prolactin-inhibiting hormone (= Dopamine)", "PIH", "↓ Inhibits", "Prolactin"],
["Prolactin-releasing hormone", "PRH (TRH/VIP)", "↑ Stimulates", "Prolactin"],
]
story.append(make_table(hh_headers, hh_rows,
[W*0.37, W*0.12, W*0.16, W*0.35]))
story.append(key_statement(
"Anterior pituitary secretion is controlled by chemical agents (hypophysiotropic hormones) "
"carried in portal hypophyseal vessels from hypothalamus to pituitary. "
"The predominant hypothalamic effect is STIMULATORY — except for Prolactin where it is INHIBITORY."))
story.append(sp(6))
# ── PAGE BREAK ───────────────────────────────────────────────
story.append(PageBreak())
# ─── 1. GROWTH HORMONE ────────────────────────────────────────
story.append(section_heading("I. GROWTH HORMONE (GH) / SOMATOTROPIN"))
story.append(sp(4))
gh_basic = [
["Chemical Nature", "Polypeptide — 191 amino acids, single chain"],
["Secreted by", "Somatotropes (most abundant cell, ~50%)"],
["Plasma Half-life", "~20 minutes"],
["Receptor type", "Cell-surface receptor → JAK-STAT pathway"],
["Secretion pattern", "Pulsatile; major pulse during Stage III–IV NREM (slow-wave) sleep"],
]
bt = Table([[Paragraph(r[0], make_style('bk', fontSize=8.5, fontName='Helvetica-Bold', textColor=C_HEADER)),
Paragraph(r[1], ST_TD)] for r in gh_basic],
colWidths=[W*0.28, W*0.72])
bt.setStyle(TableStyle([
('GRID', (0,0), (-1,-1), 0.4, colors.lightgrey),
('BACKGROUND', (0,0), (0,-1), C_ACCENT),
('TOPPADDING', (0,0), (-1,-1), 3),
('BOTTOMPADDING', (0,0), (-1,-1), 3),
('LEFTPADDING', (0,0), (-1,-1), 5),
]))
story.append(bt)
story.append(sp(6))
story.append(subsection_heading("A. Actions of Growth Hormone:"))
story.append(sp(3))
gh_actions_headers = ["System", "Direct (Anti-insulin / Diabetogenic)", "Indirect (via IGF-1)"]
gh_actions_rows = [
["Protein", "↑ Amino acid uptake, ↑ Protein synthesis (anabolic)", "↑ Cell proliferation, organ growth"],
["Carbohydrate", "↓ Glucose uptake by cells → ↑ Blood glucose (DIABETOGENIC)", "—"],
["Fat", "↑ Lipolysis → ↑ Free fatty acids in blood", "—"],
["Bone/Cartilage", "—", "↑ Chondrogenesis at epiphyseal plates → Linear growth"],
["Mineral", "Retains Na⁺, K⁺, Ca²⁺, Cl⁻, Phosphate", "↑ Intestinal Ca²⁺ absorption"],
["Organ", "—", "Visceromegaly (liver, spleen, kidney)"],
]
story.append(make_table(gh_actions_headers, gh_actions_rows,
[W*0.15, W*0.47, W*0.38]))
story.append(sp(4))
story.append(key_statement(
'"GH has both INSULIN-LIKE (anabolic, via IGF-1) and ANTI-INSULIN (diabetogenic, direct) effects." — Indu Khurana'))
story.append(sp(6))
story.append(subsection_heading("B. Regulation of GH Secretion:"))
story.append(sp(3))
story.append(DrawingFlowable(draw_gh_regulation(),
"Fig. VIII.2-4: Control of Growth Hormone Secretion (Khurana)"))
story.append(sp(4))
reg_headers = ["Stimulators of GH ↑", "Inhibitors of GH ↓"]
reg_rows = [
["GHRH (hypothalamus) — main stimulator", "Somatostatin / GRIH (hypothalamus) — main inhibitor"],
["Ghrelin (from stomach)", "IGF-1 / Somatomedins (negative feedback)"],
["Hypoglycaemia (↓ blood glucose)", "Hyperglycaemia (↑ blood glucose)"],
["Exercise, physical stress", "Obesity / elevated free fatty acids"],
["Slow-wave NREM sleep (Stages III–IV)", "Glucocorticoids (chronic excess)"],
["Amino acids (arginine, leucine)", "Hypothyroidism"],
["Oestrogen, testosterone", "GH itself (short-loop feedback)"],
["Starvation / protein deficiency", "REM sleep"],
]
rt = make_table(reg_headers, reg_rows, [W*0.5, W*0.5])
story.append(rt)
story.append(sp(4))
story.append(clinical_box([
"Excess GH BEFORE puberty (epiphyses open) → GIGANTISM — tall stature",
"Excess GH AFTER puberty (epiphyses fused) → ACROMEGALY — coarse facial features, prognathism, large hands/feet",
"GH deficiency in childhood → PITUITARY DWARFISM — proportionate short stature, normal intelligence",
"GH excess causes SECONDARY DIABETES MELLITUS (diabetogenic effect)",
]))
story.append(sp(8))
# ─── 2. TSH ───────────────────────────────────────────────────
story.append(section_heading("II. THYROID-STIMULATING HORMONE (TSH) / THYROTROPIN"))
story.append(sp(4))
story.append(Paragraph(
"<b>Chemical Nature:</b> Glycoprotein — shared <b>α-subunit</b> (with FSH, LH, hCG) + unique <b>β-subunit</b> "
"(determines biological activity). 211 amino acids. Secreted by <b>Thyrotropes</b>.", ST_BODY))
story.append(sp(4))
tsh_actions = [
["1", "Stimulates ALL steps of thyroid hormone synthesis: iodine uptake, iodination, coupling, release of T₃ and T₄"],
["2", "Causes HYPERTROPHY and HYPERPLASIA of thyroid follicular cells"],
["3", "Increases VASCULARITY of thyroid gland"],
["4", "Increases overall THYROID GLAND WEIGHT (goitrogenic effect with chronic excess)"],
["5", "Activates adenylyl cyclase (cAMP) in thyroid cells"],
]
at = Table([[Paragraph(r[0], make_style('num', fontSize=9, fontName='Helvetica-Bold',
textColor=white, alignment=TA_CENTER)),
Paragraph(r[1], ST_TD)] for r in tsh_actions],
colWidths=[W*0.06, W*0.94])
at.setStyle(TableStyle([
('BACKGROUND', (0,0), (0,-1), C_SUBHDR),
('GRID', (0,0), (-1,-1), 0.4, colors.lightgrey),
('TOPPADDING', (0,0), (-1,-1), 4),
('BOTTOMPADDING', (0,0), (-1,-1), 4),
('LEFTPADDING', (0,0), (-1,-1), 5),
('VALIGN', (0,0), (-1,-1), 'MIDDLE'),
]))
story.append(at)
story.append(sp(4))
tsh_reg_headers = ["Stimulators of TSH ↑", "Inhibitors of TSH ↓"]
tsh_reg_rows = [
["TRH (from hypothalamus) — main", "T₃/T₄ — main (negative long-loop feedback)"],
["Cold exposure (reflex via hypothalamus)", "Somatostatin"],
["Low thyroid hormone levels", "Dopamine"],
["", "Glucocorticoids"],
]
story.append(make_table(tsh_reg_headers, tsh_reg_rows, [W*0.5, W*0.5]))
story.append(sp(4))
story.append(key_statement(
'"T₃ (more potent) and T₄ exert negative feedback at BOTH the hypothalamic (↓TRH) and '
'pituitary (↓TSH) levels — long-loop negative feedback." — Indu Khurana'))
story.append(sp(8))
# ─── PAGE BREAK ──────────────────────────────────────────────
story.append(PageBreak())
# ─── 3. ACTH ─────────────────────────────────────────────────
story.append(section_heading("III. ADRENOCORTICOTROPIC HORMONE (ACTH) / CORTICOTROPIN"))
story.append(sp(4))
story.append(Paragraph(
"<b>Chemical Nature:</b> Polypeptide — <b>39 amino acids</b>. Secreted by <b>Corticotropes</b>. "
"Derived from large precursor <b>POMC (Pro-opiomelanocortin)</b> — 266 amino acids.", ST_BODY))
story.append(sp(4))
story.append(subsection_heading("A. POMC Processing — Khurana Key Diagram:"))
story.append(sp(3))
pomc_data = [
[Paragraph("<b>POMC</b>\n(266 AA)", make_style('pc', fontSize=9, alignment=TA_CENTER, fontName='Helvetica-Bold')),
Paragraph("→", make_style('arr', fontSize=14, alignment=TA_CENTER)),
Paragraph("<b>ACTH (1–39)</b>\n↓ MSH + CLIP", make_style('pc2', fontSize=8.5, alignment=TA_CENTER, fontName='Helvetica-Bold', textColor=C_RED)),
Paragraph("+", make_style('plus', fontSize=12, alignment=TA_CENTER)),
Paragraph("<b>β-Lipotropin (β-LPH)</b>\n↓ γ-LPH + β-Endorphin", make_style('pc3', fontSize=8.5, alignment=TA_CENTER, fontName='Helvetica-Bold', textColor=C_SUBHDR))],
]
pt = Table(pomc_data, colWidths=[W*0.18, W*0.06, W*0.26, W*0.06, W*0.44])
pt.setStyle(TableStyle([
('BACKGROUND', (0,0), (0,0), C_ACCENT),
('BACKGROUND', (2,0), (2,0), HexColor("#FDEDEC")),
('BACKGROUND', (4,0), (4,0), HexColor("#D6EAF8")),
('BOX', (0,0), (-1,-1), 1, C_SUBHDR),
('VALIGN', (0,0), (-1,-1), 'MIDDLE'),
('TOPPADDING', (0,0), (-1,-1), 8),
('BOTTOMPADDING', (0,0), (-1,-1), 8),
('LEFTPADDING', (0,0), (-1,-1), 5),
]))
story.append(pt)
story.append(sp(4))
story.append(key_statement(
'"ACTH, MSH, β-LPH and β-endorphin are ALL derived from the same precursor molecule POMC. '
'This explains why Addison\'s disease (↑ACTH) causes skin hyperpigmentation (MSH-like effect)."'))
story.append(sp(4))
story.append(subsection_heading("B. Actions of ACTH:"))
story.append(sp(3))
acth_rows = [
["Adrenal cortex (main)", "Stimulates synthesis & secretion of GLUCOCORTICOIDS (cortisol) — main action"],
["Adrenal cortex", "Stimulates MINERALOCORTICOIDS (aldosterone) — minor/permissive role"],
["Adrenal cortex", "Stimulates ADRENAL ANDROGENS (DHEA, androstenedione)"],
["Adrenal cortex (trophic)", "Maintains ADRENAL CORTEX SIZE & vascularity (adrenal atrophy without ACTH)"],
["Melanocytes", "High ACTH stimulates melanocytes → SKIN PIGMENTATION (MSH-like)"],
["Adipose tissue", "Promotes LIPOLYSIS (extra-adrenal action)"],
]
story.append(make_table(["Target", "Action of ACTH"], acth_rows, [W*0.25, W*0.75]))
story.append(sp(4))
story.append(subsection_heading("C. Regulation of ACTH (HPA Axis):"))
story.append(sp(3))
story.append(DrawingFlowable(draw_hpa_axis(), "HPA Axis: CRH → ACTH → Cortisol (with negative feedback)"))
story.append(sp(4))
story.append(clinical_box([
"ACTH shows DIURNAL RHYTHM — Peak: 6–8 AM | Trough: ~Midnight",
"Prolonged exogenous glucocorticoids → ↓ ACTH → Adrenal cortex ATROPHY",
"Cushing's syndrome (excess cortisol): moon face, central obesity, purple striae, hypertension",
"Addison's disease (cortisol deficiency): ↑ ACTH → skin hyperpigmentation (MSH effect), hypotension",
"Nelson's syndrome: Post-adrenalectomy → loss of cortisol feedback → massive ↑ ACTH → hyperpigmentation",
]))
story.append(sp(8))
# ─── PAGE BREAK ──────────────────────────────────────────────
story.append(PageBreak())
# ─── 4. PROLACTIN ─────────────────────────────────────────────
story.append(section_heading("IV. PROLACTIN (PRL)"))
story.append(sp(4))
story.append(Paragraph(
"<b>Chemical Nature:</b> Polypeptide — <b>198 amino acids</b>. Structurally similar to GH. "
"Secreted by <b>Lactotropes</b>. Plasma half-life ~20 min.", ST_BODY))
story.append(sp(4))
prl_rows = [
["1. Lactation (main)", "Initiates and maintains milk synthesis (casein, lactalbumin) in mammary alveolar cells"],
["2. Mammary gland growth", "Promotes lobulo-alveolar development (synergistic with oestrogen + progesterone)"],
["3. Inhibits GnRH", "↑ PRL → suppresses GnRH → ↓ LH/FSH → suppresses ovulation → LACTATIONAL AMENORRHOEA"],
["4. Immunomodulation", "Immunostimulatory role; PRL receptors on lymphocytes"],
["5. Luteotrophic", "Maintains corpus luteum in some species (less important in humans)"],
]
story.append(make_table(["Action", "Details"], prl_rows, [W*0.25, W*0.75]))
story.append(sp(4))
story.append(key_statement(
'"PROLACTIN is the ONLY anterior pituitary hormone whose predominant hypothalamic control is '
'INHIBITORY (via dopamine/PIH). Dopamine tonically suppresses prolactin secretion." — Indu Khurana'))
story.append(sp(4))
story.append(DrawingFlowable(draw_prolactin_regulation(), "Regulation of Prolactin Secretion (Suckling Reflex → ↓ Dopamine → ↑ PRL)"))
story.append(sp(4))
prl_reg_headers = ["Stimulators of PRL ↑", "Inhibitors of PRL ↓"]
prl_reg_rows = [
["Suckling reflex — most potent physiological", "Dopamine / PIH — main (tonic inhibition)"],
["TRH (from hypothalamus)", "—"],
["Oestrogen", "—"],
["VIP (vasoactive intestinal peptide)", "—"],
["Stress (physical/emotional)", "—"],
["Hypothyroidism (↑TRH → ↑PRL)", "—"],
["Antipsychotics (block dopamine D2)", "—"],
]
story.append(make_table(prl_reg_headers, prl_reg_rows, [W*0.5, W*0.5]))
story.append(sp(4))
story.append(clinical_box([
"Hyperprolactinaemia → GALACTORRHOEA + AMENORRHOEA (in women); ↓ libido + erectile dysfunction (in men)",
"Most common cause: PROLACTINOMA (most common secreting pituitary adenoma)",
"Other causes: antipsychotics (chlorpromazine, haloperidol), metoclopramide, hypothyroidism, renal failure",
"Treatment: DOPAMINE AGONISTS — Bromocriptine, Cabergoline (↓ PRL, shrink adenoma)",
]))
story.append(sp(8))
# ─── PAGE BREAK ──────────────────────────────────────────────
story.append(PageBreak())
# ─── 5. FSH AND LH ───────────────────────────────────────────
story.append(section_heading("V. GONADOTROPINS: FSH & LH"))
story.append(sp(4))
story.append(Paragraph(
"<b>Chemical Nature:</b> Both are <b>glycoproteins</b> with a SHARED <b>α-subunit</b> "
"(same as TSH and hCG) + unique <b>β-subunit</b> (confers biological specificity). "
"Secreted by <b>Gonadotropes</b>.", ST_BODY))
story.append(sp(4))
story.append(subsection_heading("A. Actions of FSH and LH:"))
story.append(sp(3))
gon_headers = ["", "FSH", "LH"]
gon_rows = [
["TARGET (Females)", "Granulosa cells of ovarian follicle", "Theca cells + corpus luteum"],
["ACTION (Females)", "Stimulates follicular development; ↑ aromatase → oestrogen synthesis", "LH surge triggers OVULATION; maintains corpus luteum → progesterone"],
["TARGET (Males)", "Sertoli cells (seminiferous tubules)", "Leydig cells (interstitial)"],
["ACTION (Males)", "Spermatogenesis (with testosterone); produces INHIBIN + ABP", "Testosterone synthesis (Leydig cells)"],
["Receptor", "FSH-R (Gs → ↑ cAMP)", "LH-R (Gs → ↑ cAMP → ↑ steroidogenesis)"],
]
story.append(make_table(gon_headers, gon_rows, [W*0.18, W*0.41, W*0.41]))
story.append(sp(4))
story.append(subsection_heading("B. Regulation of FSH and LH:"))
story.append(sp(3))
story.append(DrawingFlowable(draw_gonadotropins(), "Regulation of Gonadotropins — FSH, LH and Negative/Positive Feedback"))
story.append(sp(4))
gon_reg_headers = ["Stimulators ↑", "Inhibitors ↓"]
gon_reg_rows = [
["GnRH — pulsatile (main stimulator for both)", "Sex steroids: testosterone, oestrogen, progesterone"],
["Activins (from gonads)", "INHIBIN — selectively inhibits FSH only (not LH)"],
["Oestrogen: HIGH sustained level → (+) feedback → LH SURGE", "Continuous (non-pulsatile) GnRH → receptor downregulation → ↓ LH/FSH"],
["Kisspeptin → stimulates GnRH neurons", ""],
]
story.append(make_table(gon_reg_headers, gon_reg_rows, [W*0.5, W*0.5]))
story.append(sp(4))
story.append(key_statement(
'"GnRH must be secreted in a PULSATILE manner. Continuous GnRH causes paradoxical '
'DOWNREGULATION of GnRH receptors → suppression of LH and FSH — this is exploited clinically '
'(GnRH analogues for prostate cancer, endometriosis, precocious puberty)." — Indu Khurana'))
story.append(sp(4))
story.append(key_statement(
'"INHIBIN (secreted by Sertoli cells in males and granulosa cells in females) SELECTIVELY '
'INHIBITS FSH secretion without affecting LH — used as a marker of testicular/ovarian function."'))
story.append(sp(8))
# ─── PAGE BREAK ──────────────────────────────────────────────
story.append(PageBreak())
# ─── FEEDBACK LOOPS ──────────────────────────────────────────
story.append(section_heading("VI. FEEDBACK REGULATION — TYPES (Khurana Fig. VIII.1-2)"))
story.append(sp(4))
story.append(DrawingFlowable(draw_feedback_loops(), "Types of Feedback: Long-loop, Short-loop, Ultrashort-loop, and Positive feedback"))
story.append(sp(6))
fb_headers = ["Type", "Pathway", "Example"]
fb_rows = [
["Long-loop (−)", "Target gland hormone → inhibits BOTH Hypothalamus + Anterior Pituitary",
"Cortisol inhibits CRH (hypothalamus) + ACTH (pituitary)"],
["Short-loop (−)", "Anterior pituitary hormone → inhibits Hypothalamus",
"GH inhibits GHRH secretion"],
["Ultrashort-loop (−)", "Hypothalamic hormone → inhibits its OWN secretion",
"GHRH inhibits GHRH secretion"],
["Positive feedback (+)", "Target hormone stimulates more release (RARE)",
"High sustained oestrogen → (+) → LH surge → ovulation"],
]
story.append(make_table(fb_headers, fb_rows, [W*0.22, W*0.42, W*0.36]))
story.append(sp(8))
# ─── MASTER SUMMARY TABLE ────────────────────────────────────
story.append(section_heading("VII. MASTER SUMMARY TABLE (Khurana Table VIII.2-1 Style)"))
story.append(sp(4))
ms_headers = ["Hormone", "Cell/Nature", "Hypothalamic\nControl", "Main Actions", "Feedback\nInhibition", "Disorder\n(Excess / Deficiency)"]
ms_rows = [
["GH\n(Somatotropin)", "Somatotrope\n191 AA polypeptide",
"GHRH (+)\nGRIH (−)", "Linear growth (via IGF-1)\nLipolysis\n↑ Blood glucose\nProtein anabolism",
"IGF-1 (long)\nGH (short)", "Excess: Gigantism /\nAcromegaly\nDeficiency: Dwarfism"],
["TSH\n(Thyrotropin)", "Thyrotrope\nGlycoprotein α+β",
"TRH (+)\nSomatostatin (−)", "↑ T₃/T₄ synthesis\nThyroid hypertrophy\n↑ Vascularity",
"T₃/T₄ (long)", "Excess: Hyperthyroidism\nDeficiency: Hypothyroidism"],
["ACTH\n(Corticotropin)", "Corticotrope\n39 AA from POMC",
"CRH + AVP (+)\nCortisol (−)", "↑ Cortisol (main)\n↑ Adrenal androgens\nTrophic to adrenal\nSkin pigmentation",
"Cortisol (long)", "Excess: Cushing's\nDeficiency: Addison's"],
["Prolactin\n(PRL)", "Lactotrope\n198 AA polypeptide",
"Dopamine/PIH (−)\nTRH/PRH (+)", "Lactation (milk\nsynthesis)\nMammary growth\n↓ GnRH (amenorrhoea)",
"Dopamine (not\ntarget hormone)", "Excess: Prolactinoma\n→ Galactorrhoea\n+ Amenorrhoea"],
["FSH", "Gonadotrope\nGlycoprotein α+β",
"GnRH (+)\nInhibin (−)", "Folliculogenesis\nSpermatogenesis\nOestrogen (aromatase)",
"Inhibin (specific)\nOestrogen", "Excess: —\nDeficiency:\nHypogonadism"],
["LH", "Gonadotrope\nGlycoprotein α+β",
"GnRH (+)\nSex steroids (−)", "LH surge → Ovulation\nCorpus luteum\nTestosterone\n(Leydig cells)",
"Testosterone\nOestrogen\nProgesterone", "Excess: PCOS\nDeficiency:\nHypogonadism"],
]
story.append(make_table(ms_headers, ms_rows, [W*0.10, W*0.15, W*0.16, W*0.22, W*0.16, W*0.21]))
story.append(sp(8))
# ─── α-SUBUNIT TABLE ─────────────────────────────────────────
story.append(section_heading("VIII. GLYCOPROTEIN HORMONES — SHARED α-SUBUNIT"))
story.append(sp(4))
story.append(Paragraph(
"TSH, FSH, LH, and hCG all share an <b>identical α-subunit</b>. "
"Specificity is determined by their unique <b>β-subunit</b>. "
"This is why hCG can mimic TSH/LH in certain tumours (e.g., hydatidiform mole).", ST_BODY))
story.append(sp(4))
alph_headers = ["Hormone", "Shared α-subunit", "Unique β-subunit", "Source", "Clinical relevance"]
alph_rows = [
["TSH", "Yes ✓", "β-TSH", "Anterior pituitary (Thyrotropes)", "Stimulates thyroid"],
["FSH", "Yes ✓", "β-FSH", "Anterior pituitary (Gonadotropes)", "Folliculogenesis"],
["LH", "Yes ✓", "β-LH", "Anterior pituitary (Gonadotropes)", "Ovulation / Testosterone"],
["hCG", "Yes ✓", "β-hCG (unique, long half-life)", "Placental trophoblast", "Pregnancy test; can cross-react with TSH/LH receptors"],
]
story.append(make_table(alph_headers, alph_rows, [W*0.10, W*0.14, W*0.18, W*0.26, W*0.32]))
story.append(sp(8))
# ─── PAGE BREAK ──────────────────────────────────────────────
story.append(PageBreak())
# ─── CLINICAL CORRELATIONS ───────────────────────────────────
story.append(section_heading("IX. IMPORTANT CLINICAL CORRELATIONS (Khurana Applied Boxes)"))
story.append(sp(4))
cc_headers = ["Condition", "Hormone Involved", "Mechanism", "Key Features"]
cc_rows = [
["Gigantism", "↑ GH (pre-pubertal)", "↑ IGF-1 → linear bone growth (open epiphyses)", "Abnormally tall stature, large organs"],
["Acromegaly", "↑ GH (post-pubertal)", "↑ IGF-1 → periosteal bone growth (fused epiphyses)", "Coarse features, prognathism, spade hands, glucose intolerance"],
["Pituitary dwarfism", "↓ GH (childhood)", "↓ IGF-1 → ↓ linear bone growth", "Proportionate short stature, normal intelligence"],
["Cushing's disease", "↑ ACTH (pituitary adenoma)", "↑ CRH → ↑ ACTH → ↑ Cortisol", "Moon face, buffalo hump, purple striae, hypertension"],
["Addison's disease", "↓ Cortisol → ↑↑ ACTH", "Loss of adrenal tissue → ↑ MSH from POMC", "Hyperpigmentation, hypotension, hyponatraemia"],
["Nelson's syndrome", "↑↑ ACTH post-adrenalectomy", "No cortisol feedback → ACTH-secreting tumour", "Severe hyperpigmentation, visual field defects"],
["Prolactinoma", "↑ PRL", "Dopamine deficiency / tumour → ↑ PRL", "Galactorrhoea + amenorrhoea; treat with cabergoline"],
["Lactational amenorrhoea", "↑ PRL (physiological)", "↑ PRL → ↓ GnRH → ↓ LH/FSH → ↓ ovulation", "Post-partum contraception during breastfeeding"],
["Sheehan's syndrome", "All AP hormones ↓", "Post-partum pituitary infarction (hypotension)", "Panhypopituitarism, failure of lactation"],
]
story.append(make_table(cc_headers, cc_rows, [W*0.18, W*0.17, W*0.32, W*0.33]))
story.append(sp(8))
# ─── VIVA QUESTIONS ──────────────────────────────────────────
story.append(section_heading("X. VIVA QUESTIONS (Khurana Self-Assessment Style)"))
story.append(sp(4))
vivas = [
("Q1. What are the hormones of the anterior pituitary?",
"Six hormones: GH, TSH, ACTH (+ β-LPH from POMC), Prolactin, FSH, and LH."),
("Q2. Which anterior pituitary hormone is under predominantly INHIBITORY hypothalamic control?",
"PROLACTIN — inhibited by dopamine (PIH). All others are predominantly stimulated."),
("Q3. Name the precursor of ACTH. What other hormones are derived from it?",
"POMC (Pro-opiomelanocortin) → ACTH, β-LPH (which gives β-endorphin, γ-LPH), MSH, and CLIP."),
("Q4. Why does Addison's disease cause skin hyperpigmentation?",
"↓ Cortisol → loss of negative feedback → ↑↑ ACTH production (from POMC). ACTH has MSH-like activity → stimulates melanocytes → hyperpigmentation."),
("Q5. Distinguish between gigantism and acromegaly.",
"GIGANTISM: Excess GH before epiphyseal fusion (pre-pubertal) → tall stature. ACROMEGALY: Excess GH after epiphyseal fusion (post-pubertal) → coarse facial features, enlarged hands/feet, no increase in height."),
("Q6. Why does continuous GnRH suppress LH and FSH?",
"Continuous (non-pulsatile) GnRH causes DOWNREGULATION (desensitisation) of GnRH receptors on gonadotropes → paradoxical suppression of LH/FSH. Clinical use: GnRH agonists for prostate cancer, endometriosis."),
("Q7. What is the role of inhibin?",
"Inhibin (secreted by Sertoli cells in males, granulosa cells in females) SELECTIVELY inhibits FSH without affecting LH. Used as a marker of testicular/ovarian reserve."),
("Q8. Name the shared subunit among TSH, FSH, LH, and hCG.",
"All share an identical α-subunit. Biological specificity is due to their UNIQUE β-subunit."),
("Q9. What causes lactational amenorrhoea?",
"Suckling → afferent impulses → hypothalamus → ↓ Dopamine (PIH) + ↑ PRH → ↑ Prolactin → PRL inhibits GnRH → ↓ LH/FSH → suppressed ovulation (amenorrhoea)."),
("Q10. Describe the diurnal rhythm of ACTH.",
"ACTH shows a circadian rhythm: PEAK at 6–8 AM (early morning), progressively falls during the day, TROUGH at midnight. Corresponds to cortisol rhythm. Disrupted in Cushing's syndrome."),
]
for q, a in vivas:
story.append(KeepTogether([
Paragraph(q, ST_VIVA_Q),
Paragraph(f"<b>Ans:</b> {a}", ST_VIVA_A),
sp(2),
]))
story.append(sp(8))
# ─── QUICK REFERENCE CARD ────────────────────────────────────
story.append(section_heading("XI. QUICK REFERENCE — 10 KEY EXAM POINTS"))
story.append(sp(4))
key_points = [
"The anterior pituitary secretes 6 hormones: GH, TSH, ACTH (+β-LPH), Prolactin, FSH, LH from 5 cell types.",
"PROLACTIN is the ONLY AP hormone under DOMINANT INHIBITORY hypothalamic control (dopamine/PIH).",
"ACTH is derived from POMC — explains MSH-like pigmentation in Addison's disease.",
"GnRH must be PULSATILE — continuous GnRH → receptor downregulation → ↓ LH/FSH (clinical use).",
"GH peaks during SLOW-WAVE (NREM Stages III–IV) sleep — most important physiological secretory pulse.",
"ACTH shows diurnal rhythm — PEAK at 6–8 AM, TROUGH at midnight.",
"The α-SUBUNIT is shared by TSH, FSH, LH, and hCG — specificity comes from the unique β-subunit.",
"Three feedback loop types: LONG-LOOP (most common), SHORT-LOOP, and ULTRASHORT-LOOP.",
"INHIBIN selectively inhibits FSH ONLY (not LH) — secreted by Sertoli/granulosa cells.",
"Positive feedback (RARE) — High sustained oestrogen → (+) → LH surge → ovulation.",
]
qr_data = [[
Paragraph(f"<b>{i+1}.</b> {pt}", ST_BODY)
] for i, pt in enumerate(key_points)]
qr_table = Table(qr_data, colWidths=[W])
qr_table.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,-1), C_ACCENT),
('ROWBACKGROUNDS', (0,0), (-1,-1), [C_ACCENT, C_TABLE_ALT2]),
('BOX', (0,0), (-1,-1), 1, C_SUBHDR),
('LINEBELOW', (0,0), (-1,-2), 0.3, colors.lightgrey),
('TOPPADDING', (0,0), (-1,-1), 5),
('BOTTOMPADDING', (0,0), (-1,-1), 5),
('LEFTPADDING', (0,0), (-1,-1), 8),
]))
story.append(qr_table)
story.append(sp(8))
# Footer note
story.append(hr())
story.append(Paragraph(
"<i>Based on: Indu Khurana — Textbook of Medical Physiology & Concise Textbook of Physiology, "
"Section VIII.2. Supplemented by Ganong's Review of Medical Physiology 26E, "
"Costanzo Physiology 7E, and Harrison's Principles of Internal Medicine 22E.</i>",
make_style('ref', fontSize=7.5, textColor=colors.grey, alignment=TA_CENTER)))
doc.build(story, onFirstPage=on_page, onLaterPages=on_page)
print(f"PDF generated: {path}")
if __name__ == '__main__':
build_pdf('/tmp/workspace/pituitary-study-guide/Anterior_Pituitary_Study_Guide.pdf')
cd /tmp/workspace/pituitary-study-guide && python generate_pdf.py 2>&1
~/pituitary-study-guide/generate_pdf.py
Successfully replaced 1 instance(s) of the string in '/tmp/workspace/pituitary-study-guide/generate_pdf.py'
cd /tmp/workspace/pituitary-study-guide && python generate_pdf.py 2>&1
ls -lh /tmp/workspace/pituitary-study-guide/Anterior_Pituitary_Study_Guide.pdf
Anterior Pituitary Study Guide
PDF Document · PDF
| Section | Content |
|---|---|
| Cover | Title, reference, FLAT PG mnemonic, Master axis flowchart |
| A — Cell Types Table | All 5 cell types, hormones, %, transcription factors |
| B — Hypothalamic Hormones Table | All 7 hypophysiotropic hormones with effects |
| I — Growth Hormone | Actions table (direct vs indirect), Regulation flowchart (GHRH/GRIH/IGF-1), Stimulators vs Inhibitors table, Clinical box |
| II — TSH | Actions numbered list, Regulation table, Key statement |
| III — ACTH | POMC processing diagram, Actions table, HPA Axis flowchart with diurnal rhythm + POMC notes, Clinical box |
| IV — Prolactin | Actions table, Suckling reflex flowchart, Stimulators/Inhibitors table, Clinical box |
| V — FSH & LH | Actions table (male/female), Gonadotropin regulation flowchart (with positive feedback + pulsatile GnRH note), Key statements |
| VI — Feedback Loops | Visual flowchart of all 3 types + positive feedback, Summary table |
| VII — Master Summary Table | All 6 hormones: cell, nature, control, actions, feedback, disorders |
| VIII — Glycoprotein α-subunit | TSH/FSH/LH/hCG shared subunit table |
| IX — Clinical Correlations | 9 clinical conditions with mechanism and features |
| X — Viva Questions | 10 Khurana-style Q&A |
| XI — 10 Key Exam Points | Quick reference card |