make me flow charts of this in easy way in pdf
cd /home/daytona/workspace/attachments/415e06c6-0a8b-49f3-a790-6d255bafe482/ && python3 -c " import pdfplumber with pdfplumber.open('Here is a thorough definition and breakdown of Ana.pdf') as pdf: for i, page in enumerate(pdf.pages): print(f'--- PAGE {i+1} ---') print(page.extract_text()) print() "
mkdir -p /home/daytona/workspace/anatomical-flowcharts && python3 << 'PYEOF' import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import matplotlib.patches as mpatches from matplotlib.patches import FancyBboxPatch, FancyArrowPatch from matplotlib.backends.backend_pdf import PdfPages import numpy as np pdf_path = "/home/daytona/workspace/anatomical-flowcharts/Anatomical_Nomenclature_Flowcharts.pdf" # ── Color palette ────────────────────────────────────────────────────────────── C_TITLE = "#1A237E" # deep navy C_MAIN = "#1565C0" # blue C_SUB = "#0288D1" # lighter blue C_BOX = "#E3F2FD" # very light blue fill C_GREEN = "#2E7D32" C_GBOX = "#E8F5E9" C_ORANGE = "#E65100" C_OBOX = "#FFF3E0" C_PURPLE = "#6A1B9A" C_PBOX = "#F3E5F5" C_TEAL = "#00695C" C_TBOX = "#E0F2F1" C_GRAY = "#37474F" C_LGRAY = "#ECEFF1" WHITE = "#FFFFFF" C_HEAD = "#B71C1C" # red for header strip C_HTEXT = "#FFFFFF" def rounded_box(ax, x, y, w, h, fc, ec, text, fontsize=9, bold=False, text_color="black", radius=0.04, alpha=1.0, wrap=True): box = FancyBboxPatch((x - w/2, y - h/2), w, h, boxstyle=f"round,pad=0.02,rounding_size={radius}", linewidth=1.2, edgecolor=ec, facecolor=fc, alpha=alpha, zorder=3) ax.add_patch(box) weight = "bold" if bold else "normal" ax.text(x, y, text, ha="center", va="center", fontsize=fontsize, color=text_color, fontweight=weight, zorder=4, wrap=wrap, multialignment="center", bbox=dict(boxstyle="square,pad=0", fc="none", ec="none")) def arrow(ax, x1, y1, x2, y2, color="#455A64", lw=1.5): ax.annotate("", xy=(x2, y2), xytext=(x1, y1), arrowprops=dict(arrowstyle="-|>", color=color, lw=lw, mutation_scale=14)) def page_header(ax, title, subtitle=""): ax.set_xlim(0, 10); ax.set_ylim(0, 10) # header bar hbar = FancyBboxPatch((0, 9.3), 10, 0.7, boxstyle="square,pad=0", linewidth=0, facecolor=C_TITLE, zorder=5) ax.add_patch(hbar) ax.text(5, 9.65, title, ha="center", va="center", fontsize=14, fontweight="bold", color=WHITE, zorder=6) if subtitle: ax.text(5, 9.15, subtitle, ha="center", va="center", fontsize=8, color=C_GRAY, style="italic") ax.axis("off") # ══════════════════════════════════════════════════════════════════════════════ # PAGE 1 – OVERVIEW + ANATOMICAL POSITION # ══════════════════════════════════════════════════════════════════════════════ with PdfPages(pdf_path) as pdf: fig, ax = plt.subplots(figsize=(10, 12)) ax.set_xlim(0, 10); ax.set_ylim(0, 12) ax.axis("off") fig.patch.set_facecolor(WHITE) # ── Header ──────────────────────────────────────────────────────────────── hbar = FancyBboxPatch((0, 11.2), 10, 0.8, boxstyle="square,pad=0", linewidth=0, facecolor=C_TITLE, zorder=5) ax.add_patch(hbar) ax.text(5, 11.6, "ANATOMICAL NOMENCLATURE – OVERVIEW", ha="center", va="center", fontsize=15, fontweight="bold", color=WHITE, zorder=6) ax.text(5, 11.05, "Source: Gray's Anatomy for Students, Ch.1 pp. 18-20", ha="center", va="center", fontsize=8, color=C_GRAY, style="italic") # ── Central "Anatomical Nomenclature" node ──────────────────────────────── rounded_box(ax, 5, 10.1, 4.5, 0.65, C_MAIN, C_TITLE, "ANATOMICAL NOMENCLATURE", fontsize=12, bold=True, text_color=WHITE) arrow(ax, 5, 9.77, 5, 9.55) # ── Definition block ────────────────────────────────────────────────────── rounded_box(ax, 5, 9.1, 8.5, 0.8, C_BOX, C_MAIN, "Standardized system of terms to describe location, orientation\n" "& relationships of body structures — a universal reference language.", fontsize=8.5) # ── Four main branches ──────────────────────────────────────────────────── topics = [ (1.2, 7.9, "1. Anatomical\nPosition", C_GREEN, C_GBOX), (3.6, 7.9, "2. Anatomical\nPlanes", C_ORANGE, C_OBOX), (6.4, 7.9, "3. Terms of\nLocation", C_PURPLE, C_PBOX), (8.8, 7.9, "4. Inclusive\nTerminology", C_TEAL, C_TBOX), ] # connector from definition to branches for tx, ty, lbl, ec, fc in topics: arrow(ax, 5, 8.7, tx, ty + 0.35, color=ec) rounded_box(ax, tx, ty, 2.1, 0.7, fc, ec, lbl, fontsize=9, bold=True, text_color=ec) # ══ SECTION 1: ANATOMICAL POSITION ═══════════════════════════════════════ sec_y = 7.1 rounded_box(ax, 5, sec_y, 9.5, 0.45, C_GREEN, C_GREEN, "SECTION 1 — THE ANATOMICAL POSITION", fontsize=11, bold=True, text_color=WHITE) # Six bullet points bullets = [ "Body standing upright", "Feet together, toes pointing forward", "Hands by the sides, palms facing forward", "Face looking forward — mouth closed, neutral expression", "Inferior orbital margin in same horizontal plane as top of external auditory meatus", "Eyes open, focused in the distance", ] cols = [(1.5, [0,1,2]), (6.5, [3,4,5])] start_y = 6.55 for cx, idxs in cols: cy = start_y for i in idxs: rounded_box(ax, cx + 1.2, cy, 4.8, 0.45, C_GBOX, C_GREEN, bullets[i], fontsize=8.2) if i < idxs[-1]: arrow(ax, cx + 1.2, cy - 0.225, cx + 1.2, cy - 0.45 + 0.225 - 0.05, color=C_GREEN) cy -= 0.58 # Note box rounded_box(ax, 5, 4.7, 9.2, 0.4, "#F1F8E9", C_GREEN, "All anatomical terms are defined relative to the Anatomical Position", fontsize=8.5, bold=True, text_color=C_GREEN) # ── footer ──────────────────────────────────────────────────────────────── ax.text(5, 0.15, "Page 1 of 4 | Anatomical Nomenclature Flowcharts", ha="center", va="bottom", fontsize=7.5, color="#90A4AE") plt.tight_layout(pad=0.3) pdf.savefig(fig, dpi=150, bbox_inches="tight") plt.close() # ══════════════════════════════════════════════════════════════════════════ # PAGE 2 – ANATOMICAL PLANES # ══════════════════════════════════════════════════════════════════════════ fig, ax = plt.subplots(figsize=(10, 12)) ax.set_xlim(0, 10); ax.set_ylim(0, 12) ax.axis("off") fig.patch.set_facecolor(WHITE) # Header hbar = FancyBboxPatch((0, 11.2), 10, 0.8, boxstyle="square,pad=0", linewidth=0, facecolor=C_ORANGE, zorder=5) ax.add_patch(hbar) ax.text(5, 11.6, "SECTION 2 — ANATOMICAL PLANES", ha="center", va="center", fontsize=15, fontweight="bold", color=WHITE, zorder=6) ax.text(5, 11.05, "Three major groups of planes that divide the body", ha="center", va="center", fontsize=9, color=C_GRAY, style="italic") # Central node rounded_box(ax, 5, 10.3, 4, 0.55, C_ORANGE, C_ORANGE, "ANATOMICAL PLANES", fontsize=12, bold=True, text_color=WHITE) # Three plane cards planes = [ (1.6, "CORONAL\n(Frontal) Plane", "Orientation: Vertical", "Divides body into:\nAnterior (front) &\nPosterior (back) parts"), (5.0, "SAGITTAL PLANE", "Orientation: Vertical,\nperpendicular to coronal", "Divides body into:\nRight & Left parts\n\nMedian Sagittal: exactly\nthrough center →\nequal halves"), (8.4, "TRANSVERSE PLANE\n(Horizontal / Axial)", "Orientation: Horizontal", "Divides body into:\nSuperior (upper) &\nInferior (lower) parts"), ] ecs = [C_ORANGE, "#FF6F00", "#BF360C"] fcs = [C_OBOX, "#FFF8E1", "#FBE9E7"] for (px, title, orient, divides), ec, fc in zip(planes, ecs, fcs): arrow(ax, 5, 10.0, px, 9.35, color=ec) rounded_box(ax, px, 9.0, 2.8, 0.6, fc, ec, title, fontsize=9, bold=True, text_color=ec) arrow(ax, px, 8.7, px, 8.35, color=ec) rounded_box(ax, px, 8.0, 2.8, 0.6, WHITE, ec, orient, fontsize=8.5) arrow(ax, px, 7.7, px, 7.35, color=ec) rounded_box(ax, px, 6.8, 2.8, 0.9, fc, ec, divides, fontsize=8.2) # Summary table header rounded_box(ax, 5, 5.9, 9.2, 0.45, C_ORANGE, C_ORANGE, "QUICK REFERENCE TABLE", fontsize=10, bold=True, text_color=WHITE) table_rows = [ ("Coronal / Frontal", "Vertical", "Front ↔ Back"), ("Sagittal", "Vertical ⊥ coronal", "Right ↔ Left"), ("Median Sagittal", "Exactly central", "Equal R & L halves"), ("Transverse / Axial","Horizontal", "Upper ↔ Lower"), ] hdrs = ["PLANE", "ORIENTATION", "DIVIDES INTO"] hx = [1.5, 5, 8.5] hy = 5.45 for hdr, x in zip(hdrs, hx): rounded_box(ax, x, hy, 2.8, 0.38, C_ORANGE, C_ORANGE, hdr, fontsize=8.5, bold=True, text_color=WHITE) for i, (p, o, d) in enumerate(table_rows): ry = hy - 0.5*(i+1) bg = C_OBOX if i % 2 == 0 else WHITE for val, x in zip([p, o, d], hx): rounded_box(ax, x, ry, 2.8, 0.42, bg, "#FFB300", val, fontsize=8) ax.text(5, 0.15, "Page 2 of 4 | Anatomical Nomenclature Flowcharts", ha="center", va="bottom", fontsize=7.5, color="#90A4AE") plt.tight_layout(pad=0.3) pdf.savefig(fig, dpi=150, bbox_inches="tight") plt.close() # ══════════════════════════════════════════════════════════════════════════ # PAGE 3 – TERMS OF LOCATION & DIRECTION # ══════════════════════════════════════════════════════════════════════════ fig, ax = plt.subplots(figsize=(10, 14)) ax.set_xlim(0, 10); ax.set_ylim(0, 14) ax.axis("off") fig.patch.set_facecolor(WHITE) hbar = FancyBboxPatch((0, 13.2), 10, 0.8, boxstyle="square,pad=0", linewidth=0, facecolor=C_PURPLE, zorder=5) ax.add_patch(hbar) ax.text(5, 13.6, "SECTION 3 — TERMS OF LOCATION & DIRECTION", ha="center", va="center", fontsize=14, fontweight="bold", color=WHITE, zorder=6) ax.text(5, 13.05, "All terms are defined relative to the Anatomical Position", ha="center", va="center", fontsize=8.5, color=C_GRAY, style="italic") pairs = [ # (left_term, left_def, left_ex, right_term, right_def, right_ex, color, fc) ("ANTERIOR\n(Ventral)", "Toward the front\nof the body", "e.g. Nose is an\nanterior structure", "POSTERIOR\n(Dorsal)", "Toward the back\nof the body", "e.g. Vertebral column\nis posterior to sternum", C_PURPLE, C_PBOX), ("MEDIAL", "Closer to the\nmedian sagittal plane", "e.g. Nose is medial\nto the eyes", "LATERAL", "Farther from\nthe midline", "e.g. Thumb is lateral\nto the little finger", "#1565C0", "#E3F2FD"), ("SUPERIOR", "Toward the top\nof the body (head)", "e.g. Head is superior\nto the shoulders", "INFERIOR", "Toward the bottom\n(feet direction)", "e.g. Knee is inferior\nto the hip joint", C_GREEN, C_GBOX), ("PROXIMAL", "Closer to origin\nor point of attachment", "e.g. Glenohumeral joint\nis proximal to elbow", "DISTAL", "Farther from origin", "e.g. Hand is distal\nto the elbow", C_ORANGE, C_OBOX), ("CRANIAL", "Toward the head", "Used in embryology\n& comparative anatomy", "CAUDAL", "Toward the tail\n(inferior end of spine)", "Alternative to\nsuperior / inferior", "#6D4C41", "#EFEBE9"), ("ROSTRAL", "Toward the nose\n(within head / brain)", "e.g. Forebrain is\nrostral to hindbrain", "SUPERFICIAL", "Closer to the\nbody surface", "e.g. Sternum is\nsuperficial to heart", C_TEAL, C_TBOX), ("DEEP", "Farther from surface;\nwithin deep fascia", "e.g. Stomach is deep\nto abdominal wall", "", "", "", C_GRAY, C_LGRAY), ] sy = 12.5 for lt, ld, le, rt, rd, re, ec, fc in pairs: h = 1.0 # LEFT box rounded_box(ax, 2.2, sy - 0.0, 1.5, 0.38, ec, ec, lt, fontsize=8.5, bold=True, text_color=WHITE) rounded_box(ax, 2.2, sy - 0.45, 1.5, 0.38, fc, ec, ld, fontsize=7.5) rounded_box(ax, 2.2, sy - 0.9, 1.5, 0.38, WHITE, ec, le, fontsize=7.2, text_color="#555") arrow(ax, 2.2, sy - 0.38/2, 2.2, sy - 0.45 + 0.38/2 - 0.04, color=ec) arrow(ax, 2.2, sy - 0.45 - 0.38/2, 2.2, sy - 0.9 + 0.38/2 - 0.04, color=ec) # VS badge in middle ax.text(5, sy - 0.45, "↔", ha="center", va="center", fontsize=13, color=ec, fontweight="bold") # RIGHT box if rt: rounded_box(ax, 7.8, sy - 0.0, 1.5, 0.38, ec, ec, rt, fontsize=8.5, bold=True, text_color=WHITE) rounded_box(ax, 7.8, sy - 0.45, 1.5, 0.38, fc, ec, rd, fontsize=7.5) rounded_box(ax, 7.8, sy - 0.9, 1.5, 0.38, WHITE, ec, re, fontsize=7.2, text_color="#555") arrow(ax, 7.8, sy - 0.38/2, 7.8, sy - 0.45 + 0.38/2 - 0.04, color=ec) arrow(ax, 7.8, sy - 0.45 - 0.38/2, 7.8, sy - 0.9 + 0.38/2 - 0.04, color=ec) # horizontal divider ax.plot([0.3, 9.7], [sy - 1.1, sy - 1.1], color="#CFD8DC", lw=0.8) sy -= 1.3 ax.text(5, 0.15, "Page 3 of 4 | Anatomical Nomenclature Flowcharts", ha="center", va="bottom", fontsize=7.5, color="#90A4AE") plt.tight_layout(pad=0.3) pdf.savefig(fig, dpi=150, bbox_inches="tight") plt.close() # ══════════════════════════════════════════════════════════════════════════ # PAGE 4 – INCLUSIVE TERMINOLOGY + MASTER SUMMARY # ══════════════════════════════════════════════════════════════════════════ fig, ax = plt.subplots(figsize=(10, 13)) ax.set_xlim(0, 10); ax.set_ylim(0, 13) ax.axis("off") fig.patch.set_facecolor(WHITE) hbar = FancyBboxPatch((0, 12.2), 10, 0.8, boxstyle="square,pad=0", linewidth=0, facecolor=C_TEAL, zorder=5) ax.add_patch(hbar) ax.text(5, 12.6, "SECTION 4 — INCLUSIVE ANATOMICAL TERMINOLOGY", ha="center", va="center", fontsize=13, fontweight="bold", color=WHITE, zorder=6) # Context box rounded_box(ax, 5, 11.75, 9.2, 0.7, C_TBOX, C_TEAL, "Modern anatomy acknowledges that not all individuals fit a sex-binary model.\n" "Inclusive nomenclature considers transgender & non-binary individuals.", fontsize=8.5) # Principle boxes princ = [ "Use the patient's own\npreferred anatomical\nterminology", "Base clinical care on\npresent anatomy, not\ngender assumptions", "Inclusive terms reduce\nharm and improve\nclinical communication", ] for i, p in enumerate(princ): px = 1.5 + i * 3.3 rounded_box(ax, px, 10.8, 2.8, 0.75, C_TBOX, C_TEAL, p, fontsize=8.2, bold=False) # Table: inclusive terms rounded_box(ax, 5, 10.05, 9.2, 0.38, C_TEAL, C_TEAL, "INCLUSIVE TERM EXAMPLES", fontsize=9.5, bold=True, text_color=WHITE) inc_rows = [ ("Upper body", "Instead of: Chest / Breast"), ("Erectile tissue", "Instead of: Penis / Clitoris"), ("Gonads", "Instead of: Testes / Ovaries"), ] for i, (it, instead) in enumerate(inc_rows): ry = 9.6 - i * 0.5 bg = C_TBOX if i % 2 == 0 else WHITE rounded_box(ax, 2.2, ry, 3.5, 0.42, bg, C_TEAL, it, fontsize=8.5, bold=True, text_color=C_TEAL) rounded_box(ax, 7.0, ry, 4.5, 0.42, bg, "#80CBC4", instead, fontsize=8.2) # ── MASTER SUMMARY TABLE ────────────────────────────────────────────────── rounded_box(ax, 5, 7.85, 9.2, 0.45, C_TITLE, C_TITLE, "MASTER SUMMARY — ALL TERMS AT A GLANCE", fontsize=10.5, bold=True, text_color=WHITE) summary = [ ("Anterior / Ventral", "Front", C_PURPLE), ("Posterior / Dorsal", "Back", C_PURPLE), ("Superior", "Above / toward the head", C_GREEN), ("Inferior", "Below / toward the feet", C_GREEN), ("Medial", "Toward the midline", C_MAIN), ("Lateral", "Away from the midline", C_MAIN), ("Proximal", "Closer to origin", C_ORANGE), ("Distal", "Farther from origin", C_ORANGE), ("Cranial", "Toward the head", "#6D4C41"), ("Caudal", "Toward the tail", "#6D4C41"), ("Rostral", "Toward nose (head/brain)", C_TEAL), ("Superficial", "Toward body surface", C_TEAL), ("Deep", "Away from body surface", C_GRAY), ("Coronal plane", "Divides front & back", C_ORANGE), ("Sagittal plane", "Divides left & right", "#1565C0"), ("Transverse plane", "Divides top & bottom", C_GREEN), ] # Two columns left = summary[:8] right = summary[8:] for col_x, col_items in [(2.45, left), (7.45, right)]: cy = 7.35 for term, meaning, tc in col_items: bg = "#F9F9F9" if col_items.index((term, meaning, tc)) % 2 == 0 else WHITE rounded_box(ax, col_x - 0.85, cy, 1.8, 0.37, tc, tc, term, fontsize=7.5, bold=True, text_color=WHITE) rounded_box(ax, col_x + 1.35, cy, 2.2, 0.37, bg, "#B0BEC5", meaning, fontsize=7.5) cy -= 0.42 ax.text(5, 0.15, "Page 4 of 4 | Source: Gray's Anatomy for Students, Ch.1 pp.18-20", ha="center", va="bottom", fontsize=7.5, color="#90A4AE") plt.tight_layout(pad=0.3) pdf.savefig(fig, dpi=150, bbox_inches="tight") plt.close() print("PDF created successfully!") PYEOF
ls -lh /home/daytona/workspace/anatomical-flowcharts/
Anatomical Nomenclature Flowcharts
PDF Document · PDF
| Page | Content | Color |
|---|---|---|
| 1 | Overview + Anatomical Position (6 key points in a step-by-step flow) | Green |
| 2 | Anatomical Planes (Coronal / Sagittal / Transverse) with a quick-reference table | Orange |
| 3 | Terms of Location & Direction (Anterior/Posterior, Medial/Lateral, Superior/Inferior, Proximal/Distal, Cranial/Caudal, Rostral, Superficial/Deep) - shown as paired cards with examples | Purple |
| 4 | Inclusive Anatomical Terminology + Master Summary Table (all 16 terms at a glance) | Teal |