I want hand muscles with nerves names and total hand

Reading File
Finding Sources
Finding Sources
Searching Images

intrinsic muscles of hand nerve supply diagram anatomy

This clinical anatomical photograph displays a deep dissection of the human palm, specifically focusing on the thenar eminence and the neurovascular structures of the thumb. The image highlights the intricate relationship between the intrinsic hand muscles and their nerve supply. Key labeled muscular structures include the superficial head of the flexor pollicis brevis (c), the opponens pollicis (d), and the abductor pollicis brevis (e). Additionally, both the oblique (f) and transverse (g) heads of the adductor pollicis are clearly visible. The neural components are represented by a branch of the median nerve (a), shown providing innervation to the thenar muscles, and the deep branch of the ulnar nerve (b), which courses toward the adductor muscles. This visual serves as an educational tool for understanding hand anatomy, the concept of double innervation in the flexor pollicis brevis, and the surgical landmarks required for procedures involving the thenar space and peripheral nerve mapping.

This clinical anatomical photograph displays a deep dissection of the human palm, specifically focusing on the thenar eminence and the neurovascular structures of the thumb. The image highlights the intricate relationship between the intrinsic hand muscles and their nerve supply. Key labeled muscular structures include the superficial head of the flexor pollicis brevis (c), the opponens pollicis (d), and the abductor pollicis brevis (e). Additionally, both the oblique (f) and transverse (g) heads of the adductor pollicis are clearly visible. The neural components are represented by a branch of the median nerve (a), shown providing innervation to the thenar muscles, and the deep branch of the ulnar nerve (b), which courses toward the adductor muscles. This visual serves as an educational tool for understanding hand anatomy, the concept of double innervation in the flexor pollicis brevis, and the surgical landmarks required for procedures involving the thenar space and peripheral nerve mapping.

Anatomical cadaveric dissection photograph showing the muscular and nervous structures of the human thenar eminence and palmar hand. The image demonstrates the innervation and spatial relationships of the intrinsic thumb muscles. Key identified structures include the median nerve (a) branching to supply the abductor pollicis brevis (d), the superficial head of the flexor pollicis brevis (e), and the deep head of the flexor pollicis brevis (c), the latter illustrating dual innervation. To the right, the deep branch of the ulnar nerve (b) is visible near the oblique (f) and transverse (g) heads of the adductor pollicis muscle. The dissection highlights the layered arrangement of the thenar muscles and the complex branching patterns of the recurrent branch of the median nerve and the deep branch of the ulnar nerve. This clinical educational material is intended for advanced musculoskeletal anatomy and neurovascular surgical training.

Anatomical cadaveric dissection photograph showing the muscular and nervous structures of the human thenar eminence and palmar hand. The image demonstrates the innervation and spatial relationships of the intrinsic thumb muscles. Key identified structures include the median nerve (a) branching to supply the abductor pollicis brevis (d), the superficial head of the flexor pollicis brevis (e), and the deep head of the flexor pollicis brevis (c), the latter illustrating dual innervation. To the right, the deep branch of the ulnar nerve (b) is visible near the oblique (f) and transverse (g) heads of the adductor pollicis muscle. The dissection highlights the layered arrangement of the thenar muscles and the complex branching patterns of the recurrent branch of the median nerve and the deep branch of the ulnar nerve. This clinical educational material is intended for advanced musculoskeletal anatomy and neurovascular surgical training.

An anatomical dissection photograph of the human thenar region and palm, illustrating the intrinsic muscles of the hand and their dual nerve supply. The image features a detailed view of the muscular architecture including the abductor pollicis brevis, and the superficial and deep heads of the flexor pollicis brevis (FPB). A key educational focus is the demonstration of double innervation: a branch of the median nerve is shown supplying the abductor pollicis brevis and the superficial head of the FPB, while the deep branch of the ulnar nerve is visualized providing motor innervation to the deep head of the FPB and the adductor pollicis muscle. Both the oblique and transverse heads of the adductor pollicis are clearly demarcated. The dissection highlights the critical spatial relationships between the recurrent branch of the median nerve and the deep branch of the ulnar nerve within the palm, serving as an important clinical reference for hand surgery, nerve entrapment syndromes, and neuromuscular assessment.

An anatomical dissection photograph of the human thenar region and palm, illustrating the intrinsic muscles of the hand and their dual nerve supply. The image features a detailed view of the muscular architecture including the abductor pollicis brevis, and the superficial and deep heads of the flexor pollicis brevis (FPB). A key educational focus is the demonstration of double innervation: a branch of the median nerve is shown supplying the abductor pollicis brevis and the superficial head of the FPB, while the deep branch of the ulnar nerve is visualized providing motor innervation to the deep head of the FPB and the adductor pollicis muscle. Both the oblique and transverse heads of the adductor pollicis are clearly demarcated. The dissection highlights the critical spatial relationships between the recurrent branch of the median nerve and the deep branch of the ulnar nerve within the palm, serving as an important clinical reference for hand surgery, nerve entrapment syndromes, and neuromuscular assessment.

This historical anatomical illustration, likely from a 19th-century monograph, consists of two labeled diagrams (b and c) detailing the musculoskeletal and bursal anatomy of the hand. Diagram 'b' displays a lateral view of an index finger (1), with a flap of subcutaneous tissue (2) reflected upward by a surgical pin to reveal a subcutaneous mucous bursa (3) on the dorsal aspect. Diagram 'c' provides a deep dissection of the hand's dorsal metacarpal region. It illustrates the metacarpal bones II-IV (1-3) along with the associated dorsal interossei muscles (4, 6, 7) and the adductor pollicis (5). Key anatomical focuses include the intermetacarpophalangeal bursae (8) situated between the metacarpal heads, and specific tendinous or ligamentous attachments (9, 10) demonstrated via retraction. These illustrations serve as educational materials for understanding the spatial relationships between bones, intrinsic hand muscles, and the synovial bursae that facilitate movement in the digits and metacarpophalangeal joints.

This historical anatomical illustration, likely from a 19th-century monograph, consists of two labeled diagrams (b and c) detailing the musculoskeletal and bursal anatomy of the hand. Diagram 'b' displays a lateral view of an index finger (1), with a flap of subcutaneous tissue (2) reflected upward by a surgical pin to reveal a subcutaneous mucous bursa (3) on the dorsal aspect. Diagram 'c' provides a deep dissection of the hand's dorsal metacarpal region. It illustrates the metacarpal bones II-IV (1-3) along with the associated dorsal interossei muscles (4, 6, 7) and the adductor pollicis (5). Key anatomical focuses include the intermetacarpophalangeal bursae (8) situated between the metacarpal heads, and specific tendinous or ligamentous attachments (9, 10) demonstrated via retraction. These illustrations serve as educational materials for understanding the spatial relationships between bones, intrinsic hand muscles, and the synovial bursae that facilitate movement in the digits and metacarpophalangeal joints.

Reading File
Reading File
Reading File
Reading File
Loading Image
Loading Image
I now have everything needed. Here is the complete, well-organized reference on all hand muscles with their nerve supply.

Muscles of the Hand - Complete Reference

The intrinsic muscles of the hand are divided into three groups:
  1. Thenar muscles (thumb eminence) - 4 muscles
  2. Hypothenar muscles (little finger eminence) - 4 muscles
  3. Metacarpal muscles (lumbricals + interossei) - 11 muscles
Total intrinsic hand muscles = 19

GROUP 1: THENAR MUSCLES (4 muscles)

Thenar and hypothenar muscles of the right hand, anterior palmar view
#MuscleOriginInsertionActionNerveRoot
1Abductor pollicis brevisScaphoid, trapezium, flexor retinaculumBase of proximal phalanx of thumb (radial sesamoid)Abduction of thumbMedian nerve (recurrent branch)C8, T1
2Flexor pollicis brevis - Superficial headFlexor retinaculumBase of proximal phalanx of thumb (radial sesamoid)CMC: flexion, opposition; MCP: flexionMedian nerveC8, T1
2Flexor pollicis brevis - Deep headCapitate, trapeziumSameSameUlnar nerve (deep branch)C8, T1
3Opponens pollicisTrapeziumRadial border of 1st metacarpalOpposition of thumb at CMC jointMedian nerve (recurrent branch)C8, T1
4Adductor pollicis - Transverse headPalmar surface of 3rd metacarpalBase of proximal phalanx of thumb (ulnar sesamoid)CMC: opposition; MCP: flexionUlnar nerve (deep branch)C8, T1
4Adductor pollicis - Oblique headCapitate, base of 2nd & 3rd metacarpalsSameSameUlnar nerve (deep branch)C8, T1
Memory tip (Thenar): "The thenar muscles are Median, except Adductor pollicis (Ulnar). Flexor pollicis brevis has dual supply - superficial head = Median, deep head = Ulnar."

GROUP 2: HYPOTHENAR MUSCLES (4 muscles)

#MuscleOriginInsertionActionNerveRoot
5Abductor digiti minimiPisiformUlnar base of proximal phalanx of 5th digit + dorsal digital expansionMCP flexion + abduction of little finger; PIP/DIP extensionUlnar nerve (deep branch)C8, T1
6Flexor digiti minimi brevisHook of hamate, flexor retinaculumBase of proximal phalanx of 5th digitMCP flexion of little fingerUlnar nerve (deep branch)C8, T1
7Opponens digiti minimiHook of hamate, flexor retinaculumUlnar border of 5th metacarpalDraws 5th metacarpal palmarly (opposition)Ulnar nerve (deep branch)C8, T1
8Palmaris brevisUlnar border of palmar aponeurosisSkin of hypothenar eminenceTightens palmar aponeurosis (protective)Ulnar nerve (superficial branch)C8, T1
Memory tip (Hypothenar): All 4 hypothenar muscles = Ulnar nerve, no exceptions.

GROUP 3: METACARPAL MUSCLES (11 muscles)

Schematic of lumbricals and interossei - palmar view showing flexor digitorum profundus tendons (1), lumbricals (2), and interossei (3)

A. Lumbrical Muscles (4 muscles)

MuscleOriginInsertionActionNerveRoot
1st LumbricalRadial side of FDP tendon to indexDorsal digital expansion of 2nd digitMCP flexion; PIP + DIP extension of indexMedian nerveC8, T1
2nd LumbricalRadial side of FDP tendon to middleDorsal digital expansion of 3rd digitMCP flexion; PIP + DIP extension of middleMedian nerveC8, T1
3rd LumbricalRadial side of FDP tendon to ringDorsal digital expansion of 4th digitMCP flexion; PIP + DIP extension of ringUlnar nerveC8, T1
4th LumbricalRadial side of FDP tendon to littleDorsal digital expansion of 5th digitMCP flexion; PIP + DIP extension of littleUlnar nerveC8, T1
Memory tip (Lumbricals): "1 & 2 = Median (lateral two); 3 & 4 = Ulnar (medial two)."

B. Dorsal Interossei (4 muscles) - "DAB" = Dorsal ABduct

MuscleOriginInsertionActionNerveRoot
1st Dorsal InterosseusAdjacent sides of 1st & 2nd metacarpalsRadial side of proximal phalanx of index (2nd)MCP flexion + abduction of indexUlnar nerveC8, T1
2nd Dorsal InterosseusAdjacent sides of 2nd & 3rd metacarpalsRadial side of proximal phalanx of middle (3rd)MCP flexion + abduction of middle (radial)Ulnar nerveC8, T1
3rd Dorsal InterosseusAdjacent sides of 3rd & 4th metacarpalsUlnar side of proximal phalanx of middle (3rd)MCP flexion + abduction of middle (ulnar)Ulnar nerveC8, T1
4th Dorsal InterosseusAdjacent sides of 4th & 5th metacarpalsUlnar side of proximal phalanx of ring (4th)MCP flexion + abduction of ringUlnar nerveC8, T1

C. Palmar Interossei (3 muscles) - "PAD" = Palmar ADduct

MuscleOriginInsertionActionNerveRoot
1st Palmar InterosseusUlnar side of 2nd metacarpal (index)Dorsal digital expansion + base of proximal phalanx of indexMCP flexion + adduction of index toward middleUlnar nerveC8, T1
2nd Palmar InterosseusRadial side of 4th metacarpal (ring)Dorsal digital expansion + base of proximal phalanx of ringMCP flexion + adduction of ring toward middleUlnar nerveC8, T1
3rd Palmar InterosseusRadial side of 5th metacarpal (little)Dorsal digital expansion + base of proximal phalanx of littleMCP flexion + adduction of little toward middleUlnar nerveC8, T1
Memory tip (Interossei): All 7 interossei = Ulnar nerve only.

QUICK NERVE SUMMARY TABLE

NerveMuscles Supplied# of Muscles
Median nerveAbductor pollicis brevis, Opponens pollicis, Flexor pollicis brevis (superficial head), 1st & 2nd lumbricals5
Ulnar nerveAdductor pollicis, Flexor pollicis brevis (deep head), ALL 4 hypothenar muscles, 3rd & 4th lumbricals, ALL 4 dorsal interossei, ALL 3 palmar interossei14 (+1 shared)

TOTAL COUNT

GroupMusclesCount
ThenarAbductor pollicis brevis, Adductor pollicis, Flexor pollicis brevis, Opponens pollicis4
HypothenarAbductor digiti minimi, Flexor digiti minimi brevis, Opponens digiti minimi, Palmaris brevis4
Lumbricals1st, 2nd, 3rd, 4th4
Dorsal Interossei1st, 2nd, 3rd, 4th4
Palmar Interossei1st, 2nd, 3rd3
TOTAL19 intrinsic muscles

Key Clinical Points

  • "All intrinsics = Ulnar nerve" is the approximate rule - the Ulnar nerve controls 14 of 19 hand muscles (everything except the lateral 3.5 muscles).
  • The lateral 3.5 muscles supplied by the Median nerve (recurrent branch): LOAF = Lumbricals 1 & 2, Opponens pollicis, Abductor pollicis brevis, Flexor pollicis brevis (superficial head).
  • Ulnar nerve palsy causes: claw hand (ring & little fingers), loss of intrinsic function, wasting of hypothenar + first dorsal interosseus (guttering between index and thumb).
  • Median nerve palsy (low): Loss of thenar muscles → cannot abduct/oppose thumb → "ape thumb" deformity.
Source: THIEME Atlas of Anatomy - General Anatomy and Musculoskeletal System, pp. 341-344

Make a presentation on hand muscle anatomy and clinical assessment

Reading File
Searching Images

claw hand ulnar nerve palsy deformity

Two-panel clinical photograph demonstrating the late sequelae of a peripheral nerve injury in the hand, specifically illustrating features of ulnar nerve palsy. Image A (lateral view) shows a classic 'claw hand' deformity, characterized by hyperextension at the metacarpophalangeal (MCP) joints and flexion at the interphalangeal (IP) joints, most prominent in the ring and little fingers. The thumb appears adducted and flexed. Image B (anterior/palmar view) displays generalized muscle atrophy of the hand, with significant hollowing of the hypothenar eminence and interosseous spaces (indicated by white arrows). Notably, the thenar eminence remains relatively spared, suggesting the median nerve's innervation to the thenar muscles is intact. This combination of clawing and selective intrinsic muscle wasting is an important educational marker for localizing nerve lesions to the distal ulnar nerve (e.g., Guyon's canal or post-surgical complication). The images illustrate the clinical presentation of chronic motor deficit and the characteristic postural changes resulting from unbalanced muscle pull in the hand.

Two-panel clinical photograph demonstrating the late sequelae of a peripheral nerve injury in the hand, specifically illustrating features of ulnar nerve palsy. Image A (lateral view) shows a classic 'claw hand' deformity, characterized by hyperextension at the metacarpophalangeal (MCP) joints and flexion at the interphalangeal (IP) joints, most prominent in the ring and little fingers. The thumb appears adducted and flexed. Image B (anterior/palmar view) displays generalized muscle atrophy of the hand, with significant hollowing of the hypothenar eminence and interosseous spaces (indicated by white arrows). Notably, the thenar eminence remains relatively spared, suggesting the median nerve's innervation to the thenar muscles is intact. This combination of clawing and selective intrinsic muscle wasting is an important educational marker for localizing nerve lesions to the distal ulnar nerve (e.g., Guyon's canal or post-surgical complication). The images illustrate the clinical presentation of chronic motor deficit and the characteristic postural changes resulting from unbalanced muscle pull in the hand.

Clinical photograph of bilateral hands from a dorsal (A) and palmar (B) perspective, demonstrating characteristic features of ulnar nerve palsy. The primary visual finding is a 'claw hand' or 'benediction hand' deformity, most prominent on the left side, characterized by hyperextension at the metacarpophalangeal (MCP) joints and flexion at the proximal and distal interphalangeal (PIP and DIP) joints of the fourth and fifth digits. There is marked atrophy of the intrinsic hand muscles, specifically visible as hollowing of the interosseous spaces on the dorsal aspect and flattening of the hypothenar and thenar eminences on the palmar aspect. The skin appears thin with prominent tendons and vasculature, indicating loss of muscle bulk. This presentation is consistent with severe, chronic ulnar neuropathy, illustrating the loss of lumbrical and interossei muscle function. Educational concepts include the 'ulnar paradox' where distal lesions may appear more severe and the clinical manifestation of McGowan classification stages of nerve injury.

Clinical photograph of bilateral hands from a dorsal (A) and palmar (B) perspective, demonstrating characteristic features of ulnar nerve palsy. The primary visual finding is a 'claw hand' or 'benediction hand' deformity, most prominent on the left side, characterized by hyperextension at the metacarpophalangeal (MCP) joints and flexion at the proximal and distal interphalangeal (PIP and DIP) joints of the fourth and fifth digits. There is marked atrophy of the intrinsic hand muscles, specifically visible as hollowing of the interosseous spaces on the dorsal aspect and flattening of the hypothenar and thenar eminences on the palmar aspect. The skin appears thin with prominent tendons and vasculature, indicating loss of muscle bulk. This presentation is consistent with severe, chronic ulnar neuropathy, illustrating the loss of lumbrical and interossei muscle function. Educational concepts include the 'ulnar paradox' where distal lesions may appear more severe and the clinical manifestation of McGowan classification stages of nerve injury.

This clinical photograph displays a right hand in a partially flexed position, demonstrating sequelae of an ulnar nerve palsy. The hand shows a characteristic 'claw hand' deformity (main en griffe), particularly affecting the 4th and 5th digits, which exhibit flexion at the interphalangeal joints and a limitation in extension. The skin on the dorsal and palmar surfaces appears indurated with areas of hyperpigmentation and darker macules, while the distal fingertips of the 4th and 5th digits show hypopigmented changes. This presentation is consistent with chronic neurological damage from leprosy (Hansen's disease). The index finger remains more extended, and the third finger shows partial flexibility following rehabilitation. Educational value lies in the visual demonstration of ulnar nerve paralysis, the associated intrinsic muscle wasting, and the integumentary changes secondary to chronic neuropathic disease.

This clinical photograph displays a right hand in a partially flexed position, demonstrating sequelae of an ulnar nerve palsy. The hand shows a characteristic 'claw hand' deformity (main en griffe), particularly affecting the 4th and 5th digits, which exhibit flexion at the interphalangeal joints and a limitation in extension. The skin on the dorsal and palmar surfaces appears indurated with areas of hyperpigmentation and darker macules, while the distal fingertips of the 4th and 5th digits show hypopigmented changes. This presentation is consistent with chronic neurological damage from leprosy (Hansen's disease). The index finger remains more extended, and the third finger shows partial flexibility following rehabilitation. Educational value lies in the visual demonstration of ulnar nerve paralysis, the associated intrinsic muscle wasting, and the integumentary changes secondary to chronic neuropathic disease.

Searching Images

ape thumb median nerve palsy thenar wasting

Two-panel clinical photograph demonstrating the late sequelae of a peripheral nerve injury in the hand, specifically illustrating features of ulnar nerve palsy. Image A (lateral view) shows a classic 'claw hand' deformity, characterized by hyperextension at the metacarpophalangeal (MCP) joints and flexion at the interphalangeal (IP) joints, most prominent in the ring and little fingers. The thumb appears adducted and flexed. Image B (anterior/palmar view) displays generalized muscle atrophy of the hand, with significant hollowing of the hypothenar eminence and interosseous spaces (indicated by white arrows). Notably, the thenar eminence remains relatively spared, suggesting the median nerve's innervation to the thenar muscles is intact. This combination of clawing and selective intrinsic muscle wasting is an important educational marker for localizing nerve lesions to the distal ulnar nerve (e.g., Guyon's canal or post-surgical complication). The images illustrate the clinical presentation of chronic motor deficit and the characteristic postural changes resulting from unbalanced muscle pull in the hand.

Two-panel clinical photograph demonstrating the late sequelae of a peripheral nerve injury in the hand, specifically illustrating features of ulnar nerve palsy. Image A (lateral view) shows a classic 'claw hand' deformity, characterized by hyperextension at the metacarpophalangeal (MCP) joints and flexion at the interphalangeal (IP) joints, most prominent in the ring and little fingers. The thumb appears adducted and flexed. Image B (anterior/palmar view) displays generalized muscle atrophy of the hand, with significant hollowing of the hypothenar eminence and interosseous spaces (indicated by white arrows). Notably, the thenar eminence remains relatively spared, suggesting the median nerve's innervation to the thenar muscles is intact. This combination of clawing and selective intrinsic muscle wasting is an important educational marker for localizing nerve lesions to the distal ulnar nerve (e.g., Guyon's canal or post-surgical complication). The images illustrate the clinical presentation of chronic motor deficit and the characteristic postural changes resulting from unbalanced muscle pull in the hand.

This four-part series of clinical photographs documents the management of a traumatic hand injury resulting in the loss of thumb opposition. Image A shows an acute, deep laceration across the thenar eminence with active bleeding, indicating damage to the thenar branch of the median nerve. Image B demonstrates the clinical consequence after initial wound closure: a significant deficit in thumb opposition (ape hand deformity), where the patient cannot touch the thumb tip to the small finger. Image C is an intraoperative view showing a functional free pronator quadratus (FFPQ) muscle transfer. A single long incision extends from the palm to the distal forearm, exposing the donor pronator quadratus muscle and the recipient thenar site for neurovascular anastomosis. Image D shows the 6-month postoperative result, displaying a healed linear surgical scar and restored functional thumb opposition. This series illustrates the surgical reconstruction of thenar muscle function using a local muscle flap to restore essential hand grip and pinch mechanics.

This four-part series of clinical photographs documents the management of a traumatic hand injury resulting in the loss of thumb opposition. Image A shows an acute, deep laceration across the thenar eminence with active bleeding, indicating damage to the thenar branch of the median nerve. Image B demonstrates the clinical consequence after initial wound closure: a significant deficit in thumb opposition (ape hand deformity), where the patient cannot touch the thumb tip to the small finger. Image C is an intraoperative view showing a functional free pronator quadratus (FFPQ) muscle transfer. A single long incision extends from the palm to the distal forearm, exposing the donor pronator quadratus muscle and the recipient thenar site for neurovascular anastomosis. Image D shows the 6-month postoperative result, displaying a healed linear surgical scar and restored functional thumb opposition. This series illustrates the surgical reconstruction of thenar muscle function using a local muscle flap to restore essential hand grip and pinch mechanics.

Reading File
Searching Images

Froment sign ulnar nerve test adductor pollicis

This composite of clinical photographs illustrates the physical examination maneuvers for assessing ulnar nerve motor function. (a) Displays the clinical test for the flexor digitorum profundus (FDP) of the little finger, with the examiner stabilizing the finger to isolate distal interphalangeal joint flexion. (b) Shows the assessment of the abductor digiti minimi (ADM) muscle through resisted abduction of the little finger. (c) Demonstrates the evaluation of the first dorsal interosseous (FDI) muscle, involving resisted abduction of the index finger. (d) Highlights a positive Froment's sign, a classic indicator of ulnar nerve palsy. The patient attempts to hold a card between the thumb and index finger; due to weakness of the ulnar-innervated adductor pollicis, the patient exhibits compensatory hyperflexion at the thumb's interphalangeal joint, powered by the median-innervated flexor pollicis longus. These tests collectively evaluate the integrity of the ulnar nerve and its intrinsic and extrinsic hand muscle innervation.

This composite of clinical photographs illustrates the physical examination maneuvers for assessing ulnar nerve motor function. (a) Displays the clinical test for the flexor digitorum profundus (FDP) of the little finger, with the examiner stabilizing the finger to isolate distal interphalangeal joint flexion. (b) Shows the assessment of the abductor digiti minimi (ADM) muscle through resisted abduction of the little finger. (c) Demonstrates the evaluation of the first dorsal interosseous (FDI) muscle, involving resisted abduction of the index finger. (d) Highlights a positive Froment's sign, a classic indicator of ulnar nerve palsy. The patient attempts to hold a card between the thumb and index finger; due to weakness of the ulnar-innervated adductor pollicis, the patient exhibits compensatory hyperflexion at the thumb's interphalangeal joint, powered by the median-innervated flexor pollicis longus. These tests collectively evaluate the integrity of the ulnar nerve and its intrinsic and extrinsic hand muscle innervation.

A composite of three clinical photographs (A, B, C) illustrating the presentation and functional deficits associated with a proximal ulnar nerve injury. Panel A shows a linear, slightly erythematous surgical scar on the volar aspect of the distal forearm, proximal to the wrist and Guyon's canal, consistent with a history of nerve repair. Panel B demonstrates the dorsal aspect of the hand with flattening of the transverse metacarpal arch and subtle wasting of the intrinsic muscles, often seen in ulnar nerve palsy. Panel C depicts a positive Froment's sign during a key pinch task with a piece of paper. This clinical sign is characterized by compensatory hyperflexion of the thumb's interphalangeal (IP) joint by the flexor pollicis longus (innervated by the median nerve) to overcome weakness of the adductor pollicis (innervated by the ulnar nerve). The series demonstrates the motor consequences of a 'claw hand' deformity and specific clinical provocative testing for ulnar nerve dysfunction.

A composite of three clinical photographs (A, B, C) illustrating the presentation and functional deficits associated with a proximal ulnar nerve injury. Panel A shows a linear, slightly erythematous surgical scar on the volar aspect of the distal forearm, proximal to the wrist and Guyon's canal, consistent with a history of nerve repair. Panel B demonstrates the dorsal aspect of the hand with flattening of the transverse metacarpal arch and subtle wasting of the intrinsic muscles, often seen in ulnar nerve palsy. Panel C depicts a positive Froment's sign during a key pinch task with a piece of paper. This clinical sign is characterized by compensatory hyperflexion of the thumb's interphalangeal (IP) joint by the flexor pollicis longus (innervated by the median nerve) to overcome weakness of the adductor pollicis (innervated by the ulnar nerve). The series demonstrates the motor consequences of a 'claw hand' deformity and specific clinical provocative testing for ulnar nerve dysfunction.

Searching Images

hand muscle anatomy thenar hypothenar interossei lumbrical diagram

Educational comparison between musculoskeletal ultrasound (a) and cadaveric dissection (b) of the human hand, specifically focusing on the thenar space. Image (a) is a cross-sectional ultrasound of the left hand palm. It illustrates the adductor pollicis muscle as a hypoechoic (darker) deep structure, with the thenar space appearing as a dark potential space immediately superficial to it. Brighter, more echogenic (hyperechoic) structures superficial to the thenar space include the flexor tendons and the first lumbrical. Deeper landmarks include the hyperechoic boney contours of the metacarpals and the palmar interossei. Image (b) shows a corresponding cadaveric dissection where a surgical instrument is used for blunt dissection to enter the thenar space, located deep to the first lumbrical and superficial to the adductor pollicis muscle fibers. Insets show the ultrasound probe orientation and the anatomical site on a surface model. This visual is designed for orthopedic and radiological training to identify deep palmar spaces and muscular layers.

Educational comparison between musculoskeletal ultrasound (a) and cadaveric dissection (b) of the human hand, specifically focusing on the thenar space. Image (a) is a cross-sectional ultrasound of the left hand palm. It illustrates the adductor pollicis muscle as a hypoechoic (darker) deep structure, with the thenar space appearing as a dark potential space immediately superficial to it. Brighter, more echogenic (hyperechoic) structures superficial to the thenar space include the flexor tendons and the first lumbrical. Deeper landmarks include the hyperechoic boney contours of the metacarpals and the palmar interossei. Image (b) shows a corresponding cadaveric dissection where a surgical instrument is used for blunt dissection to enter the thenar space, located deep to the first lumbrical and superficial to the adductor pollicis muscle fibers. Insets show the ultrasound probe orientation and the anatomical site on a surface model. This visual is designed for orthopedic and radiological training to identify deep palmar spaces and muscular layers.

This composite educational graphic illustrates the embryonic development of human autopod (hand) musculature using Optical Projection Tomography (OPT) and high-resolution episcopic microscopy. Panel A displays a ventral view at Carnegie Stage 22 (CS22), highlighting the differentiation of intrinsic hand muscles. The thenar eminence (radial side) includes the flexor pollicis brevis (FPB), adductor pollicis (AP), and abductor pollicis brevis (APB), while the hypothenar eminence (ulnar side) shows the abductor digiti minimi (ADM) and flexor digiti minimi brevis (FDMB). The flexor digitorum superficialis (FDS) is visible with its proximal muscle belly and distal extensions. Panel B provides a distal-transverse view at CS22, showing the spatial arrangement of the four dorsal interossei (labeled 1-4 in black), palmar interossei (PI), and four lumbricals (labeled 1-4 in blue) relative to the ventral and dorsal surfaces. Panel C presents a CS20 cross-section demonstrating the anatomical relationship between developing metacarpal bones and surrounding soft tissue. This material serves as a reference for embryonic musculoskeletal development and the proximal translocation of extrinsic flexors.

This composite educational graphic illustrates the embryonic development of human autopod (hand) musculature using Optical Projection Tomography (OPT) and high-resolution episcopic microscopy. Panel A displays a ventral view at Carnegie Stage 22 (CS22), highlighting the differentiation of intrinsic hand muscles. The thenar eminence (radial side) includes the flexor pollicis brevis (FPB), adductor pollicis (AP), and abductor pollicis brevis (APB), while the hypothenar eminence (ulnar side) shows the abductor digiti minimi (ADM) and flexor digiti minimi brevis (FDMB). The flexor digitorum superficialis (FDS) is visible with its proximal muscle belly and distal extensions. Panel B provides a distal-transverse view at CS22, showing the spatial arrangement of the four dorsal interossei (labeled 1-4 in black), palmar interossei (PI), and four lumbricals (labeled 1-4 in blue) relative to the ventral and dorsal surfaces. Panel C presents a CS20 cross-section demonstrating the anatomical relationship between developing metacarpal bones and surrounding soft tissue. This material serves as a reference for embryonic musculoskeletal development and the proximal translocation of extrinsic flexors.

Anatomical diagram of the palmar hand and wrist highlighting key neurovascular and muscular landmarks relevant to carpal tunnel surgery. The illustration depicts the Thenar Eminence (TE) on the radial side and the Hypothenar Eminence (HTE) on the ulnar side. Centrally, the Transverse Carpal Ligament (Flexor Retinaculum) is shown with a red dashed line indicating a proposed surgical incision over an avascular area (AE) that is free of muscle attachments. The neurovascular structures include the Superficial Palmar Arch (SPA) located distally across the metacarpals, the Recurrent Branch (RB) of the median nerve curving into the thenar muscles, and the Palmar Cutaneous Branch (PCB) of the median nerve situated proximally near the wrist crease. This diagram serves as a clinical guide for understanding the spatial relationships between surgical incision sites and vital structures to avoid iatrogenic injury during hand procedures.

Anatomical diagram of the palmar hand and wrist highlighting key neurovascular and muscular landmarks relevant to carpal tunnel surgery. The illustration depicts the Thenar Eminence (TE) on the radial side and the Hypothenar Eminence (HTE) on the ulnar side. Centrally, the Transverse Carpal Ligament (Flexor Retinaculum) is shown with a red dashed line indicating a proposed surgical incision over an avascular area (AE) that is free of muscle attachments. The neurovascular structures include the Superficial Palmar Arch (SPA) located distally across the metacarpals, the Recurrent Branch (RB) of the median nerve curving into the thenar muscles, and the Palmar Cutaneous Branch (PCB) of the median nerve situated proximally near the wrist crease. This diagram serves as a clinical guide for understanding the spatial relationships between surgical incision sites and vital structures to avoid iatrogenic injury during hand procedures.

Running Command

mkdir -p /tmp/workspace/hand-anatomy-pptx && ls /tmp/workspace/hand-anatomy-pptx/

Writing File

~/hand-anatomy-pptx/build_pptx.py

import json, subprocess, base64, sys
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.util import Inches, Pt

# ── Colour palette ──────────────────────────────────────────────
NAVY      = RGBColor(0x0D, 0x2B, 0x55)   # dark navy - slide bg / heading
TEAL      = RGBColor(0x00, 0x7A, 0x8A)   # teal accent
LIGHTBLUE = RGBColor(0xD6, 0xEA, 0xF8)   # light blue fill
WHITE     = RGBColor(0xFF, 0xFF, 0xFF)
DARKGRAY  = RGBColor(0x2C, 0x2C, 0x2C)
MEDGRAY   = RGBColor(0x55, 0x55, 0x55)
ORANGE    = RGBColor(0xE8, 0x73, 0x22)
LIGHTGRAY = RGBColor(0xF4, 0xF6, 0xF9)
TEAL_DARK = RGBColor(0x00, 0x5F, 0x6B)
RED       = RGBColor(0xC0, 0x39, 0x2B)
GREEN     = RGBColor(0x1A, 0x7A, 0x4A)

prs = Presentation()
prs.slide_width  = Inches(13.333)
prs.slide_height = Inches(7.5)
blank = prs.slide_layouts[6]

# ── Helper: fetch images ─────────────────────────────────────────
def fetch_imgs(*urls):
    try:
        raw = subprocess.check_output(
            ["python", "/tmp/skills/shared/scripts/fetch_images.py"] + list(urls),
            timeout=60
        )
        return json.loads(raw)
    except Exception as e:
        print(f"[fetch_imgs error] {e}", file=sys.stderr)
        return [{"url": u, "base64": None, "error": str(e)} for u in urls]

def add_img_to_slide(slide, b64_str, left, top, width, height=None):
    """Decode base64 image and add to slide."""
    if not b64_str:
        return
    # strip data URI prefix if present
    if "," in b64_str:
        b64_str = b64_str.split(",", 1)[1]
    raw = base64.b64decode(b64_str)
    buf = BytesIO(raw)
    if height:
        slide.shapes.add_picture(buf, left, top, width, height)
    else:
        slide.shapes.add_picture(buf, left, top, width)

# ── Helper: solid rectangle ──────────────────────────────────────
def add_rect(slide, l, t, w, h, fill_rgb, line_rgb=None, line_width=0):
    from pptx.util import Pt as Pt2
    shape = slide.shapes.add_shape(1, l, t, w, h)   # MSO_SHAPE_TYPE.RECTANGLE = 1
    shape.fill.solid()
    shape.fill.fore_color.rgb = fill_rgb
    if line_rgb:
        shape.line.color.rgb = line_rgb
        shape.line.width = Pt2(line_width)
    else:
        shape.line.fill.background()
    return shape

def add_text(slide, text, l, t, w, h, font_name="Calibri", font_size=18,
             bold=False, italic=False, color=DARKGRAY, align=PP_ALIGN.LEFT,
             word_wrap=True, v_anchor=MSO_ANCHOR.TOP):
    tb = slide.shapes.add_textbox(l, t, w, h)
    tf = tb.text_frame
    tf.word_wrap = word_wrap
    tf.vertical_anchor = v_anchor
    tf.margin_left   = Inches(0.05)
    tf.margin_right  = Inches(0.05)
    tf.margin_top    = Inches(0.03)
    tf.margin_bottom = Inches(0.03)
    p  = tf.paragraphs[0]
    p.alignment = align
    r  = p.add_run()
    r.text = text
    r.font.name  = font_name
    r.font.size  = Pt(font_size)
    r.font.bold  = bold
    r.font.italic = italic
    r.font.color.rgb = color
    return tb

def add_multi_para(slide, lines, l, t, w, h, font_name="Calibri", font_size=14,
                   bold=False, color=DARKGRAY, align=PP_ALIGN.LEFT,
                   line_space=1.15, word_wrap=True):
    """lines: list of (text, bold, color, size) or just str."""
    tb = slide.shapes.add_textbox(l, t, w, h)
    tf = tb.text_frame
    tf.word_wrap = word_wrap
    tf.margin_left   = Inches(0.05)
    tf.margin_right  = Inches(0.05)
    tf.margin_top    = Inches(0.03)
    tf.margin_bottom = Inches(0.03)
    first = True
    for item in lines:
        if isinstance(item, str):
            txt, b, c, s = item, bold, color, font_size
        else:
            txt = item[0]
            b   = item[1] if len(item) > 1 else bold
            c   = item[2] if len(item) > 2 else color
            s   = item[3] if len(item) > 3 else font_size
        if first:
            p = tf.paragraphs[0]
            first = False
        else:
            p = tf.add_paragraph()
        p.alignment = align
        from pptx.oxml.ns import qn
        from lxml import etree
        pPr = p._pPr
        if pPr is None:
            pPr = p._p.get_or_add_pPr()
        spcAft = etree.SubElement(pPr, qn('a:spcAft'))
        spcPts = etree.SubElement(spcAft, qn('a:spcPts'))
        spcPts.set('val', '160')   # 16pt after each paragraph
        r = p.add_run()
        r.text = txt
        r.font.name  = font_name
        r.font.size  = Pt(s)
        r.font.bold  = b
        r.font.color.rgb = c
    return tb

# ════════════════════════════════════════════════════════════════
#  SLIDE FACTORY HELPERS
# ════════════════════════════════════════════════════════════════

def make_slide_header(slide, title, subtitle=None):
    """Navy top bar with white title + optional subtitle."""
    W = prs.slide_width
    # top bar
    add_rect(slide, 0, 0, W, Inches(1.15), NAVY)
    # teal accent stripe
    add_rect(slide, 0, Inches(1.15), W, Inches(0.07), TEAL)
    # title
    add_text(slide, title, Inches(0.45), Inches(0.12), Inches(12.4), Inches(0.9),
             font_size=30, bold=True, color=WHITE, v_anchor=MSO_ANCHOR.MIDDLE)
    if subtitle:
        add_text(slide, subtitle, Inches(0.45), Inches(0.82), Inches(12.4), Inches(0.35),
                 font_size=16, italic=True, color=RGBColor(0xAD, 0xD8, 0xE6))

def slide_bg(slide, color=LIGHTGRAY):
    add_rect(slide, 0, 0, prs.slide_width, prs.slide_height, color)

def footer(slide, text="Hand Muscle Anatomy & Clinical Assessment"):
    W = prs.slide_width
    add_rect(slide, 0, Inches(7.15), W, Inches(0.35), NAVY)
    add_text(slide, text, Inches(0.3), Inches(7.16), Inches(9), Inches(0.3),
             font_size=10, color=RGBColor(0xAD, 0xD8, 0xE6))
    add_text(slide, "THIEME Atlas of Anatomy", Inches(10.5), Inches(7.16),
             Inches(2.7), Inches(0.3),
             font_size=10, italic=True, color=RGBColor(0xAD, 0xD8, 0xE6),
             align=PP_ALIGN.RIGHT)


# ════════════════════════════════════════════════════════════════
# SLIDE 1 – TITLE SLIDE
# ════════════════════════════════════════════════════════════════
slide1 = prs.slides.add_slide(blank)
W = prs.slide_width; H = prs.slide_height
# full bg
add_rect(slide1, 0, 0, W, H, NAVY)
# large teal diagonal band (simulate)
add_rect(slide1, 0, Inches(4.8), W, Inches(0.12), TEAL)
# white content box
add_rect(slide1, Inches(0.6), Inches(1.8), Inches(7.8), Inches(3.6),
         WHITE, TEAL, 1)
add_text(slide1, "Hand Muscle Anatomy",
         Inches(0.9), Inches(2.0), Inches(7.4), Inches(1.0),
         font_size=36, bold=True, color=NAVY, align=PP_ALIGN.LEFT)
add_text(slide1, "& Clinical Assessment",
         Inches(0.9), Inches(2.85), Inches(7.4), Inches(0.8),
         font_size=34, bold=True, color=TEAL, align=PP_ALIGN.LEFT)
add_text(slide1,
         "Intrinsic Muscles  •  Nerve Supply  •  Deformities  •  Clinical Tests",
         Inches(0.9), Inches(3.65), Inches(7.4), Inches(0.55),
         font_size=15, italic=True, color=MEDGRAY, align=PP_ALIGN.LEFT)
add_text(slide1, "Based on THIEME Atlas of Anatomy",
         Inches(0.9), Inches(5.05), Inches(7.4), Inches(0.4),
         font_size=13, italic=True, color=MEDGRAY)
# right image placeholder text
add_rect(slide1, Inches(9.0), Inches(1.5), Inches(3.9), Inches(5.0),
         RGBColor(0x1A, 0x3A, 0x5C))
add_text(slide1, "🖐  19 Intrinsic\nHand Muscles",
         Inches(9.1), Inches(2.8), Inches(3.7), Inches(1.5),
         font_size=22, bold=True, color=WHITE, align=PP_ALIGN.CENTER,
         v_anchor=MSO_ANCHOR.MIDDLE)
add_text(slide1, "Median Nerve  |  Ulnar Nerve  |  Radial Nerve",
         Inches(9.0), Inches(4.5), Inches(3.9), Inches(0.5),
         font_size=12, color=RGBColor(0xAD, 0xD8, 0xE6), align=PP_ALIGN.CENTER)
footer(slide1)


# ════════════════════════════════════════════════════════════════
# SLIDE 2 – OVERVIEW / OUTLINE
# ════════════════════════════════════════════════════════════════
slide2 = prs.slides.add_slide(blank)
slide_bg(slide2)
make_slide_header(slide2, "Contents", "What we cover in this presentation")
footer(slide2)

topics = [
    ("1", "Anatomy Overview", "19 intrinsic muscles | 3 nerve roots (C8, T1)"),
    ("2", "Thenar Muscles", "4 muscles | Median + Ulnar innervation"),
    ("3", "Hypothenar Muscles", "4 muscles | All Ulnar nerve"),
    ("4", "Metacarpal Muscles", "Lumbricals (4) + Interossei (7)"),
    ("5", "Nerve Supply Summary", "LOAF rule | Ulnar dominance"),
    ("6", "Clinical Deformities", "Claw hand | Ape thumb | Wrist drop"),
    ("7", "Clinical Tests", "Froment | Pen test | Intrinsic tightness"),
    ("8", "Key Points", "Quick revision summary"),
]
cols = 2
col_w = Inches(5.8)
for i, (num, title, desc) in enumerate(topics):
    col = i % cols
    row = i // cols
    lx = Inches(0.5 + col * 6.4)
    ty = Inches(1.4 + row * 1.35)
    add_rect(slide2, lx, ty, col_w, Inches(1.15), WHITE, TEAL, 1)
    add_rect(slide2, lx, ty, Inches(0.55), Inches(1.15), TEAL)
    add_text(slide2, num, lx, ty, Inches(0.55), Inches(1.15),
             font_size=22, bold=True, color=WHITE, align=PP_ALIGN.CENTER,
             v_anchor=MSO_ANCHOR.MIDDLE)
    add_text(slide2, title, lx + Inches(0.65), ty + Inches(0.1),
             Inches(5.0), Inches(0.45),
             font_size=16, bold=True, color=NAVY)
    add_text(slide2, desc, lx + Inches(0.65), ty + Inches(0.55),
             Inches(5.0), Inches(0.5),
             font_size=12, italic=True, color=MEDGRAY)


# ════════════════════════════════════════════════════════════════
# SLIDE 3 – ANATOMY OVERVIEW (groups)
# ════════════════════════════════════════════════════════════════
slide3 = prs.slides.add_slide(blank)
slide_bg(slide3)
make_slide_header(slide3, "Hand Muscle Anatomy — Overview",
                  "19 intrinsic muscles in 3 functional groups")
footer(slide3)

groups = [
    ("Thenar\nMuscles", "4 muscles\nThumb eminence\nMedian + Ulnar", TEAL),
    ("Hypothenar\nMuscles", "4 muscles\nLittle finger eminence\nAll Ulnar nerve", NAVY),
    ("Metacarpal\nMuscles", "11 muscles\n4 Lumbricals + 4 DI + 3 PI\nMedian + Ulnar", ORANGE),
]
for i, (title, body, color) in enumerate(groups):
    lx = Inches(0.5 + i * 4.27)
    ty = Inches(1.5)
    add_rect(slide3, lx, ty, Inches(3.9), Inches(0.6), color)
    add_text(slide3, title, lx, ty, Inches(3.9), Inches(0.6),
             font_size=16, bold=True, color=WHITE, align=PP_ALIGN.CENTER,
             v_anchor=MSO_ANCHOR.MIDDLE)
    add_rect(slide3, lx, ty + Inches(0.6), Inches(3.9), Inches(1.7), WHITE, color, 1)
    add_text(slide3, body, lx + Inches(0.15), ty + Inches(0.65),
             Inches(3.6), Inches(1.6),
             font_size=14, color=DARKGRAY, word_wrap=True)

# Total count box
add_rect(slide3, Inches(4.2), Inches(3.5), Inches(4.8), Inches(0.7), TEAL)
add_text(slide3, "TOTAL INTRINSIC HAND MUSCLES = 19",
         Inches(4.2), Inches(3.5), Inches(4.8), Inches(0.7),
         font_size=18, bold=True, color=WHITE, align=PP_ALIGN.CENTER,
         v_anchor=MSO_ANCHOR.MIDDLE)

# Nerve summary row
nerves = [
    ("Median Nerve", "Lateral 3.5 muscles\n(LOAF)", TEAL),
    ("Ulnar Nerve", "14 muscles\n(majority)", NAVY),
    ("Radial Nerve", "Extensor forearm\n(not intrinsic hand)", ORANGE),
]
for i, (n, d, c) in enumerate(nerves):
    lx = Inches(0.5 + i * 4.27)
    ty = Inches(4.5)
    add_rect(slide3, lx, ty, Inches(3.9), Inches(0.45), c)
    add_text(slide3, n, lx, ty, Inches(3.9), Inches(0.45),
             font_size=14, bold=True, color=WHITE, align=PP_ALIGN.CENTER,
             v_anchor=MSO_ANCHOR.MIDDLE)
    add_rect(slide3, lx, ty + Inches(0.45), Inches(3.9), Inches(0.85), WHITE, c, 1)
    add_text(slide3, d, lx + Inches(0.1), ty + Inches(0.5),
             Inches(3.7), Inches(0.75), font_size=13, color=DARKGRAY)


# ════════════════════════════════════════════════════════════════
# SLIDE 4 – THENAR MUSCLES TABLE
# ════════════════════════════════════════════════════════════════
slide4 = prs.slides.add_slide(blank)
slide_bg(slide4)
make_slide_header(slide4, "Thenar Muscles (4 Muscles)",
                  "Thumb eminence — median dominant with ulnar contribution")
footer(slide4)

# Mnemonic box
add_rect(slide4, Inches(0.4), Inches(1.3), Inches(12.5), Inches(0.55), TEAL)
add_text(slide4,
         "Mnemonic:  OAFL  →  Opponens pollicis | Abductor pollicis brevis | "
         "Flexor pollicis brevis | (Adductor pollicis = Ulnar)",
         Inches(0.5), Inches(1.32), Inches(12.2), Inches(0.5),
         font_size=13, bold=True, color=WHITE)

# Table headers
cols_w = [Inches(2.7), Inches(2.6), Inches(2.6), Inches(2.2), Inches(1.8)]
headers = ["Muscle", "Origin", "Insertion", "Action", "Nerve (Root)"]
hx = Inches(0.4)
hy = Inches(2.05)
for i, (hdr, cw) in enumerate(zip(headers, cols_w)):
    add_rect(slide4, hx, hy, cw - Inches(0.05), Inches(0.42), NAVY)
    add_text(slide4, hdr, hx + Inches(0.05), hy + Inches(0.03),
             cw - Inches(0.1), Inches(0.38),
             font_size=13, bold=True, color=WHITE, align=PP_ALIGN.CENTER)
    hx += cw

rows = [
    ("Abductor\npollicis brevis",
     "Scaphoid, trapezium,\nflexor retinaculum",
     "Base prox. phalanx\nthumb (radial sesamoid)",
     "Abduction of\nthumb",
     "Median (C8,T1)"),
    ("Flexor pollicis\nbrevis (sup. head)",
     "Flexor retinaculum",
     "Base prox. phalanx\nthumb (radial sesamoid)",
     "CMC flexion +\nopposition; MCP flex",
     "Median (C8,T1)"),
    ("Flexor pollicis\nbrevis (deep head)",
     "Capitate, trapezium",
     "Base prox. phalanx\nthumb (radial sesamoid)",
     "CMC flexion +\nopposition; MCP flex",
     "Ulnar (C8,T1)"),
    ("Opponens\npollicis",
     "Trapezium",
     "Radial border of\n1st metacarpal",
     "CMC opposition\nof thumb",
     "Median (C8,T1)"),
    ("Adductor\npollicis",
     "Trans: 3rd metacarpal;\nOblique: capitate, 2nd/3rd MC",
     "Base prox. phalanx\nthumb (ulnar sesamoid)",
     "CMC opposition;\nMCP flexion",
     "Ulnar (C8,T1)"),
]
row_colors = [LIGHTGRAY, WHITE, LIGHTBLUE, WHITE, LIGHTGRAY]
for ri, (row, rc) in enumerate(zip(rows, row_colors)):
    ry = Inches(2.47 + ri * 0.88)
    rx = Inches(0.4)
    for ci, (cell, cw) in enumerate(zip(row, cols_w)):
        ncol = RED if "Ulnar" in cell else (TEAL if "Median" in cell else DARKGRAY)
        add_rect(slide4, rx, ry, cw - Inches(0.05), Inches(0.85), rc, LIGHTBLUE, 0.5)
        add_text(slide4, cell, rx + Inches(0.05), ry + Inches(0.03),
                 cw - Inches(0.12), Inches(0.82),
                 font_size=12, color=ncol if ci == 4 else DARKGRAY,
                 bold=(ci == 4))
        rx += cw


# ════════════════════════════════════════════════════════════════
# SLIDE 5 – HYPOTHENAR MUSCLES TABLE
# ════════════════════════════════════════════════════════════════
slide5 = prs.slides.add_slide(blank)
slide_bg(slide5)
make_slide_header(slide5, "Hypothenar Muscles (4 Muscles)",
                  "Little finger eminence — all supplied by the Ulnar nerve (C8, T1)")
footer(slide5)

add_rect(slide5, Inches(0.4), Inches(1.3), Inches(12.5), Inches(0.55), RED)
add_text(slide5,
         "Key Rule: ALL 4 hypothenar muscles are innervated by the DEEP branch of "
         "Ulnar nerve (C8, T1) — no exceptions",
         Inches(0.5), Inches(1.32), Inches(12.2), Inches(0.5),
         font_size=13, bold=True, color=WHITE)

cols_w2 = [Inches(2.8), Inches(2.7), Inches(2.5), Inches(2.5), Inches(1.8)]
headers2 = ["Muscle", "Origin", "Insertion", "Action", "Nerve (Root)"]
hx = Inches(0.4)
hy = Inches(2.0)
for hdr, cw in zip(headers2, cols_w2):
    add_rect(slide5, hx, hy, cw - Inches(0.05), Inches(0.42), NAVY)
    add_text(slide5, hdr, hx + Inches(0.05), hy + Inches(0.03),
             cw - Inches(0.1), Inches(0.38),
             font_size=13, bold=True, color=WHITE, align=PP_ALIGN.CENTER)
    hx += cw

rows2 = [
    ("Abductor digiti\nminimi",
     "Pisiform",
     "Ulnar base prox. phalanx\n+ dorsal digital exp. 5th",
     "MCP flexion + abduction\nof little finger; PIP/DIP ext.",
     "Ulnar (deep)\nC8, T1"),
    ("Flexor digiti\nminimi brevis",
     "Hook of hamate,\nflexor retinaculum",
     "Base of prox. phalanx\nof 5th digit",
     "MCP flexion\nof little finger",
     "Ulnar (deep)\nC8, T1"),
    ("Opponens digiti\nminimi",
     "Hook of hamate,\nflexor retinaculum",
     "Ulnar border of\n5th metacarpal",
     "Draws 5th MC palmarly\n(opposition)",
     "Ulnar (deep)\nC8, T1"),
    ("Palmaris\nbrevis",
     "Ulnar border of\npalmar aponeurosis",
     "Skin of hypothenar\neminence",
     "Tightens palmar\naponeurosis (protective)",
     "Ulnar (superficial)\nC8, T1"),
]
row_colors2 = [LIGHTGRAY, WHITE, LIGHTGRAY, WHITE]
for ri, (row, rc) in enumerate(zip(rows2, row_colors2)):
    ry = Inches(2.45 + ri * 1.05)
    rx = Inches(0.4)
    for ci, (cell, cw) in enumerate(zip(row, cols_w2)):
        add_rect(slide5, rx, ry, cw - Inches(0.05), Inches(1.0), rc, LIGHTBLUE, 0.5)
        add_text(slide5, cell, rx + Inches(0.05), ry + Inches(0.03),
                 cw - Inches(0.12), Inches(0.95),
                 font_size=12, color=(RED if ci == 4 else DARKGRAY), bold=(ci == 4))
        rx += cw


# ════════════════════════════════════════════════════════════════
# SLIDE 6 – METACARPAL MUSCLES (LUMBRICALS + INTEROSSEI)
# ════════════════════════════════════════════════════════════════
slide6 = prs.slides.add_slide(blank)
slide_bg(slide6)
make_slide_header(slide6, "Metacarpal Muscles — Lumbricals & Interossei",
                  "11 muscles: 4 Lumbricals + 4 Dorsal Interossei + 3 Palmar Interossei")
footer(slide6)

# Lumbricals
add_rect(slide6, Inches(0.3), Inches(1.35), Inches(6.15), Inches(0.45), TEAL)
add_text(slide6, "Lumbricals (4) — Origin: FDP tendons | Action: MCP flex + IP extension",
         Inches(0.35), Inches(1.37), Inches(6.0), Inches(0.42),
         font_size=13, bold=True, color=WHITE)

lumb_data = [
    ("1st Lumbrical", "Radial side FDP → index", "Index finger (2nd)",   "Median", TEAL),
    ("2nd Lumbrical", "Radial side FDP → middle","Middle finger (3rd)",  "Median", TEAL),
    ("3rd Lumbrical", "Radial side FDP → ring",  "Ring finger (4th)",    "Ulnar",  RED),
    ("4th Lumbrical", "Radial side FDP → little","Little finger (5th)",  "Ulnar",  RED),
]
lx = Inches(0.3)
for i, (name, orig, ins, nerve, nc) in enumerate(lumb_data):
    ry = Inches(1.85 + i * 0.72)
    add_rect(slide6, lx, ry, Inches(1.5), Inches(0.65), nc)
    add_text(slide6, name, lx, ry, Inches(1.5), Inches(0.65),
             font_size=12, bold=True, color=WHITE, align=PP_ALIGN.CENTER,
             v_anchor=MSO_ANCHOR.MIDDLE)
    add_rect(slide6, lx + Inches(1.5), ry, Inches(2.4), Inches(0.65), LIGHTGRAY, nc, 0.5)
    add_text(slide6, orig, lx + Inches(1.55), ry + Inches(0.05),
             Inches(2.3), Inches(0.6), font_size=11, color=DARKGRAY)
    add_rect(slide6, lx + Inches(3.9), ry, Inches(2.0), Inches(0.65), WHITE, nc, 0.5)
    add_text(slide6, f"→ {ins}\n{nerve} nerve", lx + Inches(3.95), ry + Inches(0.05),
             Inches(1.9), Inches(0.6), font_size=11, color=nc, bold=True)

# Memory tip
add_rect(slide6, Inches(0.3), Inches(4.75), Inches(6.15), Inches(0.52), NAVY)
add_text(slide6, "Memory: 1&2 = Median (lateral/radial two)  |  3&4 = Ulnar (medial two)",
         Inches(0.35), Inches(4.77), Inches(6.0), Inches(0.48),
         font_size=13, bold=True, color=WHITE)

# Interossei
add_rect(slide6, Inches(6.7), Inches(1.35), Inches(6.3), Inches(0.45), ORANGE)
add_text(slide6, "Interossei (7) — ALL supplied by Ulnar nerve (C8, T1)",
         Inches(6.75), Inches(1.37), Inches(6.1), Inches(0.42),
         font_size=13, bold=True, color=WHITE)

inter_rows = [
    ("DAB = Dorsal ABduct (4 muscles)", NAVY),
    ("1st Dorsal IO → abducts index (radial)", DARKGRAY),
    ("2nd Dorsal IO → abducts middle (radial)", DARKGRAY),
    ("3rd Dorsal IO → abducts middle (ulnar)", DARKGRAY),
    ("4th Dorsal IO → abducts ring (ulnar)", DARKGRAY),
    ("PAD = Palmar ADduct (3 muscles)", NAVY),
    ("1st Palmar IO → adducts index toward middle", DARKGRAY),
    ("2nd Palmar IO → adducts ring toward middle", DARKGRAY),
    ("3rd Palmar IO → adducts little toward middle", DARKGRAY),
]
for i, (txt, col) in enumerate(inter_rows):
    ry = Inches(1.88 + i * 0.52)
    bg = NAVY if col == NAVY else (LIGHTGRAY if i % 2 == 0 else WHITE)
    add_rect(slide6, Inches(6.7), ry, Inches(6.3), Inches(0.48),
             LIGHTBLUE if col == NAVY else bg, TEAL, 0.5)
    add_text(slide6, txt, Inches(6.8), ry + Inches(0.04),
             Inches(6.1), Inches(0.42),
             font_size=12, bold=(col == NAVY),
             color=(NAVY if col == NAVY else DARKGRAY))

add_rect(slide6, Inches(6.7), Inches(6.6), Inches(6.3), Inches(0.42), RED)
add_text(slide6, "All 7 interossei = ULNAR NERVE only (deep branch, C8/T1)",
         Inches(6.75), Inches(6.62), Inches(6.1), Inches(0.38),
         font_size=13, bold=True, color=WHITE)


# ════════════════════════════════════════════════════════════════
# SLIDE 7 – NERVE SUPPLY SUMMARY
# ════════════════════════════════════════════════════════════════
slide7 = prs.slides.add_slide(blank)
slide_bg(slide7)
make_slide_header(slide7, "Nerve Supply Summary",
                  "Median vs. Ulnar — the LOAF rule & Ulnar dominance")
footer(slide7)

# LOAF box (median)
add_rect(slide7, Inches(0.4), Inches(1.35), Inches(6.0), Inches(5.5), WHITE, TEAL, 2)
add_rect(slide7, Inches(0.4), Inches(1.35), Inches(6.0), Inches(0.55), TEAL)
add_text(slide7, "MEDIAN NERVE  (Lateral 3½ muscles)",
         Inches(0.45), Inches(1.38), Inches(5.9), Inches(0.5),
         font_size=16, bold=True, color=WHITE)

loaf = [
    ("L", "Lumbricals 1 & 2", "(radial/lateral two)"),
    ("O", "Opponens pollicis", "(thenar)"),
    ("A", "Abductor pollicis brevis", "(thenar)"),
    ("F", "Flexor pollicis brevis", "(superficial head only)"),
]
for i, (letter, name, note) in enumerate(loaf):
    ry = Inches(2.05 + i * 0.95)
    add_rect(slide7, Inches(0.6), ry, Inches(0.55), Inches(0.75), TEAL)
    add_text(slide7, letter, Inches(0.6), ry, Inches(0.55), Inches(0.75),
             font_size=28, bold=True, color=WHITE, align=PP_ALIGN.CENTER,
             v_anchor=MSO_ANCHOR.MIDDLE)
    add_text(slide7, name, Inches(1.25), ry + Inches(0.04),
             Inches(4.9), Inches(0.42),
             font_size=15, bold=True, color=NAVY)
    add_text(slide7, note, Inches(1.25), ry + Inches(0.42),
             Inches(4.9), Inches(0.3),
             font_size=12, italic=True, color=MEDGRAY)

add_rect(slide7, Inches(0.4), Inches(5.9), Inches(6.0), Inches(0.52), TEAL)
add_text(slide7, "= 5 muscles (with dual supply on FPB)",
         Inches(0.45), Inches(5.92), Inches(5.9), Inches(0.48),
         font_size=13, bold=True, color=WHITE)

# Ulnar box
add_rect(slide7, Inches(6.8), Inches(1.35), Inches(6.2), Inches(5.5), WHITE, RED, 2)
add_rect(slide7, Inches(6.8), Inches(1.35), Inches(6.2), Inches(0.55), RED)
add_text(slide7, "ULNAR NERVE  (14 muscles — the majority)",
         Inches(6.85), Inches(1.38), Inches(6.1), Inches(0.5),
         font_size=16, bold=True, color=WHITE)

ulnar_groups = [
    ("Thenar", "Adductor pollicis; FPB deep head", NAVY),
    ("Hypothenar (all 4)", "Abductor DM, Flexor DM brevis,\nOpponens DM, Palmaris brevis", MEDGRAY),
    ("Lumbricals 3 & 4", "Medial/ulnar two lumbricals", NAVY),
    ("Dorsal Interossei", "All 4 (DAB — abduct)", MEDGRAY),
    ("Palmar Interossei", "All 3 (PAD — adduct)", NAVY),
]
for i, (group, desc, col) in enumerate(ulnar_groups):
    ry = Inches(2.05 + i * 0.9)
    add_rect(slide7, Inches(6.8), ry, Inches(2.0), Inches(0.82), RED)
    add_text(slide7, group, Inches(6.85), ry, Inches(1.95), Inches(0.82),
             font_size=12, bold=True, color=WHITE, v_anchor=MSO_ANCHOR.MIDDLE)
    add_rect(slide7, Inches(8.8), ry, Inches(4.2), Inches(0.82), LIGHTGRAY, RED, 0.5)
    add_text(slide7, desc, Inches(8.85), ry + Inches(0.05),
             Inches(4.1), Inches(0.75), font_size=12, color=DARKGRAY)

add_rect(slide7, Inches(6.8), Inches(6.5), Inches(6.2), Inches(0.52), RED)
add_text(slide7, "Ulnar nerve palsy → most intrinsic function lost",
         Inches(6.85), Inches(6.52), Inches(6.1), Inches(0.48),
         font_size=13, bold=True, color=WHITE)


# ════════════════════════════════════════════════════════════════
# SLIDE 8 – CLINICAL DEFORMITIES  (with images)
# ════════════════════════════════════════════════════════════════
slide8 = prs.slides.add_slide(blank)
slide_bg(slide8)
make_slide_header(slide8, "Clinical Deformities",
                  "Nerve palsy patterns and characteristic hand postures")
footer(slide8)

deformity_imgs = [
    "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_5c067a1ab45187ecb857086b314ff0306e07551dc62f46fee3986c9fca3428a7.jpg",
    "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_16fa1ee44eb2a924689b4080a6dd2266f056c8aef739ac8606a555c8db7d7d73.jpg",
]
print("Fetching deformity images...", file=sys.stderr)
imgs8 = fetch_imgs(*deformity_imgs)

cards = [
    {
        "title": "Claw Hand Deformity",
        "nerve": "Ulnar Nerve Palsy",
        "nc": RED,
        "points": [
            "Hyperextension at MCP joints (ring + little)",
            "Flexion at PIP + DIP joints",
            "Loss of lumbricals 3 & 4 + interossei",
            "'Ulnar paradox': worse in low lesions",
            "Hypothenar wasting + interosseous guttering",
        ],
        "img_idx": 0,
    },
    {
        "title": "Ape Thumb (Simian Hand)",
        "nerve": "Median Nerve Palsy",
        "nc": TEAL,
        "points": [
            "Flat thenar eminence (wasting)",
            "Thumb lies in same plane as palm",
            "Loss of opposition + abduction of thumb",
            "LOAF muscles paralysed",
            "Cannot perform pinch grip",
        ],
        "img_idx": 1,
    },
]
for i, card in enumerate(cards):
    lx = Inches(0.35 + i * 6.5)
    ty = Inches(1.35)
    cw = Inches(6.1)
    # header
    add_rect(slide8, lx, ty, cw, Inches(0.5), card["nc"])
    add_text(slide8, card["title"], lx, ty, cw * 0.6, Inches(0.5),
             font_size=15, bold=True, color=WHITE, v_anchor=MSO_ANCHOR.MIDDLE)
    add_rect(slide8, lx + cw * 0.6, ty, cw * 0.4, Inches(0.5),
             RGBColor(0x1A, 0x1A, 0x4A) if card["nc"] == RED else TEAL_DARK)
    add_text(slide8, card["nerve"], lx + cw * 0.6 + Inches(0.05), ty,
             cw * 0.4 - Inches(0.1), Inches(0.5),
             font_size=12, italic=True, color=WHITE, v_anchor=MSO_ANCHOR.MIDDLE)
    # image box
    img_h = Inches(2.2)
    add_rect(slide8, lx, ty + Inches(0.5), cw, img_h, RGBColor(0xEE, 0xEE, 0xEE))
    img_data = imgs8[i] if i < len(imgs8) else None
    if img_data and img_data.get("base64"):
        add_img_to_slide(slide8, img_data["base64"],
                         lx, ty + Inches(0.5), cw, img_h)
    else:
        add_text(slide8, "[Clinical image]", lx, ty + Inches(0.5) + Inches(0.8),
                 cw, Inches(0.5), font_size=13, color=MEDGRAY, align=PP_ALIGN.CENTER)
    # bullet points
    for bi, pt in enumerate(card["points"]):
        ry = Inches(1.35 + 0.5 + 2.2 + 0.15 + bi * 0.52)
        add_rect(slide8, lx + Inches(0.1), ry + Inches(0.12),
                 Inches(0.15), Inches(0.2), card["nc"])
        add_text(slide8, pt, lx + Inches(0.35), ry,
                 cw - Inches(0.45), Inches(0.5),
                 font_size=12.5, color=DARKGRAY)


# ════════════════════════════════════════════════════════════════
# SLIDE 9 – CLINICAL TESTS
# ════════════════════════════════════════════════════════════════
slide9 = prs.slides.add_slide(blank)
slide_bg(slide9)
make_slide_header(slide9, "Clinical Assessment Tests",
                  "Key bedside tests for hand muscle and nerve function")
footer(slide9)

# Froment image
froment_url = "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_39f2c58b09cc0caa1624cd230cbecbb5aa1415317c61acebbbb3f6d93679cf4e.jpg"
print("Fetching Froment image...", file=sys.stderr)
imgs9 = fetch_imgs(froment_url)

# Image left
add_rect(slide9, Inches(0.3), Inches(1.35), Inches(4.0), Inches(5.5),
         RGBColor(0xEE, 0xEE, 0xEE))
if imgs9 and imgs9[0].get("base64"):
    add_img_to_slide(slide9, imgs9[0]["base64"],
                     Inches(0.3), Inches(1.35), Inches(4.0), Inches(5.5))
else:
    add_text(slide9, "[Froment / Nerve test image]",
             Inches(0.3), Inches(3.5), Inches(4.0), Inches(0.5),
             font_size=12, color=MEDGRAY, align=PP_ALIGN.CENTER)

# Tests panel
tests = [
    ("Froment's Sign", "Ulnar nerve (adductor pollicis)",
     "Patient holds paper between thumb & index. Positive: thumb IP hyperflexes "
     "(FPL compensates for weak adductor pollicis).", RED),
    ("Pen Test / Abduction", "Ulnar nerve (1st dorsal interosseus)",
     "Ask patient to abduct index finger against resistance. Weakness/inability = "
     "1st DIO paralysis (Ulnar).", RED),
    ("Thumb Abduction (Ochsner's)", "Median nerve (APB)",
     "Patient places palms together and raises thumbs. Affected side cannot abduct — "
     "APB paralysis (Median nerve / carpal tunnel).", TEAL),
    ("Intrinsic Tightness Test", "Interossei / Lumbricals",
     "Passively flex PIP with MCP extended, then with MCP flexed. "
     "Increased resistance in extension = intrinsic tightness.", ORANGE),
    ("Grip & Pinch Strength", "Overall hand function",
     "Dynamometer grip + pinch gauge. Compare bilateral. Useful baseline for "
     "peripheral nerve injury + rehabilitation.", NAVY),
]
for i, (name, nerve, desc, color) in enumerate(tests):
    ry = Inches(1.35 + i * 1.05)
    add_rect(slide9, Inches(4.55), ry, Inches(8.4), Inches(1.0), WHITE, color, 1)
    add_rect(slide9, Inches(4.55), ry, Inches(0.3), Inches(1.0), color)
    add_text(slide9, name, Inches(4.95), ry + Inches(0.05),
             Inches(5.2), Inches(0.38),
             font_size=14, bold=True, color=color)
    add_text(slide9, f"Tests: {nerve}", Inches(4.95), ry + Inches(0.38),
             Inches(5.2), Inches(0.28),
             font_size=11, italic=True, color=MEDGRAY)
    add_text(slide9, desc, Inches(10.25), ry + Inches(0.05),
             Inches(2.6), Inches(0.92),
             font_size=11, color=DARKGRAY, word_wrap=True)


# ════════════════════════════════════════════════════════════════
# SLIDE 10 – KEY POINTS SUMMARY
# ════════════════════════════════════════════════════════════════
slide10 = prs.slides.add_slide(blank)
slide_bg(slide10)
make_slide_header(slide10, "Key Points — Quick Revision",
                  "Essential facts for clinical practice and examinations")
footer(slide10)

# Two columns
add_rect(slide10, Inches(0.3), Inches(1.35), Inches(6.2), Inches(5.8), WHITE, TEAL, 1.5)
add_rect(slide10, Inches(6.8), Inches(1.35), Inches(6.2), Inches(5.8), WHITE, NAVY, 1.5)

add_rect(slide10, Inches(0.3), Inches(1.35), Inches(6.2), Inches(0.5), TEAL)
add_text(slide10, "Anatomy Essentials", Inches(0.35), Inches(1.37),
         Inches(6.1), Inches(0.48), font_size=15, bold=True, color=WHITE)

add_rect(slide10, Inches(6.8), Inches(1.35), Inches(6.2), Inches(0.5), NAVY)
add_text(slide10, "Clinical Pearls", Inches(6.85), Inches(1.37),
         Inches(6.1), Inches(0.48), font_size=15, bold=True, color=WHITE)

anatomy_pts = [
    "19 total intrinsic hand muscles",
    "3 groups: Thenar (4), Hypothenar (4), Metacarpal (11)",
    "All root values: C8, T1",
    "LOAF = Median nerve (lateral 3½ muscles)",
    "FPB has DUAL supply (Median sup. head + Ulnar deep head)",
    "All interossei = Ulnar nerve only",
    "Lumbricals 1&2 = Median; 3&4 = Ulnar",
    "DAB (Dorsal ABduct) / PAD (Palmar ADduct)",
    "Palmaris brevis = Ulnar superficial branch",
    "Radial nerve = NO intrinsic hand muscles",
]
for i, pt in enumerate(anatomy_pts):
    ry = Inches(1.95 + i * 0.46)
    add_rect(slide10, Inches(0.45), ry + Inches(0.1),
             Inches(0.18), Inches(0.2), TEAL)
    add_text(slide10, pt, Inches(0.72), ry,
             Inches(5.65), Inches(0.44), font_size=12, color=DARKGRAY)

clinical_pts = [
    "Ulnar nerve palsy → claw hand (ring & little worst)",
    "Ulnar paradox: low lesion = worse claw than high",
    "Median nerve palsy → ape thumb (flat thenar)",
    "Carpal tunnel → LOAF muscles + sensory median",
    "Froment's sign = positive in Ulnar palsy (weak AdP)",
    "First DIO wasting = early Ulnar neuropathy sign",
    "Intrinsic minus hand = MCP ext + IP flexion",
    "Intrinsic plus hand = MCP flex + IP extension",
    "Guttering on dorsum = interossei atrophy (Ulnar)",
    "Guyon's canal = distal Ulnar compression site",
]
for i, pt in enumerate(clinical_pts):
    ry = Inches(1.95 + i * 0.46)
    add_rect(slide10, Inches(6.95), ry + Inches(0.1),
             Inches(0.18), Inches(0.2), NAVY)
    add_text(slide10, pt, Inches(7.22), ry,
             Inches(5.65), Inches(0.44), font_size=12, color=DARKGRAY)


# ════════════════════════════════════════════════════════════════
#  SAVE
# ════════════════════════════════════════════════════════════════
out = "/tmp/workspace/hand-anatomy-pptx/Hand_Muscle_Anatomy_and_Clinical_Assessment.pptx"
from io import BytesIO
buf = BytesIO()
prs.save(buf)
with open(out, "wb") as f:
    f.write(buf.getvalue())
print(f"Saved: {out}")
Your credits are exhausted. You can purchase a top-up or subscribe to a plan to continue using Orris. If you're already subscribed, your daily credits will reset tomorrow.
This is a shared conversation. Sign in to Orris to start your own chat.