Anatomy of portal venous system and portosystemic anastomoses. Give me points for this for me to add in my canva slides
portal venous system portosystemic anastomoses diagram
esophageal varices caput medusae portal hypertension collateral circulation

Bro I want portal venous system one slide and portosytemic anastomoses one slide

Can u give me a generated AI slide for this
mkdir -p /tmp/workspace/portal-venous-slides/assets && ls -la /tmp/workspace/
cd /tmp/workspace/portal-venous-slides && python /tmp/skills/shared/scripts/fetch_images.py "https://cdn.orris.care/cdss_images/384421f0e57fb5b82508f6a3750b8aa6be72989b8f0ba7d2e0c0e15423922bd2.png" > assets/img_result.json && python3 -c " import json, base64 data = json.load(open('assets/img_result.json')) for i, img in enumerate(data): if img['base64']: header, b64 = img['base64'].split(',',1) ext = 'png' if 'png' in header else 'jpg' raw = base64.b64decode(b64) with open(f'assets/anastomoses.{ext}','wb') as f: f.write(raw) print('saved', f'assets/anastomoses.{ext}', len(raw)) else: print('error', img.get('error')) "
~/portal-venous-slides/build_deck.py
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
# ---------- Theme ----------
DARK_TEAL = RGBColor(0x0B, 0x3D, 0x3E)
TEAL = RGBColor(0x14, 0x6B, 0x6E)
ACCENT = RGBColor(0xC7, 0x4A, 0x3A) # deep maroon/rust accent
LIGHT_BG = RGBColor(0xF5, 0xF3, 0xEC)
WHITE = RGBColor(0xFF, 0xFF, 0xFF)
DARK_TEXT = RGBColor(0x22, 0x2B, 0x2B)
GREY_TEXT = RGBColor(0x55, 0x5D, 0x5D)
prs = Presentation()
prs.slide_width = Inches(13.333)
prs.slide_height = Inches(7.5)
blank = prs.slide_layouts[6]
def set_bg(slide, color):
fill = slide.background.fill
fill.solid()
fill.fore_color.rgb = color
def add_rect(slide, x, y, w, h, color, line=False):
shp = slide.shapes.add_shape(MSO_SHAPE.RECTANGLE, x, y, w, h)
shp.fill.solid()
shp.fill.fore_color.rgb = color
shp.line.fill.background() if not line else None
shp.shadow.inherit = False
return shp
def add_text(slide, x, y, w, h, text, size, color, bold=False, italic=False,
align=PP_ALIGN.LEFT, font="Calibri", anchor=None, line_spacing=1.0):
tb = slide.shapes.add_textbox(x, y, w, h)
tf = tb.text_frame
tf.word_wrap = True
if anchor:
tf.vertical_anchor = anchor
p = tf.paragraphs[0]
p.text = text
p.alignment = align
p.line_spacing = line_spacing
r = p.runs[0]
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_TEXT, font="Calibri",
space_after=8, line_spacing=1.08):
"""items: list of (level, text, bold_lead_or_None)"""
tb = slide.shapes.add_textbox(x, y, w, h)
tf = tb.text_frame
tf.word_wrap = True
first = True
for level, text, lead in items:
p = tf.paragraphs[0] if first else tf.add_paragraph()
first = False
p.level = level
p.space_after = Pt(space_after)
p.line_spacing = line_spacing
marker = "● " if level == 0 else "- "
if lead:
r1 = p.add_run()
r1.text = marker + lead
r1.font.bold = True
r1.font.size = Pt(size)
r1.font.color.rgb = ACCENT if level == 0 else TEAL
r1.font.name = font
r2 = p.add_run()
r2.text = text
r2.font.size = Pt(size)
r2.font.color.rgb = color
r2.font.name = font
else:
r1 = p.add_run()
r1.text = marker + text
r1.font.size = Pt(size)
r1.font.color.rgb = color if level == 0 else GREY_TEXT
r1.font.name = font
if level == 0:
r1.font.bold = False
return tb
def header(slide, kicker, title):
set_bg(slide, LIGHT_BG)
# top band
add_rect(slide, 0, 0, prs.slide_width, Inches(1.35), DARK_TEAL)
add_rect(slide, 0, Inches(1.35), prs.slide_width, Inches(0.06), ACCENT)
add_text(slide, Inches(0.6), Inches(0.18), Inches(8), Inches(0.35), kicker.upper(),
13, RGBColor(0xB9,0xD9,0xD6), bold=True, font="Calibri")
add_text(slide, Inches(0.6), Inches(0.5), Inches(11.5), Inches(0.8), title,
32, WHITE, bold=True, font="Calibri")
def footer(slide, note, page_no):
add_text(slide, Inches(0.6), Inches(7.12), Inches(9), Inches(0.3), note,
10, GREY_TEXT, italic=True, font="Calibri")
add_text(slide, Inches(12.5), Inches(7.12), Inches(0.6), Inches(0.3), str(page_no),
10, GREY_TEXT, align=PP_ALIGN.RIGHT, font="Calibri")
# ============================================================
# SLIDE 1 — Portal Venous System
# ============================================================
s1 = prs.slides.add_slide(blank)
header(s1, "Hepatobiliary Anatomy", "Portal Venous System")
# Left column: formation + course
left_x = Inches(0.6)
col_w = Inches(6.0)
add_text(s1, left_x, Inches(1.65), col_w, Inches(0.4), "Formation & Course", 17, DARK_TEAL, bold=True)
items_left = [
(0, "Union of the ", "Definition: "),
]
# custom manual bullets for richer control
tb = s1.shapes.add_textbox(left_x, Inches(2.05), col_w, Inches(4.6))
tf = tb.text_frame
tf.word_wrap = True
def para(tf, first, lead, rest, size=14.5, lead_color=ACCENT, rest_color=DARK_TEXT, level=0, space_after=9):
p = tf.paragraphs[0] if first else tf.add_paragraph()
p.level = level
p.space_after = Pt(space_after)
p.line_spacing = 1.12
marker = "● " if level == 0 else " - "
r1 = p.add_run(); r1.text = marker + (lead if lead else "")
r1.font.bold = bool(lead); r1.font.size = Pt(size); r1.font.color.rgb = lead_color if level==0 else TEAL
r1.font.name = "Calibri"
if rest:
r2 = p.add_run(); r2.text = rest
r2.font.size = Pt(size); r2.font.color.rgb = rest_color; r2.font.name = "Calibri"
return p
para(tf, True, "Definition: ", "final common pathway draining venous blood from the spleen, pancreas, gallbladder, and abdominal GI tract to the liver")
para(tf, False, "Formation: ", "union of the splenic vein + superior mesenteric vein, posterior to the neck of the pancreas, at vertebral level L2")
para(tf, False, "Course: ", "ascends posterior to the 1st part of duodenum, enters the right free margin of the lesser omentum")
para(tf, False, "", "within lesser omentum: posterior to bile duct (right) & hepatic artery proper (left); anterior to the epiploic (omental) foramen", lead_color=TEAL, level=1)
para(tf, False, "Termination: ", "divides into right and left branches on approaching the liver, entering the liver parenchyma")
# Right column: tributaries + contributing veins
right_x = Inches(6.9)
col_w2 = Inches(5.9)
add_text(s1, right_x, Inches(1.65), col_w2, Inches(0.4), "Tributaries & Contributing Veins", 17, DARK_TEAL, bold=True)
tb2 = s1.shapes.add_textbox(right_x, Inches(2.05), col_w2, Inches(4.6))
tf2 = tb2.text_frame
tf2.word_wrap = True
para(tf2, True, "Direct tributaries: ", "right & left gastric veins, cystic veins, para-umbilical veins")
para(tf2, False, "Splenic vein: ", "arises at splenic hilum, runs through splenorenal ligament with splenic artery + pancreatic tail; receives short gastric, left gastro-omental, pancreatic veins, and usually the inferior mesenteric vein")
para(tf2, False, "Superior mesenteric vein: ", "drains small intestine, cecum, ascending & transverse colon; begins in right iliac fossa, ascends to the RIGHT of the SMA")
para(tf2, False, "Clinical relevance: ", "portal vein pressure & patency are key in cirrhosis, portal hypertension, and pre-op vascular planning (e.g., pancreaticoduodenectomy)")
footer(s1, "Source: Gray's Anatomy for Students, 7th ed., Fig. 4.132-4.133, p. 417-418", 1)
# ============================================================
# SLIDE 2 — Portosystemic Anastomoses
# ============================================================
s2 = prs.slides.add_slide(blank)
header(s2, "Hepatobiliary Anatomy", "Portosystemic Anastomoses")
# Left: text content
left_x2 = Inches(0.6)
col_w3 = Inches(6.5)
add_text(s2, left_x2, Inches(1.6), col_w3, Inches(0.75),
"Normal communications between the portal and systemic (caval) venous systems; open up in portal hypertension (e.g., cirrhosis) to divert blood away from the liver.",
13.5, GREY_TEXT, italic=True, line_spacing=1.15)
tb3 = s2.shapes.add_textbox(left_x2, Inches(2.55), col_w3, Inches(4.3))
tf3 = tb3.text_frame
tf3.word_wrap = True
para(tf3, True, "1. Gastroesophageal junction: ", "left gastric vein (portal) <-> azygos vein tributaries (systemic) -> esophageal varices", size=14.5)
para(tf3, False, "2. Anorectal junction: ", "superior rectal vein (portal) <-> middle/inferior rectal veins (systemic) -> anorectal varices", size=14.5)
para(tf3, False, "3. Umbilicus / abdominal wall: ", "para-umbilical veins (portal) <-> superficial epigastric veins (systemic) -> caput medusae", size=14.5)
para(tf3, False, "Bonus site - Retroperitoneal (veins of Retzius): ", "mesenteric/colonic veins <-> renal, lumbar & phrenic veins; may form large spontaneous splenorenal shunts", size=13.5, lead_color=TEAL)
para(tf3, False, "Clinical note: ", "esophageal varices are fragile and prone to profuse, life-threatening hemorrhage - the most urgent of the three", size=13.5, lead_color=ACCENT)
# Right: image panel with border and caption
img_path = "/tmp/workspace/portal-venous-slides/assets/anastomoses.jpg"
pic_x, pic_y, pic_w = Inches(7.35), Inches(1.55), Inches(5.5)
frame = add_rect(s2, pic_x - Inches(0.08), pic_y - Inches(0.08), pic_w + Inches(0.16), Inches(5.15), WHITE)
frame.line.color.rgb = TEAL
frame.line.width = Pt(1.5)
pic = s2.shapes.add_picture(img_path, pic_x, pic_y, width=pic_w)
add_text(s2, pic_x - Inches(0.08), pic_y + Inches(5.05), pic_w + Inches(0.16), Inches(0.3),
"Fig. Portosystemic anastomoses (Gray's Anatomy for Students, Fig. 4.134)", 10.5, GREY_TEXT, italic=True, align=PP_ALIGN.CENTER)
footer(s2, "Source: Gray's Anatomy for Students, 7th ed., Fig. 4.134-4.135, p. 419-420", 2)
prs.save("/tmp/workspace/portal-venous-slides/Portal_Venous_System_and_Portosystemic_Anastomoses.pptx")
print("Saved.")
cd /tmp/workspace/portal-venous-slides && python3 build_deck.py
cd /tmp/workspace/portal-venous-slides && ls /tmp/skills/pptx/scripts/ 2>/dev/null; ls /tmp/skills/shared/scripts/ 2>/dev/null; which libreoffice soffice 2>/dev/null; echo done
cd /tmp/workspace/portal-venous-slides && python3 -c " from PIL import Image im = Image.open('assets/anastomoses.jpg') print(im.size) w,h = im.size pic_w_in = 5.5 pic_h_in = pic_w_in * h / w print('height in inches at width 5.5:', pic_h_in) "
~/portal-venous-slides/build_deck.py
Successfully replaced 1 instance(s) of the string in '/tmp/workspace/portal-venous-slides/build_deck.py'
cd /tmp/workspace/portal-venous-slides && python3 build_deck.py && ls -la
Portal Venous System and Portosystemic Anastomoses
Presentation · PPTX