medial compartment of thigh
Difference between extrinsic and intrinsic muscles of the medial compartment of thigh
Create a labeled anatomy diagram of medial thigh muscles
Difference between extrinsic and intrinsic muscles of the medial compartment of thigh
extrinsic vs intrinsic muscles medial compartment of thigh
| Muscle | Origin | Insertion | Joint acted on |
|---|---|---|---|
| Adductor longus | Pubis | Linea aspera (femur) | Hip only |
| Adductor brevis | Pubis | Linea aspera (femur) | Hip only |
| Adductor magnus | Ischiopubic ramus/ischial tuberosity | Linea aspera & adductor tubercle (femur) | Hip only |
| Pectineus | Pubis | Pectineal line (femur) | Hip only |
| Obturator externus | Obturator membrane/margins | Trochanteric fossa (femur) | Hip only (lateral rotator) |
| Feature | Intrinsic (5 muscles) | Extrinsic (1 muscle) |
|---|---|---|
| Muscles | Adductor longus, brevis, magnus, pectineus, obturator externus | Gracilis |
| Origin | Pubis/ischium | Pubis/ischiopubic ramus |
| Insertion | Femur (linea aspera, trochanteric fossa, etc.) | Tibia (pes anserinus) - beyond the thigh |
| Joints crossed | Hip only | Hip and knee |
| Action | Adduction (± lateral rotation for obturator externus) | Hip adduction + knee flexion/medial rotation of leg |
Create a labeled anatomy diagram of medial thigh muscles
A detailed labeled anatomical diagram of the medial (adductor) compartment muscles of the human thigh, anterior view, showing pectineus, adductor longus, adductor brevis, adductor magnus, gracilis, and obturator externus, with clear label lines pointing to each muscle, origin points on the pubis/ischium and insertion points on the femur and tibia shown, in a medical textbook illustration style

Search for clinical images of medial thigh anatomy
medial thigh anatomy adductor muscles compartment

This diagnostic ultrasound image demonstrates a cross-sectional view of the medial thigh musculature and neural anatomy, specifically highlighting a regional anesthesia or interventional pain procedure. The image depicts the fascial planes between the adductor longus, gracilis, and adductor brevis muscles. The anterior branch of the obturator nerve (Ant Branch Obt) is identified as a hyperechoic structure situated in the interfascial plane between the adductor longus and adductor brevis. Deep to these structures lies the adductor magnus. A hyperechoic linear structure representing an interventional needle is visible, traversing through the adductor longus with its tip precisely positioned in the fascial plane adjacent to the anterior branch of the obturator nerve. This visual serves as a guide for performing an obturator nerve block, frequently used for hip surgery analgesia or treating adductor spasticity. The educational focus is on the sonoanatomy of the thigh's medial compartment and the 'in-plane' needle technique for peripheral nerve blocks.

Anatomical dissection of the left anteromedial thigh of a male cadaver, focused on the adductor compartment. The image highlights the spatial relationships of neurovascular and muscular structures following the reflection of the pectineus muscle (P). A prominent anatomical landmark shown is the thick pectineal fascia (PF), which is situated deep to the pectineus and superficial to the emergence of the obturator nerve (ON) main trunk from the obturator foramen. Medial and inferior to the nerve emergence, the adductor longus (AL) and adductor brevis (AB) muscles are visible. Lateral to these structures, the femoral artery (FA) is identifiable. The photograph serves as an educational reference for regional anatomy and surgical approaches to the obturator nerve, emphasizing the pectineal fascia's role as a protective and identifying layer overlying the nerve's division into anterior and posterior branches.

This diagnostic image is a transverse ultrasound of the medial mid-thigh region, illustrating the musculoskeletal and neurovascular anatomy relevant for regional anesthesia. The femur (F) is identified by a prominent hyperechoic curvilinear border with characteristic posterior acoustic shadowing. Cranial to the femur is the vastus medialis muscle (VM m.), while the pectineus (P m.), adductor (A m.), and semimembranosus (SM m.) muscles occupy the deeper and caudal fields, exhibiting heterogeneous echogenicity. Superficially, the sartorius muscle (S m.) covers the neurovascular compartment. A critical landmark is the medial femoral fascia (MFF), visualized as a hyperechoic fascial plane containing the saphenous nerve (SN). The SN appears as a small, hyperechoic, round-to-oval structure within this fascia. Orientation markers indicate medial (M), lateral (L), cranial (Cr), and caudal (Cd) directions. This ultrasound view is clinically significant for performing ultrasound-guided saphenous nerve blocks, allowing for precise needle localization and local anesthetic deposition within the fascial plane.
adductor longus gracilis pectineus labeled cadaver dissection




Create a study guide document on medial thigh anatomy
mkdir -p /tmp/workspace/medial-thigh-study-guide && ls -la /tmp/workspace/
~/medial-thigh-study-guide/build_doc.py
from docx import Document
from docx.shared import Pt, Inches, RGBColor
from docx.enum.text import WD_ALIGN_PARAGRAPH
from docx.enum.table import WD_TABLE_ALIGNMENT
from docx.oxml.ns import qn
from docx.oxml import OxmlElement
doc = Document()
style = doc.styles["Normal"]
style.font.name = "Arial"
style.font.size = Pt(11)
NAVY = RGBColor(0x1F, 0x3A, 0x5F)
MAROON = RGBColor(0x7A, 0x1F, 0x2B)
def set_cell_shading(cell, hex_color):
tcPr = cell._tc.get_or_add_tcPr()
shd = OxmlElement('w:shd')
shd.set(qn('w:val'), 'clear')
shd.set(qn('w:color'), 'auto')
shd.set(qn('w:fill'), hex_color)
tcPr.append(shd)
def style_header_row(row, hex_color="1F3A5F"):
for cell in row.cells:
set_cell_shading(cell, hex_color)
for p in cell.paragraphs:
for r in p.runs:
r.font.color.rgb = RGBColor(0xFF, 0xFF, 0xFF)
r.font.bold = True
def add_table(headers, rows, col_widths=None):
table = doc.add_table(rows=1, cols=len(headers))
table.style = "Light Grid Accent 1"
table.alignment = WD_TABLE_ALIGNMENT.CENTER
hdr_cells = table.rows[0].cells
for i, h in enumerate(headers):
hdr_cells[i].text = h
style_header_row(table.rows[0])
for row_data in rows:
row_cells = table.add_row().cells
for i, val in enumerate(row_data):
row_cells[i].text = str(val)
if col_widths:
for row in table.rows:
for i, w in enumerate(col_widths):
row.cells[i].width = Inches(w)
doc.add_paragraph()
return table
# ---------- TITLE PAGE ----------
title = doc.add_heading("Medial (Adductor) Compartment of the Thigh", level=0)
title.alignment = WD_ALIGN_PARAGRAPH.CENTER
subtitle = doc.add_paragraph("Study Guide - Anatomy, Innervation, Vasculature & Clinical Correlations")
subtitle.alignment = WD_ALIGN_PARAGRAPH.CENTER
subtitle.runs[0].font.size = Pt(14)
subtitle.runs[0].font.italic = True
subtitle.runs[0].font.color.rgb = NAVY
doc.add_paragraph()
# ---------- 1. OVERVIEW ----------
doc.add_heading("1. Overview & Boundaries", level=1)
doc.add_paragraph(
"The thigh is divided by intermuscular septa into three fascial compartments: anterior, "
"posterior, and medial. The medial (adductor) compartment lies between the anterior and "
"posterior compartments and is bounded by the medial and posterior intermuscular septa."
)
doc.add_paragraph(
"Collectively, the medial compartment muscles adduct the thigh at the hip joint (the obturator "
"externus is the exception - it laterally rotates the femur). All muscles in this compartment "
"arise from the pubis and/or ischium and are supplied predominantly by the obturator nerve."
)
bullet = doc.add_paragraph(style="List Bullet")
bullet.add_run("Key organizing fact: ").bold = True
bullet.add_run("6 muscles, 1 nerve (obturator, with femoral nerve exceptions), 1 main artery (obturator + deep femoral perforators).")
# ---------- 2. MUSCLES TABLE ----------
doc.add_heading("2. The Six Muscles", level=1)
doc.add_paragraph(
"Listed superficial to deep, then most medial: pectineus, adductor longus, gracilis, adductor "
"brevis, adductor magnus, obturator externus (deepest)."
)
headers = ["Muscle", "Origin", "Insertion", "Action", "Innervation"]
rows = [
["Pectineus", "Pectineal line of pubis (pubic body)", "Pectineal line of femur (just below lesser trochanter)", "Adducts & flexes thigh", "Femoral nerve (occasionally accessory obturator)"],
["Adductor longus", "Body of pubis, below pubic crest", "Middle third of linea aspera (femur)", "Adducts thigh; assists flexion", "Obturator nerve (anterior division)"],
["Adductor brevis", "Body & inferior ramus of pubis", "Pectineal line & proximal linea aspera", "Adducts thigh; assists flexion", "Obturator nerve (anterior/posterior division)"],
["Adductor magnus", "Adductor part: ischiopubic ramus | Hamstring part: ischial tuberosity", "Adductor part: linea aspera | Hamstring part: adductor tubercle", "Adducts thigh; adductor part flexes, hamstring part extends thigh", "Adductor part: obturator nerve | Hamstring part: tibial division of sciatic nerve"],
["Gracilis", "Body of pubis & ischiopubic ramus", "Medial surface of proximal tibia (pes anserinus)", "Adducts thigh; flexes & medially rotates leg at knee", "Obturator nerve (anterior division)"],
["Obturator externus", "Outer surface of obturator membrane & surrounding bone", "Trochanteric fossa of femur", "Laterally rotates thigh (only lateral rotator of the group)", "Obturator nerve (posterior division)"],
]
add_table(headers, rows, col_widths=[1.1, 1.7, 1.7, 1.6, 1.6])
# ---------- 3. INTRINSIC VS BIARTICULAR ----------
doc.add_heading("3. Single-Joint vs Two-Joint (\"Biarticular\") Muscles", level=1)
doc.add_paragraph(
"Five muscles (pectineus, adductor longus, adductor brevis, adductor magnus, obturator "
"externus) both originate and insert within the thigh region, acting only on the hip joint - "
"sometimes loosely called \"intrinsic\" to the thigh."
)
doc.add_paragraph(
"Gracilis is the exception: it is the only medial compartment muscle that crosses two joints "
"(hip and knee). It runs the full length of the thigh and inserts below the knee on the tibia "
"at the pes anserinus, so its action extends beyond the thigh into the leg - functionally "
"\"extrinsic\" relative to the rest of the group. Note: this intrinsic/extrinsic terminology is "
"informal/functional, not a standard label used in major anatomy texts (e.g. Gray's Anatomy for "
"Students), which simply classify all six as medial compartment muscles."
)
p = doc.add_paragraph()
p.add_run("Pes anserinus = ").bold = True
p.add_run("conjoined insertion of sartorius, gracilis, and semitendinosus on the anteromedial proximal tibia (\"goose's foot\").")
# ---------- 4. NEUROVASCULAR SUPPLY ----------
doc.add_heading("4. Neurovascular Supply", level=1)
doc.add_heading("Obturator Nerve (L2-L4)", level=2)
doc.add_paragraph(
"Arises from the lumbar plexus, exits the pelvis through the obturator foramen, and divides "
"into anterior and posterior branches separated by the obturator externus and adductor brevis."
)
b = doc.add_paragraph(style="List Bullet")
b.add_run("Anterior branch: ").bold = True
b.add_run("supplies adductor longus, adductor brevis, gracilis (and often pectineus); gives an articular branch to the hip and a cutaneous branch to the medial thigh.")
b2 = doc.add_paragraph(style="List Bullet")
b2.add_run("Posterior branch: ").bold = True
b2.add_run("pierces obturator externus (supplying it), then supplies adductor magnus (adductor part) and gives an articular branch to the knee.")
doc.add_heading("Femoral Nerve Exception", level=2)
doc.add_paragraph("Pectineus is a transitional muscle: mainly innervated by the femoral nerve, occasionally with an accessory obturator nerve contribution.")
doc.add_heading("Sciatic Nerve Exception", level=2)
doc.add_paragraph("The hamstring (ischiocondylar) part of adductor magnus is supplied by the tibial division of the sciatic nerve, since functionally it behaves like a hamstring (extends the hip).")
doc.add_heading("Arterial Supply", level=2)
doc.add_paragraph(
"Mainly the obturator artery (a branch of the internal iliac artery) and the medial circumflex "
"femoral artery and perforating branches of the deep femoral (profunda femoris) artery."
)
# ---------- 5. LANDMARKS ----------
doc.add_heading("5. Key Anatomical Landmarks", level=1)
b = doc.add_paragraph(style="List Bullet")
b.add_run("Femoral triangle: ").bold = True
b.add_run("medial border formed by the medial margin of adductor longus.")
b = doc.add_paragraph(style="List Bullet")
b.add_run("Adductor canal (subsartorial canal): ").bold = True
b.add_run("lies between adductor longus/magnus and vastus medialis, roofed by sartorius; transmits the femoral artery, femoral vein, and saphenous nerve to the adductor (Hunter's) hiatus.")
b = doc.add_paragraph(style="List Bullet")
b.add_run("Adductor hiatus: ").bold = True
b.add_run("gap in adductor magnus through which the femoral vessels pass to become the popliteal vessels.")
b = doc.add_paragraph(style="List Bullet")
b.add_run("Obturator foramen/canal: ").bold = True
b.add_run("passage for the obturator nerve and vessels from the pelvis into the medial thigh.")
# ---------- 6. CLINICAL CORRELATIONS ----------
doc.add_heading("6. Clinical Correlations", level=1)
headers = ["Condition/Procedure", "Relevance to Medial Thigh Anatomy"]
rows = [
["Groin strain (adductor strain)", "Common athletic injury, most often involving adductor longus at its pubic origin; presents with medial groin/thigh pain, worse on resisted adduction."],
["Obturator nerve block", "Performed for hip surgery analgesia or to treat adductor spasticity (e.g. cerebral palsy); needle targets the fascial plane between adductor longus and adductor brevis where the anterior branch runs."],
["Saphenous nerve block", "Performed in the adductor canal, using the medial mid-thigh as an ultrasound landmark (vastus medialis, adductor muscles, sartorius surrounding the neurovascular bundle)."],
["Thigh compartment syndrome", "The medial compartment is the least commonly affected of the three thigh compartments and rarely requires fasciotomy compared to anterior/posterior compartments."],
["Obturator hernia", "Rare hernia through the obturator canal; can compress the obturator nerve causing medial thigh pain and weak adduction (Howship-Romberg sign)."],
["Adductor magnus hiatus injury", "Because the femoral vessels pass through the adductor hiatus, penetrating trauma here can cause major vascular injury of the lower limb."],
]
add_table(headers, rows, col_widths=[2.0, 4.5])
# ---------- 7. QUICK REVIEW ----------
doc.add_heading("7. Quick Review / High-Yield Points", level=1)
points = [
"6 muscles: pectineus, adductor longus, adductor brevis, adductor magnus, gracilis, obturator externus.",
"Main action: hip adduction (obturator externus is the exception - lateral rotator).",
"Main nerve: obturator nerve (L2-L4); exceptions - pectineus (femoral n.), hamstring part of adductor magnus (tibial n., via sciatic).",
"Only two-joint muscle: gracilis (hip + knee), inserting at the pes anserinus.",
"Deepest muscle: obturator externus.",
"Most medial/superficial: gracilis.",
"Largest: adductor magnus (has adductor part + hamstring/ischiocondylar part).",
"Medial border of femoral triangle: adductor longus.",
"Adductor canal transmits femoral artery, femoral vein, and saphenous nerve.",
]
for pt in points:
doc.add_paragraph(pt, style="List Bullet")
# ---------- 8. SELF-TEST ----------
doc.add_heading("8. Self-Test Questions", level=1)
questions = [
"Which medial compartment muscle is innervated by the femoral nerve rather than the obturator nerve?",
"Which muscle is the only lateral rotator in this compartment, and why does it differ functionally from the rest?",
"Name the muscle that crosses both the hip and knee joints, and state its distal insertion.",
"Which nerve branch (anterior or posterior division of the obturator nerve) supplies obturator externus and the adductor part of adductor magnus?",
"What structure passes through the adductor hiatus, and what is its clinical significance?",
"Which muscle forms the medial border of the femoral triangle?",
]
for i, q in enumerate(questions, 1):
doc.add_paragraph(f"{i}. {q}")
doc.add_paragraph()
answer_head = doc.add_paragraph()
answer_head.add_run("Answers: ").bold = True
answer_head.add_run(
"1) Pectineus. 2) Obturator externus - laterally rotates the thigh instead of adducting. "
"3) Gracilis - inserts on the medial proximal tibia at the pes anserinus. 4) Posterior division. "
"5) The femoral artery and vein (becoming the popliteal vessels) - vulnerable to injury/entrapment. "
"6) Adductor longus."
)
# ---------- FOOTER / SOURCES ----------
doc.add_paragraph()
src = doc.add_paragraph()
src.add_run("Primary reference: ").italic = True
src.add_run("Gray's Anatomy for Students (Ch. 6, Lower Limb - Medial Compartment of the Thigh).").italic = True
doc.save("/tmp/workspace/medial-thigh-study-guide/Medial_Thigh_Anatomy_Study_Guide.docx")
print("Saved.")
cd /tmp/workspace/medial-thigh-study-guide && python3 build_doc.py
cd /tmp/workspace/medial-thigh-study-guide && python3 -c " from docx import Document doc = Document('Medial_Thigh_Anatomy_Study_Guide.docx') print('Paragraphs:', len(doc.paragraphs)) print('Tables:', len(doc.tables)) for t in doc.tables: print('Table rows:', len(t.rows), 'cols:', len(t.columns)) " && ls -la /tmp/workspace/medial-thigh-study-guide/
Medial Thigh Anatomy Study Guide
Word Document · DOCX
Generate a presentation on medial thigh anatomy for studying or teaching
cd /tmp/workspace && mkdir -p medial-thigh-pptx/assets && python3 /tmp/skills/shared/scripts/fetch_images.py \ "https://cdn.orris.care/cdss_images/fe8e15bf2a2a0c1df463a8716494d0b25488742a5c6736dc2a5a0b4cd0ad1535.png" \ "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_602cd0f77ef9e9700583f75292df2457a4af66dbc2ea1e3731d85d49089e5482.jpg" \ "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_00c83c472fc1d8cd2df19ead192eac67a2cf254ae1e0613efcfeb5bcdd9617ff.jpg" \ > medial-thigh-pptx/assets/images.json 2>&1; python3 -c " import json data = json.load(open('medial-thigh-pptx/assets/images.json')) for d in data: print(d['url'], 'OK' if d.get('base64') else 'FAIL', d.get('error')) "
~/medial-thigh-pptx/build_pptx.py
import json, base64
from io import BytesIO
from pptx import Presentation
from pptx.util import Inches, Pt, Emu
from pptx.dml.color import RGBColor
from pptx.enum.text import PP_ALIGN, MSO_ANCHOR
from pptx.enum.shapes import MSO_SHAPE
from pptx.oxml.ns import qn
from pptx.oxml import parse_xml
NAVY = RGBColor(0x1F, 0x3A, 0x5F)
MAROON = RGBColor(0x7A, 0x1F, 0x2B)
GOLD = RGBColor(0xC9, 0xA2, 0x27)
WHITE = RGBColor(0xFF, 0xFF, 0xFF)
DARK = RGBColor(0x2B, 0x2B, 0x2B)
LIGHTBG = RGBColor(0xF4, 0xF1, 0xEA)
images = json.load(open("assets/images.json"))
img_map = {}
for im in images:
if im.get("base64"):
header, b64 = im["base64"].split(",", 1) if "," in im["base64"] else ("", im["base64"])
img_map[im["url"]] = BytesIO(base64.b64decode(b64))
GRAY_DIAGRAM = img_map["https://cdn.orris.care/cdss_images/fe8e15bf2a2a0c1df463a8716494d0b25488742a5c6736dc2a5a0b4cd0ad1535.png"]
CADAVER = img_map["https://cdn.orris.care/cdss_images/pmc_clinical_VQA_602cd0f77ef9e9700583f75292df2457a4af66dbc2ea1e3731d85d49089e5482.jpg"]
ULTRASOUND = img_map["https://cdn.orris.care/cdss_images/pmc_clinical_VQA_00c83c472fc1d8cd2df19ead192eac67a2cf254ae1e0613efcfeb5bcdd9617ff.jpg"]
prs = Presentation()
prs.slide_width = Inches(13.333)
prs.slide_height = Inches(7.5)
BLANK = prs.slide_layouts[6]
SW, SH = prs.slide_width, prs.slide_height
def add_slide(bg=WHITE):
s = prs.slides.add_slide(BLANK)
rect = s.shapes.add_shape(MSO_SHAPE.RECTANGLE, 0, 0, SW, SH)
rect.fill.solid()
rect.fill.fore_color.rgb = bg
rect.line.fill.background()
rect.shadow.inherit = False
s.shapes._spTree.remove(rect._element)
s.shapes._spTree.insert(2, rect._element)
return s
def add_textbox(slide, x, y, w, h, text, size=18, bold=False, italic=False,
color=DARK, align=PP_ALIGN.LEFT, font="Arial", anchor=None, wrap=True):
tb = slide.shapes.add_textbox(x, y, w, h)
tf = tb.text_frame
tf.word_wrap = wrap
if anchor:
tf.vertical_anchor = anchor
tf.margin_left = Pt(2)
tf.margin_right = Pt(2)
tf.margin_top = Pt(2)
tf.margin_bottom = Pt(2)
p = tf.paragraphs[0]
p.alignment = align
r = p.add_run()
r.text = text
r.font.size = Pt(size)
r.font.bold = bold
r.font.italic = italic
r.font.color.rgb = color
r.font.name = font
return tb
def add_bullets(slide, x, y, w, h, items, size=15, color=DARK, gap=6, bullet_color=MAROON):
tb = slide.shapes.add_textbox(x, y, w, h)
tf = tb.text_frame
tf.word_wrap = True
first = True
for item in items:
if isinstance(item, tuple):
text, level = item
else:
text, level = item, 0
p = tf.paragraphs[0] if first else tf.add_paragraph()
first = False
p.level = 0
p.space_after = Pt(gap)
marker = " - " if level == 1 else "\u25CF "
r = p.add_run()
r.text = (" " if level == 1 else "") + marker + text
r.font.size = Pt(size - 2 if level == 1 else size)
r.font.color.rgb = color if level == 0 else RGBColor(0x55, 0x55, 0x55)
r.font.name = "Arial"
return tb
def header_bar(slide, title, subtitle=None):
bar = slide.shapes.add_shape(MSO_SHAPE.RECTANGLE, 0, 0, SW, Inches(1.15))
bar.fill.solid()
bar.fill.fore_color.rgb = NAVY
bar.line.fill.background()
bar.shadow.inherit = False
add_textbox(slide, Inches(0.5), Inches(0.12), Inches(11.5), Inches(0.7), title,
size=30, bold=True, color=WHITE, anchor=MSO_ANCHOR.MIDDLE)
if subtitle:
add_textbox(slide, Inches(0.5), Inches(0.72), Inches(11.5), Inches(0.4), subtitle,
size=14, italic=True, color=GOLD)
accent = slide.shapes.add_shape(MSO_SHAPE.RECTANGLE, 0, Inches(1.15), SW, Pt(4))
accent.fill.solid()
accent.fill.fore_color.rgb = GOLD
accent.line.fill.background()
accent.shadow.inherit = False
def add_picture_bordered(slide, img_stream, x, y, w, h, caption=None):
img_stream.seek(0)
pic = slide.shapes.add_picture(img_stream, x, y, height=h)
# center horizontally within target width box
if pic.width > w:
ratio = w / pic.width
pic.width = w
pic.height = Emu(int(pic.height * ratio))
pic.left = Emu(int(x + (w - pic.width) / 2))
border = slide.shapes.add_shape(MSO_SHAPE.RECTANGLE, pic.left, pic.top, pic.width, pic.height)
border.fill.background()
border.line.color.rgb = NAVY
border.line.width = Pt(1.5)
border.shadow.inherit = False
if caption:
add_textbox(slide, x, Emu(int(pic.top + pic.height + Pt(4))), w, Inches(0.5), caption,
size=12, italic=True, color=RGBColor(0x55, 0x55, 0x55), align=PP_ALIGN.CENTER)
return pic
def style_table(table, header_bg=NAVY, header_color=WHITE, body_size=12, header_size=13):
for j, cell in enumerate(table.rows[0].cells):
cell.fill.solid()
cell.fill.fore_color.rgb = header_bg
for p in cell.text_frame.paragraphs:
p.alignment = PP_ALIGN.CENTER
for r in p.runs:
r.font.bold = True
r.font.size = Pt(header_size)
r.font.color.rgb = header_color
r.font.name = "Arial"
for i, row in enumerate(table.rows[1:], start=1):
for cell in row.cells:
cell.fill.solid()
cell.fill.fore_color.rgb = RGBColor(0xF4, 0xF1, 0xEA) if i % 2 == 0 else WHITE
for p in cell.text_frame.paragraphs:
for r in p.runs:
r.font.size = Pt(body_size)
r.font.name = "Arial"
r.font.color.rgb = DARK
def add_table(slide, x, y, w, h, headers, rows_data, col_widths=None, body_size=12, header_size=13):
n_rows = len(rows_data) + 1
n_cols = len(headers)
gt = slide.shapes.add_table(n_rows, n_cols, x, y, w, h)
table = gt.table
if col_widths:
total = sum(col_widths)
for i, cw in enumerate(col_widths):
table.columns[i].width = Emu(int(w * cw / total))
for i, htext in enumerate(headers):
table.cell(0, i).text = htext
for r_i, row in enumerate(rows_data, start=1):
for c_i, val in enumerate(row):
table.cell(r_i, c_i).text = str(val)
style_table(table, body_size=body_size, header_size=header_size)
return table
def footer(slide, num):
add_textbox(slide, Inches(0.4), Inches(7.15), Inches(6), Inches(0.3),
"Medial Thigh Anatomy | Study Deck", size=10, color=RGBColor(0x99, 0x99, 0x99))
add_textbox(slide, Inches(12.3), Inches(7.15), Inches(0.6), Inches(0.3),
str(num), size=10, color=RGBColor(0x99, 0x99, 0x99), align=PP_ALIGN.RIGHT)
# ============ SLIDE 1: TITLE ============
s = add_slide(bg=NAVY)
band = s.shapes.add_shape(MSO_SHAPE.RECTANGLE, 0, Inches(4.6), SW, Inches(0.08))
band.fill.solid(); band.fill.fore_color.rgb = GOLD; band.line.fill.background(); band.shadow.inherit = False
add_textbox(s, Inches(1), Inches(2.6), Inches(11.3), Inches(1.3),
"Medial Compartment of the Thigh", size=44, bold=True, color=WHITE, align=PP_ALIGN.CENTER)
add_textbox(s, Inches(1), Inches(3.75), Inches(11.3), Inches(0.6),
"Anatomy, Innervation, Vasculature & Clinical Correlations", size=20, italic=True,
color=GOLD, align=PP_ALIGN.CENTER)
add_textbox(s, Inches(1), Inches(5.0), Inches(11.3), Inches(0.5),
"A Study & Teaching Deck", size=16, color=RGBColor(0xCC, 0xCC, 0xCC), align=PP_ALIGN.CENTER)
# ============ SLIDE 2: LEARNING OBJECTIVES ============
s = add_slide()
header_bar(s, "Learning Objectives", "By the end of this deck, learners should be able to:")
add_bullets(s, Inches(0.8), Inches(1.6), Inches(11.5), Inches(5),
["List and locate the six muscles of the medial (adductor) compartment of the thigh",
"State the origin, insertion, and action of each muscle",
"Trace the obturator nerve and identify innervation exceptions (pectineus, adductor magnus)",
"Identify gracilis as the compartment's only two-joint (biarticular) muscle",
"Describe key regional landmarks: femoral triangle, adductor canal, adductor hiatus",
"Apply this anatomy to clinical scenarios: groin strain, nerve blocks, hernia, vascular injury"],
size=18, gap=14)
footer(s, 2)
# ============ SLIDE 3: OVERVIEW ============
s = add_slide()
header_bar(s, "Overview & Boundaries")
add_bullets(s, Inches(0.6), Inches(1.5), Inches(6.6), Inches(5.3), [
"The thigh is divided by intermuscular septa into 3 fascial compartments:",
("Anterior - hip flexors / knee extensors (femoral n.)", 1),
("Posterior - hip extensors / knee flexors (sciatic n.)", 1),
("Medial - hip adductors (obturator n.)", 1),
"The medial (adductor) compartment lies between the anterior and posterior compartments,"
" bounded by the medial and posterior intermuscular septa.",
"All 6 muscles arise from the pubis and/or ischium.",
"Collective action: adduction of the thigh at the hip (obturator externus is the exception -"
" it laterally rotates instead).",
], size=16, gap=12)
add_picture_bordered(s, GRAY_DIAGRAM, Inches(7.5), Inches(1.55), Inches(5.2), Inches(5.0),
caption="Fig. Muscles of the Medial Compartment of the Thigh, anterior view\n(Gray's Anatomy for Students)")
footer(s, 3)
# ============ SLIDE 4: THE SIX MUSCLES ============
s = add_slide()
header_bar(s, "The Six Muscles", "Superficial -> deep, most medial -> lateral")
items = [
("1. Pectineus", "Superior, flat, quadrangular"),
("2. Adductor longus", "Superficial fan-shaped muscle"),
("3. Gracilis", "Most medial & superficial; strap-like"),
("4. Adductor brevis", "Deep to adductor longus"),
("5. Adductor magnus", "Largest; adductor + hamstring parts"),
("6. Obturator externus", "Deepest; lateral rotator"),
]
x0, y0 = Inches(0.7), Inches(1.7)
box_w, box_h = Inches(3.9), Inches(1.55)
gap_x, gap_y = Inches(0.25), Inches(0.3)
for i, (name, desc) in enumerate(items):
col = i % 3
row = i // 3
x = Emu(int(x0 + col * (box_w + gap_x)))
y = Emu(int(y0 + row * (box_h + gap_y)))
box = s.shapes.add_shape(MSO_SHAPE.ROUNDED_RECTANGLE, x, y, box_w, box_h)
box.fill.solid()
box.fill.fore_color.rgb = LIGHTBG
box.line.color.rgb = MAROON
box.line.width = Pt(1.5)
box.shadow.inherit = False
tf = box.text_frame
tf.word_wrap = True
tf.margin_left = Pt(10); tf.margin_top = Pt(8)
p = tf.paragraphs[0]
r = p.add_run(); r.text = name; r.font.bold = True; r.font.size = Pt(18); r.font.color.rgb = NAVY
p2 = tf.add_paragraph()
r2 = p2.add_run(); r2.text = desc; r2.font.size = Pt(14); r2.font.color.rgb = DARK
footer(s, 4)
# ============ SLIDE 5: MUSCLE TABLE PART 1 ============
s = add_slide()
header_bar(s, "Muscle Attachments & Actions (1/2)")
headers = ["Muscle", "Origin", "Insertion", "Action"]
rows = [
["Pectineus", "Pectineal line of pubis", "Pectineal line of femur\n(below lesser trochanter)", "Adducts & flexes thigh"],
["Adductor longus", "Body of pubis, below pubic crest", "Middle 3rd of linea aspera", "Adducts thigh; assists flexion"],
["Adductor brevis", "Body & inferior ramus of pubis", "Pectineal line & proximal linea aspera", "Adducts thigh; assists flexion"],
]
add_table(s, Inches(0.6), Inches(1.6), Inches(12.1), Inches(3.2), headers, rows,
col_widths=[2, 3.5, 3.5, 3], body_size=14, header_size=15)
footer(s, 5)
# ============ SLIDE 6: MUSCLE TABLE PART 2 ============
s = add_slide()
header_bar(s, "Muscle Attachments & Actions (2/2)")
headers = ["Muscle", "Origin", "Insertion", "Action"]
rows = [
["Adductor magnus", "Adductor part: ischiopubic ramus\nHamstring part: ischial tuberosity",
"Adductor part: linea aspera\nHamstring part: adductor tubercle",
"Adducts; adductor part flexes,\nhamstring part extends thigh"],
["Gracilis", "Body of pubis & ischiopubic ramus", "Medial proximal tibia (pes anserinus)",
"Adducts thigh; flexes & medially\nrotates leg at knee"],
["Obturator externus", "Outer surface of obturator membrane", "Trochanteric fossa of femur",
"Laterally rotates thigh\n(only lateral rotator)"],
]
add_table(s, Inches(0.6), Inches(1.6), Inches(12.1), Inches(3.6), headers, rows,
col_widths=[2, 3.5, 3.5, 3], body_size=13, header_size=15)
footer(s, 6)
# ============ SLIDE 7: INNERVATION SUMMARY ============
s = add_slide()
header_bar(s, "Innervation at a Glance")
headers = ["Muscle", "Nerve"]
rows = [
["Pectineus", "Femoral nerve (occasionally accessory obturator n.)"],
["Adductor longus", "Obturator nerve - anterior division"],
["Adductor brevis", "Obturator nerve - anterior/posterior division"],
["Adductor magnus (adductor part)", "Obturator nerve - posterior division"],
["Adductor magnus (hamstring part)", "Tibial division of the sciatic nerve"],
["Gracilis", "Obturator nerve - anterior division"],
["Obturator externus", "Obturator nerve - posterior division"],
]
add_table(s, Inches(1.5), Inches(1.55), Inches(10.3), Inches(5.1), headers, rows,
col_widths=[5, 6], body_size=15, header_size=16)
footer(s, 7)
# ============ SLIDE 8: TWO-JOINT MUSCLE (GRACILIS) ============
s = add_slide()
header_bar(s, "Single-Joint vs. Two-Joint Muscles")
add_bullets(s, Inches(0.7), Inches(1.6), Inches(11.8), Inches(2.6), [
"5 muscles act only on the hip joint: pectineus, adductor longus, adductor brevis,"
" adductor magnus, obturator externus - origin and insertion confined to the pelvis/femur.",
"Gracilis is the exception: it crosses BOTH the hip and knee joints.",
"It runs the full length of the thigh and inserts on the medial proximal tibia at the pes"
" anserinus (with sartorius and semitendinosus).",
], size=17, gap=14)
note = s.shapes.add_shape(MSO_SHAPE.ROUNDED_RECTANGLE, Inches(0.9), Inches(4.5), Inches(11.3), Inches(2.1))
note.fill.solid(); note.fill.fore_color.rgb = RGBColor(0xEC, 0xE3, 0xD3)
note.line.color.rgb = GOLD; note.line.width = Pt(1.5); note.shadow.inherit = False
tf = note.text_frame; tf.word_wrap = True; tf.margin_left = Pt(14); tf.margin_top = Pt(10)
p = tf.paragraphs[0]
r = p.add_run(); r.text = "Teaching note: "; r.font.bold = True; r.font.size = Pt(15); r.font.color.rgb = MAROON
r2 = p.add_run()
r2.text = ("\"Intrinsic vs extrinsic\" is not standard textbook terminology for this compartment "
"(major texts simply list all six as medial compartment muscles). It is a useful informal "
"way to remember that gracilis alone extends its action beyond the thigh into the leg.")
r2.font.size = Pt(15); r2.font.color.rgb = DARK
footer(s, 8)
# ============ SLIDE 9: NEUROVASCULAR SUPPLY ============
s = add_slide()
header_bar(s, "Neurovascular Supply")
add_bullets(s, Inches(0.6), Inches(1.5), Inches(6.6), Inches(5.4), [
"Obturator nerve (L2-L4): from lumbar plexus, exits pelvis via obturator foramen, splits into"
" anterior & posterior divisions separated by obturator externus and adductor brevis.",
("Anterior division: adductor longus, adductor brevis, gracilis (+/- pectineus);"
" articular branch to hip, cutaneous branch to medial thigh", 1),
("Posterior division: pierces & supplies obturator externus, then adductor magnus"
" (adductor part); articular branch to knee", 1),
"Exceptions: pectineus (femoral n.); hamstring part of adductor magnus (tibial division"
" of sciatic n., since it acts like a hamstring)",
"Arterial supply: obturator artery; medial circumflex femoral artery; perforating branches"
" of the deep femoral (profunda femoris) artery",
], size=15, gap=12)
add_picture_bordered(s, CADAVER, Inches(7.5), Inches(1.55), Inches(5.2), Inches(5.0),
caption="Cadaveric dissection: pectineus reflected to show obturator\nnerve emerging from the obturator foramen")
footer(s, 9)
# ============ SLIDE 10: KEY LANDMARKS ============
s = add_slide()
header_bar(s, "Key Anatomical Landmarks")
add_bullets(s, Inches(0.8), Inches(1.6), Inches(11.5), Inches(5.3), [
"Femoral triangle - its medial border is formed by the medial margin of adductor longus",
"Adductor (subsartorial) canal - between adductor longus/magnus and vastus medialis, roofed"
" by sartorius; transmits the femoral artery, femoral vein, and saphenous nerve",
"Adductor hiatus - gap in adductor magnus through which femoral vessels pass to become"
" the popliteal vessels",
"Obturator foramen/canal - passage for the obturator nerve and vessels from pelvis into"
" the medial thigh",
"Pes anserinus - conjoined tibial insertion of sartorius, gracilis, and semitendinosus"
" (\"goose's foot\")",
], size=18, gap=16)
footer(s, 10)
# ============ SLIDE 11: CLINICAL CORRELATIONS ============
s = add_slide()
header_bar(s, "Clinical Correlations")
headers = ["Condition / Procedure", "Relevance"]
rows = [
["Groin strain", "Most often involves adductor longus at its pubic origin; medial thigh pain worse on resisted adduction"],
["Obturator nerve block", "Analgesia for hip surgery / treats adductor spasticity; targets plane between adductor longus & brevis"],
["Saphenous nerve block", "Performed in the adductor canal, using medial mid-thigh ultrasound landmarks"],
["Thigh compartment syndrome", "Medial compartment least often affected; rarely needs fasciotomy vs. anterior/posterior"],
["Obturator hernia", "Compresses obturator nerve -> medial thigh pain & weak adduction (Howship-Romberg sign)"],
["Vascular injury at adductor hiatus", "Femoral vessels here become the popliteal vessels; penetrating trauma risks major limb ischemia"],
]
add_table(s, Inches(0.5), Inches(1.55), Inches(12.3), Inches(5.3), headers, rows,
col_widths=[3.3, 9], body_size=13, header_size=15)
footer(s, 11)
# ============ SLIDE 12: ULTRASOUND / PROCEDURE IMAGE ============
s = add_slide()
header_bar(s, "Clinical Imaging: Obturator Nerve Block")
add_bullets(s, Inches(0.6), Inches(1.6), Inches(6.4), Inches(4.8), [
"Ultrasound-guided obturator nerve block is used for hip surgery analgesia and to treat"
" adductor muscle spasticity.",
"The needle is guided in-plane through adductor longus, with its tip positioned in the"
" fascial plane between adductor longus and adductor brevis.",
"The anterior branch of the obturator nerve appears as a hyperechoic structure in this"
" interfascial plane; adductor magnus lies deep to both muscles.",
], size=16, gap=14)
add_picture_bordered(s, ULTRASOUND, Inches(7.3), Inches(1.6), Inches(5.4), Inches(4.9),
caption="Transverse ultrasound of the medial thigh: needle targeting the\nanterior branch of the obturator nerve")
footer(s, 12)
# ============ SLIDE 13: HIGH-YIELD REVIEW ============
s = add_slide(bg=LIGHTBG)
header_bar(s, "High-Yield Quick Review")
add_bullets(s, Inches(0.8), Inches(1.6), Inches(11.5), Inches(5.3), [
"6 muscles: pectineus, adductor longus, adductor brevis, adductor magnus, gracilis, obturator externus",
"Main action: hip adduction (obturator externus = lateral rotator, the exception)",
"Main nerve: obturator nerve (L2-L4); exceptions - pectineus (femoral n.), hamstring part of"
" adductor magnus (tibial n. via sciatic)",
"Only two-joint muscle: gracilis (hip + knee) -> inserts at pes anserinus",
"Deepest muscle: obturator externus | Most medial/superficial: gracilis",
"Largest: adductor magnus (adductor part + hamstring/ischiocondylar part)",
"Medial border of femoral triangle: adductor longus",
"Adductor canal transmits: femoral artery, femoral vein, saphenous nerve",
], size=17, gap=13)
footer(s, 13)
# ============ SLIDE 14: SELF-TEST ============
s = add_slide()
header_bar(s, "Self-Test Questions", "Use for active recall or as a teaching discussion prompt")
qs = [
"1. Which medial compartment muscle is innervated by the femoral nerve rather than the obturator nerve?",
"2. Which muscle is the only lateral rotator in this compartment?",
"3. Which muscle crosses both the hip and knee joints, and where does it insert distally?",
"4. Which division of the obturator nerve supplies obturator externus and adductor magnus (adductor part)?",
"5. What passes through the adductor hiatus, and why is this clinically significant?",
"6. Which muscle forms the medial border of the femoral triangle?",
]
add_bullets(s, Inches(0.8), Inches(1.7), Inches(11.5), Inches(4.5), qs, size=17, gap=16, bullet_color=NAVY)
ans = s.shapes.add_shape(MSO_SHAPE.ROUNDED_RECTANGLE, Inches(0.8), Inches(6.15), Inches(11.7), Inches(0.9))
ans.fill.solid(); ans.fill.fore_color.rgb = NAVY; ans.line.fill.background(); ans.shadow.inherit = False
tf = ans.text_frame; tf.word_wrap = True; tf.margin_left = Pt(10); tf.margin_top = Pt(4)
p = tf.paragraphs[0]
r = p.add_run(); r.text = "Answers: "; r.font.bold = True; r.font.size = Pt(12); r.font.color.rgb = GOLD
r2 = p.add_run()
r2.text = ("1) Pectineus 2) Obturator externus 3) Gracilis - pes anserinus on the tibia "
"4) Posterior division 5) Femoral artery & vein (become popliteal vessels) - vulnerable to injury "
"6) Adductor longus")
r2.font.size = Pt(12); r2.font.color.rgb = WHITE
footer(s, 14)
# ============ SLIDE 15: SUMMARY / SOURCES ============
s = add_slide(bg=NAVY)
add_textbox(s, Inches(1), Inches(2.2), Inches(11.3), Inches(1), "Summary", size=36, bold=True,
color=WHITE, align=PP_ALIGN.CENTER)
add_textbox(s, Inches(1.5), Inches(3.3), Inches(10.3), Inches(2.5),
"The medial thigh compartment: 6 muscles, mainly obturator-nerve-innervated hip adductors, "
"with gracilis as the sole two-joint muscle. Key clinical relevance spans groin strains, "
"regional nerve blocks, and vascular anatomy at the adductor hiatus.",
size=18, color=RGBColor(0xE0, 0xE0, 0xE0), align=PP_ALIGN.CENTER)
add_textbox(s, Inches(1.5), Inches(6.3), Inches(10.3), Inches(0.6),
"Primary reference: Gray's Anatomy for Students, Ch. 6 - Lower Limb (Medial Compartment of the Thigh)",
size=13, italic=True, color=GOLD, align=PP_ALIGN.CENTER)
prs.save("/tmp/workspace/medial-thigh-pptx/Medial_Thigh_Anatomy_Presentation.pptx")
print("Saved. Slides:", len(prs.slides.__iter__.__self__._sldIdLst))
cd /tmp/workspace/medial-thigh-pptx && python3 build_pptx.py
~/medial-thigh-pptx/build_pptx.py
Successfully replaced 1 instance(s) of the string in '/tmp/workspace/medial-thigh-pptx/build_pptx.py'
cd /tmp/workspace/medial-thigh-pptx && python3 build_pptx.py
cd /tmp/workspace/medial-thigh-pptx && python3 -c " from pptx import Presentation prs = Presentation('Medial_Thigh_Anatomy_Presentation.pptx') print('Total slides:', len(prs.slides)) for i, slide in enumerate(prs.slides, 1): texts = [sh.text_frame.text.split(chr(10))[0] for sh in slide.shapes if sh.has_text_frame and sh.text_frame.text.strip()] print(i, '-', texts[0] if texts else '(no text)') " && ls -la /tmp/workspace/medial-thigh-pptx/
Medial Thigh Anatomy Presentation
Presentation · PPTX