Great now add all these new information in above ppt and make the ppt look more provisional use black and white colour and for certaim accents use different colours like orange green purple
cd /home/daytona/workspace && python -m markitdown "/home/daytona/workspace/attachments/f2c91571-dfd0-41ea-a6a6-3b78e21104c6/Hepatobiliary_Anatomy_Congenital_Anomalies.pptx" 2>&1 | head -300
python3 -c " import pdfplumber text = '' with pdfplumber.open('/home/daytona/workspace/attachments/f2c91571-dfd0-41ea-a6a6-3b78e21104c6/response.pdf') as pdf: for page in pdf.pages: t = page.extract_text() if t: text += t + '\n' print(text[:6000]) "
python3 -c " import pdfplumber text = '' with pdfplumber.open('/home/daytona/workspace/attachments/f2c91571-dfd0-41ea-a6a6-3b78e21104c6/response (1).pdf') as pdf: for page in pdf.pages: t = page.extract_text() if t: text += t + '\n' print(text[:6000]) "
python3 -c " import pdfplumber text = '' with pdfplumber.open('/home/daytona/workspace/attachments/f2c91571-dfd0-41ea-a6a6-3b78e21104c6/response.pdf') as pdf: for page in pdf.pages: t = page.extract_text() if t: text += t + '\n' print(text[6000:]) " 2>&1 | head -300
python3 -c " import pdfplumber text = '' with pdfplumber.open('/home/daytona/workspace/attachments/f2c91571-dfd0-41ea-a6a6-3b78e21104c6/response (1).pdf') as pdf: for page in pdf.pages: t = page.extract_text() if t: text += t + '\n' print(text[6000:]) " 2>&1 | head -300
python3 /home/daytona/skills/pptx/scripts/office/unpack.py "/home/daytona/workspace/attachments/f2c91571-dfd0-41ea-a6a6-3b78e21104c6/Hepatobiliary_Anatomy_Congenital_Anomalies.pptx" /home/daytona/workspace/hepato_unpacked/ 2>&1
python3 /home/daytona/skills/pptx/scripts/office/unpack.py "/home/daytona/workspace/attachments/f2c91571-dfd0-41ea-a6a6-3b78e21104c6/Hepatobiliary_Anatomy_Congenital_Anomalies.pptx" /home/daytona/workspace/hepato_unpacked/ 2>&1
mkdir -p /home/daytona/workspace/hepato_unpacked && cd /home/daytona/workspace/hepato_unpacked && cp "/home/daytona/workspace/attachments/f2c91571-dfd0-41ea-a6a6-3b78e21104c6/Hepatobiliary_Anatomy_Congenital_Anomalies.pptx" ./source.pptx && unzip -o source.pptx -d raw/ > /dev/null 2>&1 && echo "done" && ls raw/ppt/slides/ | head -30
Continue
python3 -c " from pptx import Presentation prs = Presentation('/home/daytona/workspace/attachments/f2c91571-dfd0-41ea-a6a6-3b78e21104c6/Hepatobiliary_Anatomy_Congenital_Anomalies.pptx') for i, slide in enumerate(prs.slides): print(f'=== SLIDE {i+1} ===') for shape in slide.shapes: if shape.has_text_frame: for para in shape.text_frame.paragraphs: t = para.text.strip() if t: print(t) print() " 2>&1
mkdir -p /home/daytona/workspace/hepato_ppt && cat > /home/daytona/workspace/hepato_ppt/build.js << 'JSEOF' const pptxgen = require("pptxgenjs"); const prs = new pptxgen(); prs.layout = "LAYOUT_WIDE"; prs.title = "Hepatobiliary System — Anatomy & Congenital Anomalies"; // ── PALETTE ────────────────────────────────────────────────────────────────── const BG = "0D0D0D"; // near-black slide background const WHITE = "FFFFFF"; const LGRAY = "CCCCCC"; // light grey body text const MGRAY = "888888"; // muted grey const ORANGE = "E8730A"; // accent 1 const GREEN = "3CB371"; // accent 2 const PURPLE = "9B5DE5"; // accent 3 const DKGRAY = "1A1A1A"; // card background // ── HELPERS ────────────────────────────────────────────────────────────────── function addSlide(opts = {}) { const s = prs.addSlide(); s.addShape(prs.ShapeType.rect, { x: 0, y: 0, w: "100%", h: "100%", fill: { color: BG }, line: { color: BG } }); return s; } function titleBar(s, text, accentColor) { // left accent stripe s.addShape(prs.ShapeType.rect, { x: 0, y: 0, w: 0.12, h: 5.625, fill: { color: accentColor }, line: { color: accentColor } }); // title text s.addText(text, { x: 0.28, y: 0.22, w: 12.5, h: 0.6, fontSize: 22, bold: true, color: WHITE, fontFace: "Calibri" }); // thin divider line s.addShape(prs.ShapeType.rect, { x: 0.28, y: 0.9, w: 12.5, h: 0.03, fill: { color: accentColor }, line: { color: accentColor } }); } function sectionHeader(s, num, title, subtitle, color) { s.addShape(prs.ShapeType.rect, { x: 0, y: 0, w: "100%", h: "100%", fill: { color: BG }, line: { color: BG } }); s.addShape(prs.ShapeType.rect, { x: 0, y: 2.2, w: "100%", h: 1.2, fill: { color: color }, line: { color: color } }); s.addText(num, { x: 0.5, y: 0.5, w: 12.3, h: 1.5, fontSize: 80, bold: true, color: "1A1A1A", fontFace: "Calibri", align: "center", transparency: 75 }); s.addText(title, { x: 0.5, y: 2.3, w: 12.3, h: 0.9, fontSize: 36, bold: true, color: WHITE, fontFace: "Calibri", align: "center" }); s.addText(subtitle, { x: 0.5, y: 3.55, w: 12.3, h: 0.6, fontSize: 16, color: LGRAY, fontFace: "Calibri", align: "center", italic: true }); } function bullet(text, level, color, isBold) { return { text, options: { bullet: { type: "bullet" }, indentLevel: level || 0, fontSize: 13, color: color || LGRAY, fontFace: "Calibri", bold: isBold || false, breakLine: true, paraSpaceBefore: 2 } }; } function heading(text, color) { return { text, options: { bullet: false, fontSize: 14, bold: true, color: color || ORANGE, fontFace: "Calibri", breakLine: true, paraSpaceBefore: 8 } }; } function body(text) { return { text, options: { bullet: false, fontSize: 12.5, color: LGRAY, fontFace: "Calibri", breakLine: true, paraSpaceBefore: 2 } }; } function card(s, x, y, w, h, title, lines, titleColor) { s.addShape(prs.ShapeType.roundRect, { x, y, w, h, rectRadius: 0.08, fill: { color: DKGRAY }, line: { color: titleColor || ORANGE, pt: 1.2 } }); s.addText(title, { x: x+0.15, y: y+0.08, w: w-0.3, h: 0.35, fontSize: 12, bold: true, color: titleColor || ORANGE, fontFace: "Calibri" }); const items = lines.map(l => ({ text: l, options: { bullet: { type: "bullet" }, fontSize: 11, color: LGRAY, fontFace: "Calibri", breakLine: true, paraSpaceBefore: 1 } })); s.addText(items, { x: x+0.12, y: y+0.42, w: w-0.24, h: h-0.52, fontFace: "Calibri", valign: "top" }); } function labelBox(s, x, y, w, h, label, color) { s.addShape(prs.ShapeType.rect, { x, y, w, h, fill: { color: color }, line: { color: color } }); s.addText(label, { x, y, w, h, fontSize: 11, bold: true, color: BG, fontFace: "Calibri", align: "center", valign: "middle" }); } // ═══════════════════════════════════════════════════════════════════════════ // SLIDE 1 — TITLE // ═══════════════════════════════════════════════════════════════════════════ { const s = addSlide(); // decorative bars s.addShape(prs.ShapeType.rect, { x: 0, y: 0, w: "100%", h: 0.18, fill: { color: ORANGE }, line: { color: ORANGE } }); s.addShape(prs.ShapeType.rect, { x: 0, y: 5.44, w: "100%", h: 0.18, fill: { color: PURPLE }, line: { color: PURPLE } }); s.addShape(prs.ShapeType.rect, { x: 0, y: 5.3, w: "100%", h: 0.14, fill: { color: GREEN }, line: { color: GREEN } }); // main title s.addText("HEPATOBILIARY SYSTEM", { x: 0.5, y: 0.7, w: 12.3, h: 1.1, fontSize: 52, bold: true, color: WHITE, fontFace: "Calibri", align: "center", charSpacing: 3 }); s.addText("Anatomy & Congenital Anomalies", { x: 0.5, y: 1.75, w: 12.3, h: 0.7, fontSize: 28, color: ORANGE, fontFace: "Calibri", align: "center", italic: true }); s.addShape(prs.ShapeType.rect, { x: 3.5, y: 2.55, w: 6.3, h: 0.04, fill: { color: MGRAY }, line: { color: MGRAY } }); // contents summary s.addText([ { text: "Topographic Anatomy • ", options: { color: LGRAY } }, { text: "Couinaud Segments • ", options: { color: GREEN } }, { text: "Arteriovenous Supply • ", options: { color: ORANGE } }, { text: "Biliary System • ", options: { color: PURPLE } }, { text: "Congenital Anomalies", options: { color: LGRAY } } ], { x: 0.5, y: 2.7, w: 12.3, h: 0.5, fontSize: 14, fontFace: "Calibri", align: "center" }); s.addText("Sources: Mulholland & Greenfield Surgery 7e | Sabiston Surgery 21e | Fischer's Mastery of Surgery 8e\nGray's Anatomy for Students | Yamada's Gastroenterology 7e | Robbins Pathology 11e", { x: 0.5, y: 4.7, w: 12.3, h: 0.55, fontSize: 10, color: MGRAY, fontFace: "Calibri", align: "center", italic: true }); } // ═══════════════════════════════════════════════════════════════════════════ // SLIDE 2 — CONTENTS // ═══════════════════════════════════════════════════════════════════════════ { const s = addSlide(); titleBar(s, "Contents", ORANGE); const items = [ ["01", "Topographic & Surface Anatomy", "Position, relations, ligaments, bare area, portal triad", ORANGE], ["02", "Couinaud Classification — Deep Dive", "8 segments, sectors, hemilivers, Cantlie's line, surgical relevance", GREEN], ["03", "Arterial Supply", "CHA, PHA, variants in up to 40%; Segment IV supply", ORANGE], ["04", "Portal Vein", "Formation, divisions, RPV/LPV, caudate supply", GREEN], ["05", "Hepatic Venous Outflow", "RHV, MHV, LHV, accessory veins, dual blood supply", ORANGE], ["06", "Biliary Tree — Intrahepatic", "Canaliculi, ductules, segmental ducts, key variants", PURPLE], ["07", "Biliary Tree — Extrahepatic + Gallbladder", "CHD, CBD 4 segments, cystic duct, Calot's, Sphincter of Oddi", PURPLE], ["08", "Bile Flow & Enterohepatic Circulation", "CCK, Sphincter of Oddi, bile acid cycling", GREEN], ["09", "Congenital Anomalies", "Biliary atresia, choledochal cysts, Caroli, Alagille, GB anomalies", ORANGE], ]; items.forEach(([num, title, sub, col], i) => { const row = Math.floor(i / 3); const col_i = i % 3; const x = 0.28 + col_i * 4.35; const y = 1.05 + row * 1.5; s.addShape(prs.ShapeType.rect, { x, y, w: 4.15, h: 0.06, fill: { color: col }, line: { color: col } }); s.addText(num, { x, y: y+0.1, w: 4.15, h: 0.38, fontSize: 22, bold: true, color: col, fontFace: "Calibri" }); s.addText(title, { x, y: y+0.46, w: 4.15, h: 0.38, fontSize: 13, bold: true, color: WHITE, fontFace: "Calibri" }); s.addText(sub, { x, y: y+0.83, w: 4.15, h: 0.5, fontSize: 10.5, color: MGRAY, fontFace: "Calibri", italic: true }); }); } // ═══════════════════════════════════════════════════════════════════════════ // SLIDE 3 — SECTION BREAK: TOPOGRAPHIC ANATOMY // ═══════════════════════════════════════════════════════════════════════════ { const s = addSlide(); sectionHeader(s, "01", "Topographic & Surface Anatomy", "Position, relations, ligaments, and surface landmarks", ORANGE); } // ═══════════════════════════════════════════════════════════════════════════ // SLIDE 4 — TOPOGRAPHIC ANATOMY // ═══════════════════════════════════════════════════════════════════════════ { const s = addSlide(); titleBar(s, "01 — Topographic & Surface Anatomy", ORANGE); // Left column s.addText([ heading("Position & General Relations"), bullet("Large wedge-shaped organ — right upper quadrant", 0, LGRAY), bullet("Bounded superiorly/posteriorly by diaphragm & retroperitoneum", 0, LGRAY), bullet("Inferiorly: stomach, gallbladder, hepatoduodenal ligament, duodenum", 0, LGRAY), bullet("Hepatic flexure of colon, right adrenal gland, right kidney", 0, LGRAY), bullet("Portal structures enter via hepatoduodenal ligament at porta hepatis", 0, LGRAY), heading("Hepatoduodenal Ligament — Portal Triad"), bullet("Portal vein — posteromedial (deepest)", 0, LGRAY), bullet("Hepatic artery — anteromedial (left)", 0, LGRAY), bullet("Bile duct — anterolateral (right)", 0, LGRAY), bullet("Pringle manoeuvre: compress ligament to control hemorrhage", 0, ORANGE, true), ], { x: 0.28, y: 1.0, w: 6.1, h: 4.4, fontFace: "Calibri", valign: "top" }); // Right column s.addText([ heading("Surface Landmarks", GREEN), bullet("Rouviere sulcus — right inferior surface; border between ant. & post. right liver", 0, LGRAY), bullet("Arantius cleft (Rex recessus) — separates caudate from left liver; contains ligamentum venosum", 0, LGRAY), bullet("Falciform ligament — liver to anterior abdominal wall; contains ligamentum teres", 0, LGRAY), bullet("Bare area — posterior surface devoid of peritoneum; bounded by coronary & right triangular ligaments", 0, LGRAY), heading("Ligamentous Attachments", GREEN), bullet("Falciform / Ligamentum teres → suprahepatic IVC", 0, LGRAY), bullet("Coronary lig. → posterior peritoneal reflection; defines bare area", 0, LGRAY), bullet("Right triangular lig. → lateral limit of bare area", 0, LGRAY), bullet("Left triangular lig. → left lobe to diaphragm", 0, LGRAY), bullet("Gastrohepatic lig. → connects to ligamentum venosum in Arantius cleft", 0, LGRAY), bullet("Hepatoduodenal lig. → free edge of lesser omentum; portal triad", 0, LGRAY), ], { x: 6.7, y: 1.0, w: 6.1, h: 4.4, fontFace: "Calibri", valign: "top" }); } // ═══════════════════════════════════════════════════════════════════════════ // SLIDE 5 — SECTION BREAK: COUINAUD // ═══════════════════════════════════════════════════════════════════════════ { const s = addSlide(); sectionHeader(s, "02", "Couinaud Classification", "8 segments, sectors, hemilivers, Cantlie's line", GREEN); } // ═══════════════════════════════════════════════════════════════════════════ // SLIDE 6 — COUINAUD CORE PRINCIPLES // ═══════════════════════════════════════════════════════════════════════════ { const s = addSlide(); titleBar(s, "02 — Couinaud Classification: Core Principles", GREEN); s.addText([ heading("Historical Context", GREEN), body("Described in 1957 by Goldsmith & Woodburne and independently by Claude Couinaud. The old falciform ligament division is surgically meaningless."), heading("Core Principle: Two Axes", GREEN), bullet("Portal inflow (portal vein + hepatic artery + bile duct) → divides into segments", 0, LGRAY), bullet("Hepatic venous outflow (RHV, MHV, LHV) → defines scissurae between sectors", 0, LGRAY), heading("Segment Numbering", GREEN), bullet("Segment I = caudate lobe (posterior, adjacent to IVC)", 0, LGRAY), bullet("Segments II–VIII = numbered clockwise starting upper-left", 0, LGRAY), heading("Cantlie's Line (Principal Plane)", GREEN), bullet("Imaginary line: gallbladder fossa anteriorly → left side of IVC posteriorly", 0, LGRAY), bullet("Middle hepatic vein runs in this plane", 0, LGRAY), bullet("Divides liver into right and left hemilivers of approximately equal size", 0, LGRAY), bullet("NOT the falciform ligament — the external 'lobes' have no surgical relevance", 0, ORANGE, true), ], { x: 0.28, y: 1.0, w: 6.1, h: 4.4, fontFace: "Calibri", valign: "top" }); // Segment I unique box s.addShape(prs.ShapeType.roundRect, { x: 6.7, y: 1.0, w: 6.1, h: 2.1, rectRadius: 0.08, fill: { color: DKGRAY }, line: { color: PURPLE, pt: 1.5 } }); s.addText("Segment I (Caudate Lobe) — UNIQUE", { x: 6.85, y: 1.1, w: 5.8, h: 0.4, fontSize: 13, bold: true, color: PURPLE, fontFace: "Calibri" }); s.addText([ bullet("Located posterior to portal pedicle, anterior to IVC", 0, LGRAY), bullet("Dual portal supply: branches from BOTH right AND left portal veins", 0, LGRAY), bullet("Independent venous drainage: caudate veins drain directly into retrohepatic IVC", 0, LGRAY), bullet("Sub-parts: right caudate lobe, caudate process, Spiegel lobe (left)", 0, LGRAY), bullet("Spared in Budd-Chiari syndrome — maintains drainage when main hepatic veins occluded", 0, ORANGE, true), ], { x: 6.85, y: 1.52, w: 5.8, h: 1.52, fontFace: "Calibri", valign: "top" }); // Scissurae table s.addText("Scissurae — Hepatic Vein Planes", { x: 6.7, y: 3.2, w: 6.1, h: 0.4, fontSize: 13, bold: true, color: GREEN, fontFace: "Calibri" }); const scRows = [ ["Main scissura (Cantlie's line)", "Middle hepatic vein", "R liver from L liver"], ["Right scissura", "Right hepatic vein", "R ant. sector from R post. sector"], ["Left scissura", "Left hepatic vein", "L medial from L lateral sector"], ["Umbilical fissure", "Left portal pedicle*", "L medial (IV) from L lateral (II/III)"], ]; const tHead = ["Scissura", "Contains", "Divides"]; [tHead, ...scRows].forEach((row, ri) => { row.forEach((cell, ci) => { const cx = 6.7 + ci * 2.03; const cy = 3.62 + ri * 0.34; s.addShape(prs.ShapeType.rect, { x: cx, y: cy, w: 2.0, h: 0.33, fill: { color: ri === 0 ? "222222" : DKGRAY }, line: { color: "333333", pt: 0.5 } }); s.addText(cell, { x: cx+0.05, y: cy+0.04, w: 1.9, h: 0.25, fontSize: ri===0?10:9.5, bold: ri===0, color: ri===0?GREEN:LGRAY, fontFace: "Calibri" }); }); }); s.addText("* Umbilical fissure is NOT a true scissura — contains left portal pedicle, not a hepatic vein", { x: 6.7, y: 5.04, w: 6.1, h: 0.35, fontSize: 9.5, color: MGRAY, fontFace: "Calibri", italic: true }); } // ═══════════════════════════════════════════════════════════════════════════ // SLIDE 7 — SECTORS & SEGMENTS DETAIL // ═══════════════════════════════════════════════════════════════════════════ { const s = addSlide(); titleBar(s, "02 — Sectors & Segments: Right + Left Liver", GREEN); const cols = [ { title: "Right Anterior Sector", color: ORANGE, segs: ["Segs V (inf/ant) + VIII (sup/post)", "Bounded laterally: right hepatic vein", "Medially: middle hepatic vein (Cantlie's line)", "Portal supply: right anterior portal pedicle", "Seg V = anterior medial (ant. inferior)", "Seg VIII = posterior medial (ant. superior)"] }, { title: "Right Posterior Sector", color: ORANGE, segs: ["Segs VI (inf) + VII (sup)", "Medial margin: right hepatic vein", "Right lateral border: liver edge", "Portal supply: right posterior portal pedicle", "Seg VI = right ant. lateral (post. inferior)", "Seg VII = posterior lateral (post. superior)"] }, { title: "Left Medial Sector", color: GREEN, segs: ["Segs IVa (sup) + IVb (inf)", "Bounded by MHV (right) + umbilical fissure (left)", "Portal supply: 'recurrent branches' of left portal pedicle", "En-bloc resection of IV alone NOT possible", "(umbilical fissure contains left portal vein)"] }, { title: "Left Lateral Sector", color: GREEN, segs: ["Segs II (sup/post) + III (inf/ant)", "Left of umbilical fissure / falciform ligament", "Left hepatic vein separates II from III", "Seg II = lateral superior; Seg III = lateral inferior", "Portal supply: seg II & III branches of LPV"] }, ]; cols.forEach((c, i) => { const x = 0.28 + i * 3.28; s.addShape(prs.ShapeType.rect, { x, y: 1.0, w: 3.1, h: 0.06, fill: { color: c.color }, line: { color: c.color } }); s.addText(c.title, { x, y: 1.1, w: 3.1, h: 0.42, fontSize: 12.5, bold: true, color: c.color, fontFace: "Calibri" }); const items = c.segs.map(t => ({ text: t, options: { bullet: { type: "bullet" }, fontSize: 11, color: LGRAY, fontFace: "Calibri", breakLine: true, paraSpaceBefore: 2 } })); s.addText(items, { x, y: 1.55, w: 3.1, h: 3.4, fontFace: "Calibri", valign: "top" }); }); // Surgical resections table s.addText("Surgical Resections by Couinaud Segments", { x: 0.28, y: 4.95, w: 6.1, h: 0.35, fontSize: 12, bold: true, color: PURPLE, fontFace: "Calibri" }); const resRows = [["Right hepatectomy","V, VI, VII, VIII (±I)"],["Left hepatectomy","II, III, IV (±I)"],["Extended right hepatectomy","IV, V, VI, VII, VIII (±I)"],["Extended left hepatectomy","II, III, IV, V, VIII (±I)"],["Left lateral sectorectomy","II, III"],["Right posterior sectorectomy","VI, VII"],["Single segmentectomy","Any one of I–VIII"]]; resRows.forEach((row, ri) => { [row[0], row[1]].forEach((cell, ci) => { const cx = 0.28 + ci * 3.12; const cy = 5.3 + (ri%4) * 0.26; // split into two columns of 4 rows each on screen width }); }); // draw as two 4-row groups side by side [[resRows[0],resRows[1],resRows[2],resRows[3]],[resRows[4],resRows[5],resRows[6]]].forEach((group, gi) => { group.forEach((row, ri) => { const cy = 5.32 + ri * 0.26; const baseX = 0.28 + gi * 6.55; s.addShape(prs.ShapeType.rect, { x: baseX, y: cy, w: 3.5, h: 0.24, fill: { color: DKGRAY }, line: { color: "333333", pt: 0.4 } }); s.addShape(prs.ShapeType.rect, { x: baseX+3.52, y: cy, w: 2.85, h: 0.24, fill: { color: DKGRAY }, line: { color: "333333", pt: 0.4 } }); s.addText(row[0], { x: baseX+0.08, y: cy+0.03, w: 3.34, h: 0.18, fontSize: 10, color: LGRAY, fontFace: "Calibri" }); s.addText(row[1], { x: baseX+3.6, y: cy+0.03, w: 2.65, h: 0.18, fontSize: 10, bold: true, color: PURPLE, fontFace: "Calibri" }); }); }); } // ═══════════════════════════════════════════════════════════════════════════ // SLIDE 8 — SECTION BREAK: ARTERIAL SUPPLY // ═══════════════════════════════════════════════════════════════════════════ { const s = addSlide(); sectionHeader(s, "03", "Hepatic Arterial Supply", "Standard anatomy present in only ~50% of patients", ORANGE); } // ═══════════════════════════════════════════════════════════════════════════ // SLIDE 9 — ARTERIAL SUPPLY // ═══════════════════════════════════════════════════════════════════════════ { const s = addSlide(); titleBar(s, "03 — Hepatic Arterial Supply", ORANGE); s.addText([ heading("Standard Anatomy (~50% of patients)"), bullet("Celiac axis (T12) → Common hepatic artery (CHA) + left gastric + splenic artery", 0, LGRAY), bullet("CHA → gives off Gastroduodenal artery (GDA) → becomes Proper hepatic artery (PHA)", 0, LGRAY), bullet("PHA (lies ventral/medial in hepatoduodenal ligament) → Right hepatic artery (RHA) + Left hepatic artery (LHA)", 0, LGRAY), bullet("RHA: runs posterior to CBD → enters Calot's triangle → cystic artery → Segments V, VI, VII, VIII", 0, LGRAY), bullet("LHA: heads vertically → umbilical fissure → middle hepatic artery branch → Segments II, III, IV", 0, LGRAY), heading("Segment IV Supply — KEY"), bullet("Middle hepatic artery originates from proximal LHA → heads right toward umbilical fissure → supplies Seg IV", 0, LGRAY), bullet("Injury during extended left hepatectomy → Segment IV ischemia", 0, ORANGE, true), ], { x: 0.28, y: 1.0, w: 6.1, h: 4.5, fontFace: "Calibri", valign: "top" }); // Variants table s.addText("Hepatic Arterial Variants (up to 40% of patients)", { x: 6.7, y: 1.0, w: 6.1, h: 0.4, fontSize: 13, bold: true, color: ORANGE, fontFace: "Calibri" }); const vRows = [ ["Variant","Frequency","Course / Risk"], ["Replaced/accessory R hepatic from SMA","11–21%","Posterior to pancreas head → posterior to portal vein → lateral in hepatoduodenal ligament (palpable)"], ["Replaced/accessory L hepatic from L gastric","3.8–10%","Courses within lesser omentum → toward umbilical fissure"], ["R hepatic artery anterior to CBD","~5%","At-risk during cholecystectomy — must identify before clipping"], ["Replaced CHA from SMA","Rare","Entire hepatic supply from SMA (hepatomesenteric trunk)"], ["GDA from right hepatic","Uncommon","Occasionally duplicated"], ]; vRows.forEach((row, ri) => { const cy = 1.5 + ri * 0.62; s.addShape(prs.ShapeType.rect, { x: 6.7, y: cy, w: 2.1, h: 0.58, fill: { color: ri===0?"222222":DKGRAY }, line: { color: "333333", pt: 0.5 } }); s.addShape(prs.ShapeType.rect, { x: 8.82, y: cy, w: 1.7, h: 0.58, fill: { color: ri===0?"222222":DKGRAY }, line: { color: "333333", pt: 0.5 } }); s.addShape(prs.ShapeType.rect, { x: 10.54, y: cy, w: 2.26, h: 0.58, fill: { color: ri===0?"222222":DKGRAY }, line: { color: "333333", pt: 0.5 } }); s.addText(row[0], { x: 6.75, y: cy+0.05, w: 2.0, h: 0.48, fontSize: ri===0?10:9.5, bold: ri===0, color: ri===0?ORANGE:LGRAY, fontFace: "Calibri" }); s.addText(row[1], { x: 8.87, y: cy+0.05, w: 1.6, h: 0.48, fontSize: ri===0?10:9.5, bold: ri===0, color: ri===0?ORANGE:GREEN, fontFace: "Calibri" }); s.addText(row[2], { x: 10.59, y: cy+0.05, w: 2.16, h: 0.48, fontSize: ri===0?10:9, bold: ri===0, color: ri===0?ORANGE:LGRAY, fontFace: "Calibri" }); }); s.addText("Replaced = aberrant origin SUBSTITUTES normal branch | Accessory = in ADDITION to normal branch", { x: 6.7, y: 5.35, w: 6.1, h: 0.3, fontSize: 9.5, color: MGRAY, fontFace: "Calibri", italic: true }); } // ═══════════════════════════════════════════════════════════════════════════ // SLIDE 10 — PORTAL VEIN & HEPATIC VEINS // ═══════════════════════════════════════════════════════════════════════════ { const s = addSlide(); titleBar(s, "04–05 — Portal Vein & Hepatic Venous Outflow", GREEN); s.addText([ heading("Portal Vein Formation & Course", GREEN), bullet("Formed by: confluence of SMV + splenic vein, behind neck of pancreas", 0, LGRAY), bullet("Left gastric (coronary) vein joins before porta hepatis", 0, LGRAY), bullet("Travels posteromedially in hepatoduodenal ligament (deepest of 3 structures)", 0, LGRAY), heading("Right Portal Vein (RPV)", GREEN), bullet("Short trunk; early branch to caudate process", 0, LGRAY), bullet("Bifurcates → Right anterior PV (Segs V, VIII) + Right posterior PV (Segs VI, VII)", 0, LGRAY), bullet("Short extrahepatic course — dissection beyond bifurcation is challenging", 0, ORANGE, true), heading("Left Portal Vein (LPV)", GREEN), bullet("Longer extrahepatic course; runs horizontally beneath Segment IV", 0, LGRAY), bullet("At umbilical fissure: Seg IV 'recurrent branches' at Rex recessus (bend) → head right", 0, LGRAY), bullet("Seg II branch (lateral superior), Seg III branch (lateral inferior)", 0, LGRAY), bullet("Terminal end merges with ligamentum teres (obliterated umbilical vein)", 0, LGRAY), bullet("Both RPV & LPV give small branches to Segment I (caudate)", 0, ORANGE, true), ], { x: 0.28, y: 1.0, w: 6.1, h: 4.5, fontFace: "Calibri", valign: "top" }); s.addText([ heading("Hepatic Venous Outflow", ORANGE), bullet("Right Hepatic Vein (RHV): drains Segs VI, VII, V, VIII; runs in right scissura; joins IVC laterally as single branch", 0, LGRAY), bullet("Middle Hepatic Vein (MHV): runs in Cantlie's line; drains IVa, IVb, V, VIII; often merges with LHV before IVC", 0, LGRAY), bullet("Left Hepatic Vein (LHV): runs in left scissura; drains Segs II, III; common trunk with MHV in ~60%", 0, LGRAY), heading("Accessory Hepatic Veins", ORANGE), bullet("Variable small veins from caudate lobe (Seg I) & right posterior liver drain directly to retrohepatic IVC", 0, LGRAY), bullet("Accessory Seg VI vein can be large — important in living-donor liver transplantation", 0, LGRAY), heading("Dual Blood Supply Summary", ORANGE), ], { x: 6.7, y: 1.0, w: 6.1, h: 3.1, fontFace: "Calibri", valign: "top" }); // Dual supply mini-table const dsRows = [["Source","% Blood Flow","% O2 Delivery","Pressure"],["Portal vein","~75%","~50%","Low (5–10 mmHg)"],["Hepatic artery","~25%","~50%","High (systemic)"]]; dsRows.forEach((row, ri) => { row.forEach((cell, ci) => { const cx = 6.7 + ci * 1.52; const cy = 4.15 + ri * 0.36; s.addShape(prs.ShapeType.rect, { x: cx, y: cy, w: 1.5, h: 0.34, fill: { color: ri===0?"222222":DKGRAY }, line: { color: "333333", pt: 0.5 } }); s.addText(cell, { x: cx+0.05, y: cy+0.05, w: 1.4, h: 0.24, fontSize: ri===0?10:10, bold: ri===0, color: ri===0?GREEN:(ci===0?WHITE:LGRAY), fontFace: "Calibri" }); }); }); s.addText("Glissonean pedicle approach: extrahepatic ligation of entire portal pedicles to a given sector before parenchymal division", { x: 6.7, y: 5.1, w: 6.1, h: 0.45, fontSize: 10, color: PURPLE, fontFace: "Calibri", italic: true }); } // ═══════════════════════════════════════════════════════════════════════════ // SLIDE 11 — SECTION BREAK: BILIARY SYSTEM // ═══════════════════════════════════════════════════════════════════════════ { const s = addSlide(); sectionHeader(s, "06–08", "Biliary System", "Intrahepatic ducts, extrahepatic tree, gallbladder, Sphincter of Oddi", PURPLE); } // ═══════════════════════════════════════════════════════════════════════════ // SLIDE 12 — INTRAHEPATIC BILE DUCTS // ═══════════════════════════════════════════════════════════════════════════ { const s = addSlide(); titleBar(s, "06 — Intrahepatic Biliary Ducts", PURPLE); s.addText([ heading("Microscopic Origin", PURPLE), bullet("Hepatocytes → bile canaliculi (~1 µm, between hepatocyte membranes)", 0, LGRAY), bullet("Canaliculi → bile ductules (canals of Hering, lined by cholangiocytes)", 0, LGRAY), bullet("Ductules → interlobular bile ducts in portal triads → progressively larger segmental ducts", 0, LGRAY), heading("Segmental Intrahepatic Ducts (follow Couinaud anatomy exactly)", PURPLE), bullet("Right anterior sectoral duct — vertical course; drains Segs V & VIII", 0, LGRAY), bullet("Right posterior sectoral duct — horizontal course; drains Segs VI & VII", 0, LGRAY), bullet("Left hepatic duct — longer transverse extrahepatic course under Seg IVb edge; more surgically accessible", 0, LGRAY), bullet("Caudate ducts (Seg I) — small ducts entering BOTH right & left hepatic duct systems (dual drainage)", 0, LGRAY), heading("Important Variant: Right Posterior Sectoral Duct (~20%)", PURPLE), bullet("Courses posterior to right anterior duct → joins LEFT hepatic duct directly (not right hepatic duct)", 0, ORANGE, true), bullet("Small minority: even lower entry into CBD → can be mistaken for cystic duct during cholecystectomy", 0, ORANGE, true), ], { x: 0.28, y: 1.0, w: 6.1, h: 4.5, fontFace: "Calibri", valign: "top" }); // Flow diagram (text-based) s.addText("Biliary Tree Flow — Overview", { x: 6.7, y: 1.0, w: 6.1, h: 0.4, fontSize: 13, bold: true, color: PURPLE, fontFace: "Calibri" }); const flowItems = [ ["Bile Canaliculi (hepatocytes)", BG, WHITE], ["Bile Ductules (canals of Hering)", DKGRAY, LGRAY], ["Interlobular Bile Ducts (portal triads)", DKGRAY, LGRAY], ["Segmental Ducts (Couinaud segs)", DKGRAY, PURPLE], ["R Ant. + R Post. Sectoral Ducts", DKGRAY, LGRAY], ["Right Hepatic Duct (short)", DKGRAY, ORANGE], ["Left Hepatic Duct (longer, transverse)", DKGRAY, GREEN], ["Common Hepatic Duct (CHD)", DKGRAY, PURPLE], ["+ Cystic Duct ↓", DKGRAY, LGRAY], ["Common Bile Duct (CBD)", "1A1A1A", ORANGE], ["Ampulla of Vater → Duodenum", "1A1A1A", GREEN], ]; flowItems.forEach((item, i) => { const y = 1.5 + i * 0.36; s.addShape(prs.ShapeType.rect, { x: 6.7, y, w: 6.1, h: 0.33, fill: { color: item[1] }, line: { color: item[2], pt: 0.8 } }); s.addText(item[0], { x: 6.75, y: y+0.04, w: 6.0, h: 0.25, fontSize: 11, color: item[2], fontFace: "Calibri", align: "center", bold: i===9||i===10 }); if (i < flowItems.length-1) { s.addText("↓", { x: 9.2, y: y+0.33, w: 0.9, h: 0.07, fontSize: 8, color: MGRAY, fontFace: "Calibri", align: "center" }); } }); } // ═══════════════════════════════════════════════════════════════════════════ // SLIDE 13 — EXTRAHEPATIC BILE DUCTS // ═══════════════════════════════════════════════════════════════════════════ { const s = addSlide(); titleBar(s, "07 — Extrahepatic Biliary Tree", PURPLE); s.addText([ heading("Right & Left Hepatic Ducts", PURPLE), bullet("Form within liver; emerge extrahepatically; unite 0.25–2.5 cm from liver surface → CHD", 0, LGRAY), bullet("At hilum: biliary bifurcation abuts base of Seg IVb; superior to intrahepatic portal branches", 0, LGRAY), heading("Common Hepatic Duct (CHD)", PURPLE), bullet("Below biliary bifurcation, above cystic duct insertion; length 1–4 cm", 0, LGRAY), bullet("Runs anterior to portal vein in hepatoduodenal ligament", 0, LGRAY), bullet("Diameter: 4–5 mm", 0, LGRAY), heading("Cystic Duct", PURPLE), bullet("Length 1–5 cm; normally joins lateral wall of CHD at acute angle", 0, LGRAY), bullet("Valves of Heister (spiral mucosal folds): regulate flow; complicate intraoperative cholangiography", 0, LGRAY), heading("CBD — 4 Segments", PURPLE), bullet("Supraduodenal (~2–3 cm) — hepatoduodenal ligament; site of choledochotomy", 0, LGRAY), bullet("Retroduodenal (~2 cm) — posterior to 1st part of duodenum; at-risk in duodenal surgery", 0, LGRAY), bullet("Intrapancreatic (~3 cm) — compressed in pancreatic cancer; narrowest/longest", 0, LGRAY), bullet("Intramural (~1–2 cm) — passes obliquely through 2nd duodenum; narrows 10→5→2 mm", 0, LGRAY), bullet("Gallstones lodge just proximal to ampulla at intramural narrowing (anatomical choke point)", 0, ORANGE, true), ], { x: 0.28, y: 1.0, w: 6.1, h: 4.5, fontFace: "Calibri", valign: "top" }); // Cystic duct variants table s.addText("Cystic Duct Variants (~30% of patients)", { x: 6.7, y: 1.0, w: 6.1, h: 0.4, fontSize: 13, bold: true, color: ORANGE, fontFace: "Calibri" }); const cdRows = [ ["Variant","Description","Risk"], ["Long parallel","Runs alongside CHD before joining","Can mimic CHD; ductal injury"], ["Short","Very short; GB nearly drains into CHD","Difficult clip placement"], ["Medial insertion","Joins medial wall of CHD","Anomalous; at-risk in dissection"], ["Low insertion","Joins far down CBD near duodenum","Extends into distal CBD zone"], ["Into right hepatic duct","Directly into right hepatic duct","Major injury risk"], ["Spiral course","Spirals around CHD before joining","Misidentification at cholecystectomy"], ]; cdRows.forEach((row, ri) => { const cy = 1.5 + ri * 0.5; s.addShape(prs.ShapeType.rect, { x: 6.7, y: cy, w: 2.2, h: 0.47, fill: { color: ri===0?"222222":DKGRAY }, line: { color: "333333", pt: 0.5 } }); s.addShape(prs.ShapeType.rect, { x: 8.92, y: cy, w: 2.0, h: 0.47, fill: { color: ri===0?"222222":DKGRAY }, line: { color: "333333", pt: 0.5 } }); s.addShape(prs.ShapeType.rect, { x: 10.94, y: cy, w: 1.86, h: 0.47, fill: { color: ri===0?"222222":DKGRAY }, line: { color: "333333", pt: 0.5 } }); const tc = ri===0?ORANGE:LGRAY; s.addText(row[0], { x: 6.75, y: cy+0.04, w: 2.1, h: 0.39, fontSize: ri===0?10:9.5, bold: ri===0, color: tc, fontFace: "Calibri" }); s.addText(row[1], { x: 8.97, y: cy+0.04, w: 1.9, h: 0.39, fontSize: ri===0?10:9, bold: ri===0, color: tc, fontFace: "Calibri" }); s.addText(row[2], { x: 10.99, y: cy+0.04, w: 1.76, h: 0.39, fontSize: ri===0?10:9, bold: ri===0, color: ri===0?ORANGE:PURPLE, fontFace: "Calibri" }); }); } // ═══════════════════════════════════════════════════════════════════════════ // SLIDE 14 — GALLBLADDER + CALOT'S TRIANGLE + SPHINCTER OF ODDI // ═══════════════════════════════════════════════════════════════════════════ { const s = addSlide(); titleBar(s, "07b — Gallbladder, Calot's Triangle & Sphincter of Oddi", PURPLE); s.addText([ heading("Gallbladder Anatomy", PURPLE), bullet("Pear-shaped; lies in gallbladder fossa (Segs IVb & V); length 7–10 cm; capacity 30–60 mL", 0, LGRAY), bullet("Hepatic surface: NO peritoneum — replaced by fibrous cystic plate", 0, LGRAY), heading("Four Parts", PURPLE), bullet("Fundus — projects beyond inferior liver margin; easily palpable", 0, LGRAY), bullet("Body — contacts hepatic flexure of colon and 1st part of duodenum", 0, LGRAY), bullet("Infundibulum (Hartmann's pouch) — stones commonly lodge here; can abut CBD", 0, LGRAY), bullet("Neck — narrows into cystic duct; contains valves of Heister; S-shaped", 0, LGRAY), heading("Calot's Triangle", PURPLE), bullet("Classic (1891): cystic duct (inf) + CHD (medial) + cystic artery (sup)", 0, LGRAY), bullet("Modern hepatocystic triangle: cystic duct (inf) + CHD (medial) + liver undersurface (sup)", 0, LGRAY), bullet("Critical View of Safety (CVS): dissect this triangle until only 2 structures enter GB before clipping", 0, ORANGE, true), ], { x: 0.28, y: 1.0, w: 6.1, h: 4.5, fontFace: "Calibri", valign: "top" }); s.addText([ heading("Sphincter of Oddi — Three Components", GREEN), bullet("Sphincter of bile duct (choledochal sphincter) — surrounds terminal CBD; primary controller of bile flow; maintains high tonic contraction fasting state", 0, LGRAY), bullet("Sphincter of pancreatic duct — surrounds terminal pancreatic duct; controls pancreatic juice outflow", 0, LGRAY), bullet("Sphincter of hepatopancreatic ampulla — surrounds entire ampulla", 0, LGRAY), bullet("Location: posteromedial wall of 2nd part of duodenum, ~7–10 cm distal to pylorus", 0, LGRAY), heading("Variable Terminal Anatomy", GREEN), bullet("Complete septum → two ducts open independently at papilla apex", 0, LGRAY), bullet("Most common: ducts share a short common channel of variable length", 0, LGRAY), bullet("Pancreaticobiliary malunion: common channel >6 mm (associated with choledochal cysts)", 0, ORANGE, true), heading("Gallbladder Wall Microstructure", GREEN), bullet("Mucosa: tall columnar epithelium; extensive rugal folds (10x bile concentration)", 0, LGRAY), bullet("Muscular layer: smooth muscle (contracts in response to CCK)", 0, LGRAY), bullet("No submucosa (unlike rest of GI tract)", 0, ORANGE, true), ], { x: 6.7, y: 1.0, w: 6.1, h: 4.5, fontFace: "Calibri", valign: "top" }); } // ═══════════════════════════════════════════════════════════════════════════ // SLIDE 15 — BILE FLOW & ENTEROHEPATIC CIRCULATION // ═══════════════════════════════════════════════════════════════════════════ { const s = addSlide(); titleBar(s, "08 — Bile Flow, CCK & Enterohepatic Circulation", GREEN); s.addText([ heading("Fasting State", GREEN), bullet("Sphincter of Oddi: high tonic contraction → bile flows CHD → cystic duct → gallbladder", 0, LGRAY), bullet("Gallbladder epithelium actively absorbs Na+ and water → bile concentrated 5–10x", 0, LGRAY), bullet("Concentrated bile: higher cholesterol + calcium → promotes gallstone nucleation", 0, LGRAY), heading("Postprandial (Fed) State — CCK-Driven", GREEN), bullet("Fat/protein in duodenum → CCK released from intestinal mucosa", 0, LGRAY), bullet("CCK simultaneously: stimulates gallbladder smooth muscle contraction; relaxes Sphincter of Oddi; stimulates pancreatic enzyme secretion", 0, LGRAY), bullet("Secretin (duodenal mucosa) → bicarbonate-rich fluid secretion from cholangiocytes (duct cells)", 0, LGRAY), ], { x: 0.28, y: 1.0, w: 6.1, h: 3.0, fontFace: "Calibri", valign: "top" }); s.addText([ heading("Enterohepatic Circulation", ORANGE), bullet("Bile acids secreted into duodenum → emulsify dietary fats", 0, LGRAY), bullet("Reabsorbed by active transport in terminal ileum (>95%)", 0, LGRAY), bullet("Returned via portal venous system bound to albumin", 0, LGRAY), bullet("Taken up by hepatocytes via sodium cotransport in space of Disse", 0, LGRAY), bullet("Bile acid pool ~3 g; cycles 4–12 times/day → generates 12–36 g/day biliary secretion", 0, LGRAY), bullet("Only 0.2–0.6 g/day lost in feces → replaced by hepatic synthesis from cholesterol", 0, LGRAY), ], { x: 6.7, y: 1.0, w: 6.1, h: 3.0, fontFace: "Calibri", valign: "top" }); // Accessory/aberrant ducts box s.addShape(prs.ShapeType.roundRect, { x: 0.28, y: 4.05, w: 12.52, h: 1.38, rectRadius: 0.08, fill: { color: DKGRAY }, line: { color: GREEN, pt: 1.2 } }); s.addText("Accessory & Aberrant Hepatic Ducts", { x: 0.42, y: 4.12, w: 5.0, h: 0.35, fontSize: 12, bold: true, color: GREEN, fontFace: "Calibri" }); s.addText([ { text: "True Accessory Hepatic Ducts (~10%): ", options: { bold: true, color: GREEN, fontSize: 11, fontFace: "Calibri" } }, { text: "extra bud from biliary anlage; drain into gallbladder, hepatic ducts, cystic duct, or CBD; more common on right. ", options: { color: LGRAY, fontSize: 11, fontFace: "Calibri" } }, { text: " Aberrant Hepatic Ducts (~10%): ", options: { bold: true, color: ORANGE, fontSize: 11, fontFace: "Calibri" } }, { text: "extrahepatic course of normally intrahepatic duct; almost always right anterior segmental duct joining right posterior duct outside liver; can be mistaken for cystic duct. ", options: { color: LGRAY, fontSize: 11, fontFace: "Calibri" } }, { text: " Luschka Ducts: ", options: { bold: true, color: PURPLE, fontSize: 11, fontFace: "Calibri" } }, { text: "small ducts draining liver bed directly into gallbladder; source of post-cholecystectomy bile leak; stay close to gallbladder wall.", options: { color: LGRAY, fontSize: 11, fontFace: "Calibri" } }, ], { x: 0.42, y: 4.5, w: 12.3, h: 0.85, fontFace: "Calibri", valign: "top" }); } // ═══════════════════════════════════════════════════════════════════════════ // SLIDE 16 — SECTION BREAK: CONGENITAL ANOMALIES // ═══════════════════════════════════════════════════════════════════════════ { const s = addSlide(); sectionHeader(s, "09", "Congenital Anomalies", "Biliary atresia, choledochal cysts, Caroli, Alagille syndrome, gallbladder anomalies", ORANGE); } // ═══════════════════════════════════════════════════════════════════════════ // SLIDE 17 — BILIARY ATRESIA // ═══════════════════════════════════════════════════════════════════════════ { const s = addSlide(); titleBar(s, "09a — Biliary Atresia", ORANGE); s.addText([ heading("Definition & Epidemiology"), bullet("Complete obstruction of bile flow due to destruction of extrahepatic bile ducts + concomitant intrahepatic injury", 0, LGRAY), bullet("Incidence: 1 in 10,000–15,000 live births (USA)", 0, LGRAY), bullet("Accounts for ~1/3 of neonatal cholestatic jaundice", 0, LGRAY), bullet("Leading cause of death from liver disease in children (~50% of pediatric liver transplants)", 0, ORANGE, true), bullet("NOT inherited — discordant in monozygotic twins", 0, LGRAY), heading("Etiology & Pathogenesis (Multifactorial)"), bullet("Injury occurs AFTER biliary morphogenesis (usually postnatal — not a morphogenetic failure)", 0, LGRAY), bullet("Viral: CMV, rotavirus C, EBV, reovirus 3 — perinatal infection as initiator", 0, LGRAY), bullet("Toxin: plant isoflavonoid ingestion (livestock/zebrafish models)", 0, LGRAY), bullet("Immune/inflammatory: coordinated activation of lymphocyte differentiation genes", 0, LGRAY), bullet("Genetics: GPC1 (glypican-1; regulates Hedgehog signaling) — reduced in cholangiocytes", 0, LGRAY), bullet("Susceptibility locus 10q24.2 (XPNPEP1, ADD3)", 0, LGRAY), ], { x: 0.28, y: 1.0, w: 6.1, h: 4.5, fontFace: "Calibri", valign: "top" }); // Right column s.addText("French Classification", { x: 6.7, y: 1.0, w: 6.1, h: 0.4, fontSize: 13, bold: true, color: ORANGE, fontFace: "Calibri" }); const types = [["Type I (~5%)","Atresia of common bile duct","Correctable"],["Type II (~2%)","Atresia of hepatic duct","Correctable"],["Type III (~93%)","Atresia at porta hepatis","Non-correctable"]]; types.forEach((row, i) => { const y = 1.5 + i * 0.75; const col = i===2 ? PURPLE : GREEN; s.addShape(prs.ShapeType.roundRect, { x: 6.7, y, w: 6.1, h: 0.68, rectRadius: 0.06, fill: { color: DKGRAY }, line: { color: col, pt: 1.2 } }); s.addText(row[0], { x: 6.85, y: y+0.06, w: 2.0, h: 0.28, fontSize: 12, bold: true, color: col, fontFace: "Calibri" }); s.addText(row[1], { x: 6.85, y: y+0.34, w: 3.5, h: 0.26, fontSize: 11, color: LGRAY, fontFace: "Calibri" }); s.addText(row[2], { x: 10.0, y: y+0.34, w: 2.7, h: 0.26, fontSize: 11, color: col, fontFace: "Calibri", align: "right" }); }); s.addText([ heading("Clinical Features", GREEN), bullet("Neonatal jaundice persisting beyond 2 weeks", 0, LGRAY), bullet("Acholic (clay-colored) stools, dark urine, hepatomegaly", 0, LGRAY), bullet("Progressive biliary cirrhosis if untreated", 0, LGRAY), heading("Treatment", GREEN), bullet("Kasai Portoenterostomy: excise fibrous biliary remnant → Roux-en-Y jejunal anastomosis to hepatic parenchyma at portal plate", 0, LGRAY), bullet("Best results if done before 60 days of age", 0, ORANGE, true), bullet("Liver transplantation if Kasai fails or delayed presentation", 0, LGRAY), ], { x: 6.7, y: 3.85, w: 6.1, h: 1.75, fontFace: "Calibri", valign: "top" }); } // ═══════════════════════════════════════════════════════════════════════════ // SLIDE 18 — CHOLEDOCHAL CYSTS (TODANI) // ═══════════════════════════════════════════════════════════════════════════ { const s = addSlide(); titleBar(s, "09b — Choledochal Cysts: Todani Classification", PURPLE); const todaniTypes = [ ["Type I\n50–80%","Simple CBD cyst\n(Ia cystic, Ib segmental, Ic fusiform)", ORANGE], ["Type II\n~2%","Diverticulum off any\nportion of biliary tree", GREEN], ["Type III\n1.4–4.5%","Choledochocele —\ndistal intraduodenal\nCBD dilation", PURPLE], ["Type IV\n15–35%","Both intra- AND\nextrahepatic bile\nduct involvement", ORANGE], ["Type V\n~20%","Caroli disease —\nintrahepatic ducts only", GREEN], ]; todaniTypes.forEach((item, i) => { const x = 0.28 + i * 2.62; s.addShape(prs.ShapeType.roundRect, { x, y: 1.0, w: 2.5, h: 2.8, rectRadius: 0.1, fill: { color: DKGRAY }, line: { color: item[2], pt: 1.5 } }); s.addText(item[0], { x: x+0.1, y: 1.1, w: 2.3, h: 0.72, fontSize: 13, bold: true, color: item[2], fontFace: "Calibri", align: "center" }); s.addShape(prs.ShapeType.rect, { x: x+0.2, y: 1.84, w: 2.1, h: 0.03, fill: { color: item[2] }, line: { color: item[2] } }); s.addText(item[1], { x: x+0.1, y: 1.9, w: 2.3, h: 1.8, fontSize: 11.5, color: LGRAY, fontFace: "Calibri", align: "center", valign: "top" }); }); s.addText([ heading("Pathogenesis", PURPLE), bullet("Pancreaticobiliary malunion: long common channel (>6 mm) → pancreatic enzyme reflux → duct wall inflammation & dilation", 0, LGRAY), bullet("Elevated amylase + trypsinogen in cyst bile supports this mechanism", 0, LGRAY), heading("Epidemiology & Associations", PURPLE), bullet("Female:Male ratio 3–4:1; more common in Asia", 0, LGRAY), bullet("Associated with cholangiocarcinoma risk (even after resection)", 0, ORANGE, true), bullet("Type IV and V have highest malignancy risk", 0, ORANGE, true), ], { x: 0.28, y: 3.95, w: 6.1, h: 1.65, fontFace: "Calibri", valign: "top" }); s.addShape(prs.ShapeType.roundRect, { x: 6.7, y: 3.95, w: 6.1, h: 1.65, rectRadius: 0.08, fill: { color: DKGRAY }, line: { color: GREEN, pt: 1.2 } }); s.addText("Management", { x: 6.85, y: 4.05, w: 5.8, h: 0.38, fontSize: 13, bold: true, color: GREEN, fontFace: "Calibri" }); s.addText([ bullet("Complete cyst excision + Roux-en-Y hepaticojejunostomy", 0, LGRAY), bullet("NOT internal drainage — leaves premalignant epithelium in situ", 0, ORANGE, true), bullet("Type V (Caroli): ursodeoxycholic acid; hepatectomy (unilobar); liver transplant (diffuse)", 0, LGRAY), ], { x: 6.85, y: 4.43, w: 5.8, h: 1.1, fontFace: "Calibri", valign: "top" }); } // ═══════════════════════════════════════════════════════════════════════════ // SLIDE 19 — CAROLI + CHF + ALAGILLE // ═══════════════════════════════════════════════════════════════════════════ { const s = addSlide(); titleBar(s, "09c — Caroli Disease, Congenital Hepatic Fibrosis & Alagille Syndrome", GREEN); // Three cards card(s, 0.28, 1.0, 4.0, 4.42, "Caroli Disease (Type V Choledochal Cyst)", [ "Segmental, non-obstructive saccular dilation of intrahepatic biliary tree", "Caroli syndrome = Caroli + CHF + cystic kidney disease (ARPKD/medullary sponge kidney)", "CT/MRI: 'central dot sign' — portal radicle surrounded by dilated bile duct", "Complications: recurrent cholangitis, intrahepatic stones, liver abscess, cholangiocarcinoma", "Rx: ursodeoxycholic acid (symptoms); hepatectomy (unilobar); liver transplant (diffuse)", ], PURPLE); card(s, 4.5, 1.0, 4.0, 4.42, "Congenital Hepatic Fibrosis", [ "Ductal plate malformation — arrested remodeling of embryonic ductal plate", "Features: von Meyenburg complexes (biliary microhamartomas) + periportal fibrosis", "Associated with ARPKD (autosomal recessive polycystic kidney disease)", "Presents with portal hypertension (splenomegaly, varices, hypersplenism) with PRESERVED hepatocellular function", "Co-exists with Caroli syndrome", "Rx: manage complications; liver transplant", ], GREEN); card(s, 8.72, 1.0, 4.08, 4.42, "Alagille Syndrome", [ "Autosomal dominant — JAG1 gene mutation (chromosome 20p12; Jagged-1, Notch ligand)", "Paucity of intrahepatic bile ducts (bile duct:portal tract ratio < 0.5)", "5 Features (AABAA):", " • Arteriohepatic dysplasia", " • Absent/paucity bile ducts", " • Abnormal facies (broad forehead, deep-set eyes, pointed chin)", " • Anterior chamber eye defects (posterior embryotoxon)", " • Aortic/cardiovascular defects (peripheral pulmonary artery stenosis)", " • Butterfly vertebrae", "Rx: symptomatic; biliary diversion; liver transplant", ], ORANGE); } // ═══════════════════════════════════════════════════════════════════════════ // SLIDE 20 — GALLBLADDER ANOMALIES // ═══════════════════════════════════════════════════════════════════════════ { const s = addSlide(); titleBar(s, "09d — Gallbladder & Bile Duct Anomalies", ORANGE); const gbAnoms = [ ["Agenesis","0.03%","Complete absence of GB; associated with extrahepatic biliary anomalies; increased risk of biliary calculi; avoid unnecessary surgical exploration",ORANGE], ["Duplication","Rare","Two separate GBs each with own cystic duct (true) or shared neck (bilobed/H-type); both can form stones; laparoscopic cholecystectomy may need modification",GREEN], ["Ectopic GB","Rare","Left-sided, retrohepatic, intrahepatic, or within falciform ligament; altered surgical approach required",PURPLE], ["Phrygian Cap","~4%","Folding of fundus over body; most common variant; usually clinically insignificant; can mimic disease on US/CT",ORANGE], ["Multiseptate GB","Rare","Internal septa divide lumen into multiple compartments; bile stasis and stone formation; biliary-type pain, recurrent cholecystitis",GREEN], ["Floating GB","Rare","Suspended by long mesentery; predisposed to torsion (volvulus); acute RUQ pain; urgent cholecystectomy",PURPLE], ]; gbAnoms.forEach((item, i) => { const row = Math.floor(i/3); const col = i % 3; const x = 0.28 + col * 4.35; const y = 1.0 + row * 2.25; s.addShape(prs.ShapeType.roundRect, { x, y, w: 4.2, h: 2.15, rectRadius: 0.08, fill: { color: DKGRAY }, line: { color: item[3], pt: 1.2 } }); s.addText(item[0], { x: x+0.15, y: y+0.1, w: 2.5, h: 0.35, fontSize: 13, bold: true, color: item[3], fontFace: "Calibri" }); s.addText(item[1], { x: x+2.7, y: y+0.1, w: 1.35, h: 0.35, fontSize: 11, color: MGRAY, fontFace: "Calibri", align: "right" }); s.addShape(prs.ShapeType.rect, { x: x+0.15, y: y+0.5, w: 3.9, h: 0.025, fill: { color: item[3] }, line: { color: item[3] } }); s.addText(item[2], { x: x+0.15, y: y+0.58, w: 3.9, h: 1.48, fontSize: 10.5, color: LGRAY, fontFace: "Calibri", valign: "top" }); }); } // ═══════════════════════════════════════════════════════════════════════════ // SLIDE 21 — SUMMARY TABLE: CONGENITAL ANOMALIES // ═══════════════════════════════════════════════════════════════════════════ { const s = addSlide(); titleBar(s, "Summary — Congenital Anomalies at a Glance", ORANGE); const sumRows = [ ["Anomaly","Key Feature","Complication","Treatment"], ["Biliary Atresia","Obliteration of extrahepatic bile ducts post-natally","Biliary cirrhosis, liver failure","Kasai portoenterostomy + liver transplant"], ["Choledochal Cyst (I–IV)","Cystic dilation of CBD ± intrahepatic ducts; pancreaticobiliary malunion","Cholangitis, pancreatitis, cholangiocarcinoma","Complete excision + Roux-en-Y hepaticojejunostomy"], ["Caroli Disease (V)","Saccular intrahepatic bile duct dilation; central dot sign","Recurrent cholangitis, stones, cholangiocarcinoma","UDCA; hepatectomy; OLT"], ["Congenital Hepatic Fibrosis","Ductal plate malformation; periportal fibrosis + ARPKD","Portal hypertension, varices","Manage complications; OLT"], ["Alagille Syndrome","JAG1 mutation; intrahepatic bile duct paucity; 5 hallmarks","Cholestasis, cirrhosis; cardiac disease","Symptomatic; biliary diversion; OLT"], ["GB Agenesis","Absent gallbladder (0.03%)","Biliary stones; surgical confusion","Awareness; avoid unnecessary exploration"], ]; const colW = [2.6, 3.2, 3.1, 3.4]; const colX = [0.28, 2.9, 6.12, 9.24]; sumRows.forEach((row, ri) => { row.forEach((cell, ci) => { const cy = 1.0 + ri * 0.72; s.addShape(prs.ShapeType.rect, { x: colX[ci], y: cy, w: colW[ci]-0.05, h: 0.68, fill: { color: ri===0?"222222":DKGRAY }, line: { color: "333333", pt: 0.5 } }); const accent = ci===0&&ri>0 ? [ORANGE,PURPLE,GREEN,GREEN,ORANGE,ORANGE][ri-1] : (ri===0?WHITE:LGRAY); s.addText(cell, { x: colX[ci]+0.08, y: cy+0.06, w: colW[ci]-0.2, h: 0.56, fontSize: ri===0?11:10, bold: ri===0||ci===0, color: accent, fontFace: "Calibri", valign: "top" }); }); }); } // ═══════════════════════════════════════════════════════════════════════════ // SLIDE 22 — REFERENCES // ═══════════════════════════════════════════════════════════════════════════ { const s = addSlide(); titleBar(s, "References", MGRAY); const refs = [ "Wei AC. Hepatobiliary Anatomy. In: Mulholland & Greenfield's Surgery, 7th ed. Wolters Kluwer; 2022. Ch. 57, pp. 2772–2789.", "Townsend CM et al. Sabiston Textbook of Surgery, 21st ed. Elsevier; 2022. Ch. 88–89, 117.", "Fischer JE et al. Fischer's Mastery of Surgery, 8th ed. Wolters Kluwer; 2019. Ch. 165, pp. 4557–4560.", "Yamada T et al. Yamada's Textbook of Gastroenterology, 7th ed. Wiley-Blackwell; 2016. Ch. 9, pp. 231–233.", "Kumar V, Abbas AK. Robbins & Kumar Basic Pathology, 11th ed. Elsevier; 2023.", "Blumgart LH, DeMatteo RP. Liver & Biliary Anatomy. In: Blumgart's Surgery of the Liver, Biliary Tract and Pancreas, 6th ed. Elsevier; 2017.", "Drake RL, Vogl AW, Mitchell AWM. Gray's Anatomy for Students, 4th ed. Elsevier; 2019. Fig. 4.17.", "Bezerra JA. Biliary Atresia. In: Sleisenger & Fordtran's GI & Liver Disease, 11th ed. Elsevier; 2021. Ch. 62.", ]; refs.forEach((ref, i) => { s.addShape(prs.ShapeType.rect, { x: 0.28, y: 1.06 + i * 0.54, w: 0.28, h: 0.42, fill: { color: [ORANGE,GREEN,PURPLE,ORANGE,GREEN,PURPLE,ORANGE,GREEN][i] }, line: { color: [ORANGE,GREEN,PURPLE,ORANGE,GREEN,PURPLE,ORANGE,GREEN][i] } }); s.addText(`${i+1}. ${ref}`, { x: 0.68, y: 1.08 + i * 0.54, w: 12.1, h: 0.48, fontSize: 11, color: LGRAY, fontFace: "Calibri", valign: "top" }); }); } // ── WRITE FILE ──────────────────────────────────────────────────────────── prs.writeFile({ fileName: "/home/daytona/workspace/hepato_ppt/Hepatobiliary_Complete.pptx" }) .then(() => console.log("DONE")) .catch(e => console.error("ERROR:", e)); JSEOF echo "Script written"
cd /home/daytona/workspace/hepato_ppt && node build.js 2>&1
ls -lh /home/daytona/workspace/hepato_ppt/Hepatobiliary_Complete.pptx && python3 -c " from pptx import Presentation prs = Presentation('/home/daytona/workspace/hepato_ppt/Hepatobiliary_Complete.pptx') print(f'Slides: {len(prs.slides)}') for i, slide in enumerate(prs.slides): texts = [s.text_frame.paragraphs[0].text for s in slide.shapes if s.has_text_frame and s.text_frame.paragraphs[0].text.strip()] print(f' Slide {i+1}: {texts[0][:60] if texts else \"(no text)\"}') "
Hepatobiliary Complete
Presentation · PPTX
#0D0D0D) backgrounds throughout for a professional, high-contrast look| Added | Detail |
|---|---|
| Expanded Couinaud slide | Full scissurae table, sector-by-sector breakdown, Segment I unique features, surgical resection summary |
| Arterial supply | Full variant table (6 variants with frequency + course), Segment IV supply callout |
| Portal vein | RPV/LPV detail, Rex recessus, ligamentum teres |
| Hepatic veins | RHV/MHV/LHV relationships, accessory veins, dual blood supply table, Glissonean pedicle |
| Intrahepatic biliary ducts | Canaliculi → ductules → segmental ducts, right posterior sectoral duct variant (~20%) |
| Extrahepatic biliary tree | CBD 4-segment table, cystic duct variants table (6 variants) |
| Gallbladder + Sphincter of Oddi | All 3 sphincter components, variable terminal anatomy, pancreaticobiliary malunion |
| Bile flow & enterohepatic circulation | CCK mechanism, Luschka ducts, true vs. aberrant accessory hepatic ducts |
Add images also And keep white background with texts black and certain accents with different colours
Couinaud liver segments anatomy diagram wikimedia commons free
biliary tree anatomy diagram extrahepatic bile ducts wikimedia commons
hepatic artery anatomy celiac axis diagram wikimedia commons free
mkdir -p /home/daytona/workspace/hepato_ppt/images && cd /home/daytona/workspace/hepato_ppt/images && \ # Couinaud segments anterior view curl -sL "https://upload.wikimedia.org/wikipedia/commons/thumb/e/e8/Liver_04_Couinaud_classification.svg/1000px-Liver_04_Couinaud_classification.svg.png" -o couinaud_anterior.png && \ # Biliary system full diagram curl -sL "https://upload.wikimedia.org/wikipedia/commons/thumb/1/1e/Biliary_system_new.svg/960px-Biliary_system_new.svg.png" -o biliary_system.png && \ # Celiac trunk and branches curl -sL "https://upload.wikimedia.org/wikipedia/commons/3/36/Celiac_Trunk_and_Branches.jpg" -o celiac_trunk.jpg && \ # Common and proper hepatic artery curl -sL "https://upload.wikimedia.org/wikipedia/commons/thumb/4/4c/Common_and_proper_hepatic_artery.png/960px-Common_and_proper_hepatic_artery.png" -o hepatic_artery.png && \ # Pancreatic and common bile ducts curl -sL "https://upload.wikimedia.org/wikipedia/commons/7/75/Pancreatic_%26_Common_Bile_Ducts.jpg" -o bile_ducts.jpg && \ # Digestive system showing bile duct curl -sL "https://upload.wikimedia.org/wikipedia/commons/9/96/Digestive_system_showing_bile_duct.svg" -o bile_duct_overview.svg && \ echo "Downloads done" && ls -lh
cd /home/daytona/workspace/hepato_ppt/images && \ # Try alternative couinaud curl -sL "https://cdn.lecturio.com/assets/Couinaud-classification-illustration-1200x510.png" -o couinaud_segments.png && \ # Biliary tract anatomy curl -sL "https://upload.wikimedia.org/wikipedia/commons/thumb/6/6d/Biliary_tract_anatomy.jpg/800px-Biliary_tract_anatomy.jpg" -o biliary_tract.jpg && \ # Portal vein anatomy curl -sL "https://upload.wikimedia.org/wikipedia/commons/thumb/b/b3/Portal_vein.svg/800px-Portal_vein.svg.png" -o portal_vein.png && \ # Gallbladder anatomy curl -sL "https://upload.wikimedia.org/wikipedia/commons/thumb/f/f3/Gallbladder_%28organ%29.png/800px-Gallbladder_%28organ%29.png" -o gallbladder.png && \ # Choledochal cyst Todani curl -sL "https://upload.wikimedia.org/wikipedia/commons/thumb/4/45/Choledochal_cyst_types.jpg/800px-Choledochal_cyst_types.jpg" -o choledochal_cysts.jpg && \ # Biliary atresia curl -sL "https://upload.wikimedia.org/wikipedia/commons/thumb/5/52/Biliary_atresia.jpg/800px-Biliary_atresia.jpg" -o biliary_atresia.jpg && \ echo "done" && ls -lh
python3 -c " import os imgs = os.listdir('/home/daytona/workspace/hepato_ppt/images') for f in imgs: size = os.path.getsize(f'/home/daytona/workspace/hepato_ppt/images/{f}') print(f'{f}: {size} bytes', 'VALID' if size > 10000 else 'BROKEN') "
cd /home/daytona/workspace/hepato_ppt/images && \ # Convert SVG to PNG python3 -c " import subprocess result = subprocess.run(['cairosvg', 'bile_duct_overview.svg', '-o', 'bile_duct_overview.png', '-W', '800'], capture_output=True, text=True) print(result.stdout, result.stderr) " 2>&1 || \ python3 -c " from PIL import Image import cairosvg cairosvg.svg2png(url='bile_duct_overview.svg', write_to='bile_duct_overview.png', output_width=800) print('converted') " 2>&1 || echo "SVG conversion not available, skipping"
~/hepato_ppt/build_white.js
const pptxgen = require("pptxgenjs");
const prs = new pptxgen();
prs.layout = "LAYOUT_WIDE";
prs.title = "Hepatobiliary System — Anatomy & Congenital Anomalies";
// ── PALETTE (White background, black text, coloured accents) ─────────────
const BG = "FFFFFF"; // white background
const BLACK = "1A1A1A"; // near-black main text
const DKTEXT = "2D2D2D"; // dark body text
const MGRAY = "666666"; // muted grey
const LGRAY = "444444"; // body text
const ORANGE = "D9660A"; // accent 1
const GREEN = "2E8B57"; // accent 2
const PURPLE = "7B2FBE"; // accent 3
const CARD = "F4F4F4"; // card background (very light grey)
const CARDBDR = "E0E0E0"; // card border
const HLINE = "E8E8E8"; // horizontal rule
// ── HELPERS ──────────────────────────────────────────────────────────────
function addSlide() {
const s = prs.addSlide();
s.addShape(prs.ShapeType.rect, { x:0, y:0, w:"100%", h:"100%", fill:{color:BG}, line:{color:BG} });
return s;
}
function titleBar(s, text, accentColor) {
// top colour bar
s.addShape(prs.ShapeType.rect, { x:0, y:0, w:"100%", h:0.18, fill:{color:accentColor}, line:{color:accentColor} });
s.addText(text, { x:0.3, y:0.27, w:12.7, h:0.58, fontSize:20, bold:true, color:BLACK, fontFace:"Calibri" });
s.addShape(prs.ShapeType.rect, { x:0.3, y:0.9, w:12.7, h:0.025, fill:{color:HLINE}, line:{color:HLINE} });
}
function sectionDivider(s, num, title, subtitle, color) {
s.addShape(prs.ShapeType.rect, { x:0, y:0, w:"100%", h:"100%", fill:{color:color}, line:{color:color} });
s.addText(num, { x:0.5, y:0.4, w:12.3, h:2.0, fontSize:110, bold:true, color:"FFFFFF", fontFace:"Calibri", align:"center", transparency:80 });
s.addText(title, { x:0.5, y:2.2, w:12.3, h:0.85, fontSize:38, bold:true, color:"FFFFFF", fontFace:"Calibri", align:"center" });
s.addText(subtitle, { x:0.5, y:3.2, w:12.3, h:0.55, fontSize:15, color:"FFFFFF", fontFace:"Calibri", align:"center", italic:true, transparency:20 });
}
function bul(text, level, color, bold) {
return { text, options:{ bullet:{type:"bullet"}, indentLevel:level||0, fontSize:11.5, color:color||LGRAY, fontFace:"Calibri", bold:bold||false, breakLine:true, paraSpaceBefore:2 }};
}
function hd(text, color) {
return { text, options:{ bullet:false, fontSize:12.5, bold:true, color:color||ORANGE, fontFace:"Calibri", breakLine:true, paraSpaceBefore:8 }};
}
function bd(text) {
return { text, options:{ bullet:false, fontSize:11, color:LGRAY, fontFace:"Calibri", breakLine:true, paraSpaceBefore:2 }};
}
function card(s, x, y, w, h, title, lines, titleColor) {
s.addShape(prs.ShapeType.roundRect, { x,y,w,h, rectRadius:0.06, fill:{color:CARD}, line:{color:titleColor||ORANGE, pt:1.2} });
s.addShape(prs.ShapeType.rect, { x,y, w, h:0.06, fill:{color:titleColor||ORANGE}, line:{color:titleColor||ORANGE} });
s.addText(title, { x:x+0.12, y:y+0.1, w:w-0.24, h:0.35, fontSize:11.5, bold:true, color:titleColor||ORANGE, fontFace:"Calibri" });
s.addShape(prs.ShapeType.rect, { x:x+0.12, y:y+0.48, w:w-0.24, h:0.015, fill:{color:HLINE}, line:{color:HLINE} });
const items = lines.map(l=>({ text:l, options:{ bullet:{type:"bullet"}, fontSize:10.5, color:LGRAY, fontFace:"Calibri", breakLine:true, paraSpaceBefore:2 }}));
s.addText(items, { x:x+0.12, y:y+0.52, w:w-0.24, h:h-0.62, fontFace:"Calibri", valign:"top" });
}
function calloutBox(s, x, y, w, h, text, color) {
s.addShape(prs.ShapeType.roundRect, { x,y,w,h, rectRadius:0.05, fill:{color:`${color}15`}, line:{color:color, pt:1.5} });
s.addText(text, { x:x+0.12, y:y+0.1, w:w-0.24, h:h-0.2, fontSize:10.5, color:BLACK, fontFace:"Calibri", valign:"middle" });
}
// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 1 — TITLE
// ═══════════════════════════════════════════════════════════════════════════
{
const s = addSlide();
s.addShape(prs.ShapeType.rect, { x:0, y:0, w:"100%", h:0.22, fill:{color:ORANGE}, line:{color:ORANGE} });
s.addShape(prs.ShapeType.rect, { x:0, y:5.4, w:"100%", h:0.225, fill:{color:PURPLE}, line:{color:PURPLE} });
s.addShape(prs.ShapeType.rect, { x:0, y:5.18, w:"100%", h:0.22, fill:{color:GREEN}, line:{color:GREEN} });
s.addText("HEPATOBILIARY SYSTEM", { x:0.5, y:0.65, w:12.3, h:1.1, fontSize:50, bold:true, color:BLACK, fontFace:"Calibri", align:"center", charSpacing:2 });
s.addText("Anatomy & Congenital Anomalies", { x:0.5, y:1.72, w:12.3, h:0.7, fontSize:26, color:ORANGE, fontFace:"Calibri", align:"center", italic:true });
s.addShape(prs.ShapeType.rect, { x:3.5, y:2.52, w:6.3, h:0.03, fill:{color:HLINE}, line:{color:HLINE} });
s.addText([
{ text:"Topographic Anatomy • ", options:{color:MGRAY} },
{ text:"Couinaud Segments • ", options:{color:GREEN} },
{ text:"Arteriovenous Supply • ", options:{color:ORANGE} },
{ text:"Biliary System • ", options:{color:PURPLE} },
{ text:"Congenital Anomalies", options:{color:MGRAY} }
], { x:0.5, y:2.65, w:12.3, h:0.45, fontSize:13, fontFace:"Calibri", align:"center" });
s.addText("Sources: Mulholland & Greenfield Surgery 7e | Sabiston Surgery 21e | Fischer's Mastery of Surgery 8e | Gray's Anatomy | Yamada's Gastroenterology 7e | Robbins Pathology 11e",
{ x:0.5, y:4.7, w:12.3, h:0.4, fontSize:9.5, color:MGRAY, fontFace:"Calibri", align:"center", italic:true });
}
// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 2 — CONTENTS
// ═══════════════════════════════════════════════════════════════════════════
{
const s = addSlide();
titleBar(s, "Contents", ORANGE);
const items = [
["01","Topographic & Surface Anatomy","Position, relations, ligaments, portal triad",ORANGE],
["02","Couinaud Classification — Deep Dive","8 segments, sectors, hemilivers, Cantlie's line",GREEN],
["03","Arterial Supply","CHA, PHA, variants up to 40%; Segment IV supply",ORANGE],
["04","Portal Vein","Formation, RPV/LPV, caudate supply",GREEN],
["05","Hepatic Venous Outflow","RHV, MHV, LHV, dual blood supply",ORANGE],
["06","Intrahepatic Biliary Ducts","Canaliculi → segmental ducts, key variants",PURPLE],
["07","Extrahepatic Biliary Tree + Gallbladder","CBD 4 segments, cystic duct, Calot's, Sphincter of Oddi",PURPLE],
["08","Bile Flow & Enterohepatic Circulation","CCK, Sphincter of Oddi, bile acid cycling",GREEN],
["09","Congenital Anomalies","Biliary atresia, choledochal cysts, Caroli, Alagille, GB anomalies",ORANGE],
];
items.forEach(([num,title,sub,col], i) => {
const row = Math.floor(i/3), ci = i%3;
const x = 0.28+ci*4.35, y = 1.05+row*1.5;
s.addShape(prs.ShapeType.roundRect, { x,y, w:4.18, h:1.35, rectRadius:0.07, fill:{color:CARD}, line:{color:col, pt:1.0} });
s.addShape(prs.ShapeType.rect, { x,y, w:0.07, h:1.35, fill:{color:col}, line:{color:col} });
s.addText(num, { x:x+0.18, y:y+0.1, w:0.6, h:0.45, fontSize:24, bold:true, color:col, fontFace:"Calibri" });
s.addText(title, { x:x+0.18, y:y+0.52, w:3.82, h:0.38, fontSize:12, bold:true, color:BLACK, fontFace:"Calibri" });
s.addText(sub, { x:x+0.18, y:y+0.9, w:3.82, h:0.36, fontSize:10, color:MGRAY, fontFace:"Calibri", italic:true });
});
}
// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 3 — SECTION DIVIDER: TOPOGRAPHIC
// ═══════════════════════════════════════════════════════════════════════════
{ const s=addSlide(); sectionDivider(s,"01","Topographic & Surface Anatomy","Position, relations, ligaments, bare area, portal triad",ORANGE); }
// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 4 — TOPOGRAPHIC ANATOMY
// ═══════════════════════════════════════════════════════════════════════════
{
const s = addSlide();
titleBar(s, "01 — Topographic & Surface Anatomy", ORANGE);
s.addText([
hd("Position & General Relations"),
bul("Large wedge-shaped organ — right upper quadrant; bounded superiorly/posteriorly by diaphragm & retroperitoneum",0,LGRAY),
bul("Inferiorly: stomach, gallbladder, hepatoduodenal ligament, duodenum, hepatic flexure, right adrenal & kidney",0,LGRAY),
hd("Hepatoduodenal Ligament — Portal Triad"),
bul("Portal vein — posteromedial (deepest)",0,LGRAY),
bul("Hepatic artery — anteromedial (left)",0,LGRAY),
bul("Bile duct — anterolateral (right)",0,LGRAY),
bul("Pringle manoeuvre: compress ligament to control inflow hemorrhage",0,ORANGE,true),
hd("Surface Landmarks", GREEN),
bul("Rouviere sulcus — right inferior; border ant./post. right liver",0,LGRAY),
bul("Arantius cleft (Rex recessus) — separates caudate from left liver; contains ligamentum venosum",0,LGRAY),
bul("Falciform ligament — liver to anterior abdominal wall; contains ligamentum teres",0,LGRAY),
bul("Bare area — posterior surface; devoid of peritoneum; bounded by coronary & right triangular ligaments",0,LGRAY),
], { x:0.28, y:0.98, w:6.2, h:4.5, fontFace:"Calibri", valign:"top" });
s.addText([
hd("Ligamentous Attachments", PURPLE),
bul("Falciform / Ligamentum teres → suprahepatic IVC; liver to ant. abdominal wall",0,LGRAY),
bul("Coronary lig. → posterior peritoneal reflection; defines bare area",0,LGRAY),
bul("Right triangular lig. → lateral limit of bare area; diaphragm to right lobe",0,LGRAY),
bul("Left triangular lig. → left lobe to diaphragm",0,LGRAY),
bul("Gastrohepatic lig. → ligamentum venosum in Arantius cleft",0,LGRAY),
bul("Hepatoduodenal lig. → free edge of lesser omentum; portal triad",0,LGRAY),
hd("Glissonean Capsule", PURPLE),
bul("Connective tissue sheath wrapping portal vein + hepatic artery + bile duct + nerves + lymphatics",0,LGRAY),
bul("Glissonean pedicle approach: extrahepatic ligation of entire portal pedicles to a sector/segment before parenchymal division",0,LGRAY),
], { x:7.0, y:0.98, w:6.1, h:4.5, fontFace:"Calibri", valign:"top" });
}
// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 5 — SECTION DIVIDER: COUINAUD
// ═══════════════════════════════════════════════════════════════════════════
{ const s=addSlide(); sectionDivider(s,"02","Couinaud Classification","8 segments, sectors, hemilivers, Cantlie's line — surgical relevance",GREEN); }
// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 6 — COUINAUD + IMAGE
// ═══════════════════════════════════════════════════════════════════════════
{
const s = addSlide();
titleBar(s, "02 — Couinaud Classification: Core Principles & Segment Map", GREEN);
s.addText([
hd("Historical Context", GREEN),
bul("Described 1957 by Goldsmith & Woodburne and independently by Claude Couinaud",0,LGRAY),
bul("Old falciform ligament division is surgically meaningless — the external 'lobes' bear no relevance to operative anatomy",0,ORANGE,true),
hd("Two Axes", GREEN),
bul("Portal inflow (portal vein + hepatic artery + bile duct) → defines segments",0,LGRAY),
bul("Hepatic venous outflow (RHV, MHV, LHV) → defines scissurae between sectors",0,LGRAY),
hd("Cantlie's Line", GREEN),
bul("Imaginary line: gallbladder fossa anteriorly → left IVC posteriorly",0,LGRAY),
bul("Middle hepatic vein runs in this plane; divides right and left hemilivers",0,LGRAY),
hd("Segment I — Unique Features", PURPLE),
bul("Dual portal supply: both RPV and LPV",0,LGRAY),
bul("Independent venous drainage: caudate veins → retrohepatic IVC directly",0,LGRAY),
bul("Spared in Budd-Chiari (hepatic vein occlusion)",0,PURPLE,true),
bul("Sub-parts: right caudate lobe, caudate process, Spiegel lobe (left)",0,LGRAY),
], { x:0.28, y:0.98, w:5.6, h:4.5, fontFace:"Calibri", valign:"top" });
// Couinaud image
s.addImage({ path:"/home/daytona/workspace/hepato_ppt/images/couinaud_segments.png", x:6.1, y:0.98, w:7.0, h:3.5 });
s.addText("Fig: Couinaud classification — 8 functional liver segments (Lecturio Medical)", {
x:6.1, y:4.55, w:7.0, h:0.32, fontSize:8.5, color:MGRAY, fontFace:"Calibri", italic:true, align:"center"
});
}
// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 7 — SECTORS & SEGMENTS DETAIL + SCISSURAE TABLE
// ═══════════════════════════════════════════════════════════════════════════
{
const s = addSlide();
titleBar(s, "02 — Sectors, Segments & Scissurae", GREEN);
const cols = [
{ title:"Right Anterior Sector", col:ORANGE, segs:["Segs V (inf/ant) + VIII (sup/post)","Bounded laterally: RHV; medially: MHV (Cantlie's line)","Portal supply: right anterior portal pedicle","Seg V = anterior medial (ant. inferior)","Seg VIII = posterior medial (ant. superior)"] },
{ title:"Right Posterior Sector", col:ORANGE, segs:["Segs VI (inf) + VII (sup)","Medial margin: RHV; right lateral: liver edge","Portal supply: right posterior portal pedicle","Seg VI = right ant. lateral (post. inferior)","Seg VII = posterior lateral (post. superior)"] },
{ title:"Left Medial Sector", col:GREEN, segs:["Segs IVa (sup) + IVb (inf)","Bounded MHV (right) + umbilical fissure (left)","Portal: 'recurrent branches' of LPV","En-bloc resection of IV alone NOT possible"] },
{ title:"Left Lateral Sector", col:GREEN, segs:["Segs II (sup/post) + III (inf/ant)","Left of umbilical fissure / falciform lig.","LHV separates Seg II from Seg III","Portal: Seg II & III branches of LPV"] },
];
cols.forEach((c,i) => {
const x = 0.28+i*3.28;
card(s, x, 0.98, 3.1, 2.55, c.title, c.segs, c.col);
});
// Scissurae table
s.addText("Scissurae (Hepatic Vein Planes)", { x:0.28, y:3.65, w:6.0, h:0.35, fontSize:12, bold:true, color:PURPLE, fontFace:"Calibri" });
const scRows=[["Scissura","Contains","Divides"],["Main scissura (Cantlie's line)","Middle hepatic vein","Right liver from left liver"],["Right scissura","Right hepatic vein","R ant. sector from R post. sector"],["Left scissura","Left hepatic vein","L medial from L lateral sector"],["Umbilical fissure","Left portal pedicle*","Left medial (IV) from lateral (II/III)"]];
scRows.forEach((row,ri) => {
[2.8,1.7,2.3].forEach((w,ci) => {
const cx = 0.28+[0,2.82,4.54][ci];
const cy = 4.05+ri*0.31;
s.addShape(prs.ShapeType.rect,{x:cx,y:cy,w:w-0.04,h:0.29, fill:{color:ri===0?PURPLE:CARD}, line:{color:ri===0?PURPLE:CARDBDR, pt:0.5}});
s.addText(row[ci],{x:cx+0.06,y:cy+0.04,w:w-0.14,h:0.21,fontSize:ri===0?10:9.5, bold:ri===0, color:ri===0?"FFFFFF":(ci===0?BLACK:LGRAY), fontFace:"Calibri"});
});
});
s.addText("* Umbilical fissure contains left portal pedicle, NOT a hepatic vein", {x:0.28,y:5.42,w:6.6,h:0.22,fontSize:9,color:MGRAY,fontFace:"Calibri",italic:true});
// Surgical resections
s.addText("Surgical Resections by Couinaud Segments", { x:7.0, y:3.65, w:6.1, h:0.35, fontSize:12, bold:true, color:ORANGE, fontFace:"Calibri" });
const res=[["Right hepatectomy","V, VI, VII, VIII (±I)"],["Left hepatectomy","II, III, IV (±I)"],["Extended right","IV, V, VI, VII, VIII (±I)"],["Extended left","II, III, IV, V, VIII (±I)"],["Left lateral sectorectomy","II, III"],["Right post. sectorectomy","VI, VII"],["Single segmentectomy","Any one of I–VIII"]];
res.forEach((row,ri) => {
const cy = 4.05+ri*0.22;
s.addShape(prs.ShapeType.rect,{x:7.0,y:cy,w:4.1,h:0.2,fill:{color:CARD},line:{color:CARDBDR,pt:0.4}});
s.addShape(prs.ShapeType.rect,{x:11.12,y:cy,w:2.0,h:0.2,fill:{color:CARD},line:{color:CARDBDR,pt:0.4}});
s.addText(row[0],{x:7.08,y:cy+0.02,w:4.0,h:0.16,fontSize:10,color:LGRAY,fontFace:"Calibri"});
s.addText(row[1],{x:11.2,y:cy+0.02,w:1.88,h:0.16,fontSize:10,bold:true,color:ORANGE,fontFace:"Calibri"});
});
}
// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 8 — SECTION DIVIDER: ARTERIAL SUPPLY
// ═══════════════════════════════════════════════════════════════════════════
{ const s=addSlide(); sectionDivider(s,"03","Hepatic Arterial Supply","Standard anatomy present in only ~50% of patients; variants in up to 40%",ORANGE); }
// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 9 — ARTERIAL SUPPLY + IMAGE
// ═══════════════════════════════════════════════════════════════════════════
{
const s = addSlide();
titleBar(s, "03 — Hepatic Arterial Supply", ORANGE);
s.addText([
hd("Standard Anatomy (~50%)"),
bul("Celiac axis (T12) → CHA + left gastric + splenic artery",0,LGRAY),
bul("CHA → gives off GDA → becomes Proper Hepatic Artery (PHA)",0,LGRAY),
bul("PHA (ventral/medial in hepatoduodenal ligament) → RHA + LHA",0,LGRAY),
bul("RHA: posterior to CBD → Calot's triangle → cystic artery → Segs V, VI, VII, VIII",0,LGRAY),
bul("LHA: umbilical fissure → middle hepatic artery → Segs II, III, IV",0,LGRAY),
hd("Segment IV Supply — KEY"),
bul("Middle hepatic artery: proximal LHA → right toward umbilical fissure → Seg IV",0,LGRAY),
bul("Injury during extended left hepatectomy → Segment IV ischemia",0,ORANGE,true),
], { x:0.28, y:0.98, w:5.8, h:2.8, fontFace:"Calibri", valign:"top" });
// Hepatic artery image
s.addImage({ path:"/home/daytona/workspace/hepato_ppt/images/celiac_trunk.jpg", x:6.3, y:0.98, w:6.8, h:3.8 });
s.addText("Fig: Celiac trunk and branches — common hepatic artery, proper hepatic artery (Wikimedia Commons)", {
x:6.3, y:4.8, w:6.8, h:0.28, fontSize:8, color:MGRAY, fontFace:"Calibri", italic:true, align:"center"
});
// Variants table
s.addText("Hepatic Arterial Variants (up to 40%)", { x:0.28, y:3.85, w:5.8, h:0.35, fontSize:11.5, bold:true, color:ORANGE, fontFace:"Calibri" });
const vRows=[["Variant","Freq","Course / Clinical Risk"],["Replaced/accessory RHA from SMA","11–21%","Posterior to pancreas → posterior to portal vein → lateral in hepatoduodenal lig. (palpable)"],["Replaced/accessory LHA from L gastric","3.8–10%","Courses within lesser omentum → toward umbilical fissure"],["RHA anterior to CBD","~5%","At-risk during cholecystectomy — identify before clipping"],["Replaced CHA from SMA","Rare","Entire hepatic supply from SMA (hepatomesenteric trunk)"]];
vRows.forEach((row,ri) => {
const cy = 4.28+ri*0.26;
const cols_w=[2.6,0.9,2.16];
cols_w.forEach((w,ci) => {
const cx=0.28+[0,2.62,3.54][ci];
s.addShape(prs.ShapeType.rect,{x:cx,y:cy,w:w-0.03,h:0.24,fill:{color:ri===0?ORANGE:CARD},line:{color:ri===0?ORANGE:CARDBDR,pt:0.4}});
s.addText(row[ci],{x:cx+0.05,y:cy+0.03,w:w-0.12,h:0.18,fontSize:ri===0?9.5:9, bold:ri===0, color:ri===0?"FFFFFF":(ci===0?BLACK:LGRAY),fontFace:"Calibri"});
});
});
}
// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 10 — PORTAL VEIN & HEPATIC VEINS
// ═══════════════════════════════════════════════════════════════════════════
{
const s = addSlide();
titleBar(s, "04–05 — Portal Vein & Hepatic Venous Outflow", GREEN);
s.addText([
hd("Portal Vein Formation & Course", GREEN),
bul("Formed by: confluence of SMV + splenic vein, behind neck of pancreas",0,LGRAY),
bul("Left gastric (coronary) vein joins before porta hepatis",0,LGRAY),
bul("Travels posteromedially in hepatoduodenal ligament (deepest of 3 structures)",0,LGRAY),
hd("Right Portal Vein (RPV)", GREEN),
bul("Short trunk; early branch to caudate process",0,LGRAY),
bul("Bifurcates → Rt. anterior PV (Segs V,VIII) + Rt. posterior PV (Segs VI,VII)",0,LGRAY),
bul("Short extrahepatic course — dissection beyond bifurcation is challenging",0,ORANGE,true),
hd("Left Portal Vein (LPV)", GREEN),
bul("Longer extrahepatic course; runs horizontally beneath Seg IV",0,LGRAY),
bul("At umbilical fissure: Seg IV 'recurrent branches' at Rex recessus",0,LGRAY),
bul("Seg II (lateral superior), Seg III (lateral inferior) branches",0,LGRAY),
bul("Terminal end: ligamentum teres (obliterated umbilical vein)",0,LGRAY),
bul("Both RPV & LPV give branches to Segment I (caudate)",0,ORANGE,true),
], { x:0.28, y:0.98, w:6.0, h:4.5, fontFace:"Calibri", valign:"top" });
s.addText([
hd("Hepatic Venous Outflow", ORANGE),
bul("RHV: drains Segs VI,VII,V,VIII; runs in right scissura; joins IVC laterally as single branch",0,LGRAY),
bul("MHV: runs in Cantlie's line; drains IVa,IVb,V,VIII; often merges with LHV before IVC",0,LGRAY),
bul("LHV: runs in left scissura; drains Segs II,III; common trunk with MHV in ~60%",0,LGRAY),
bul("Accessory veins: small veins from Seg I & right posterior liver drain to retrohepatic IVC directly",0,LGRAY),
hd("Dual Blood Supply — Summary", ORANGE),
], { x:6.6, y:0.98, w:6.5, h:2.8, fontFace:"Calibri", valign:"top" });
// Dual supply table
const dsRows=[["Source","% Blood Flow","% O2 Delivery","Pressure"],["Portal vein","~75%","~50%","Low (5–10 mmHg)"],["Hepatic artery","~25%","~50%","High (systemic)"]];
dsRows.forEach((row,ri) => {
row.forEach((cell,ci) => {
const cx=6.6+ci*1.62, cy=3.9+ri*0.35;
s.addShape(prs.ShapeType.rect,{x:cx,y:cy,w:1.6,h:0.32,fill:{color:ri===0?GREEN:CARD},line:{color:ri===0?GREEN:CARDBDR,pt:0.5}});
s.addText(cell,{x:cx+0.05,y:cy+0.04,w:1.5,h:0.24,fontSize:ri===0?10:10, bold:ri===0, color:ri===0?"FFFFFF":(ci===0?BLACK:LGRAY),fontFace:"Calibri"});
});
});
calloutBox(s, 6.6, 4.7, 6.5, 0.65, "Glissonean pedicle approach: extrahepatic ligation of entire portal pedicles (portal vein + hepatic artery + bile duct) to a given sector/segment before parenchymal division. Key technique in modern liver surgery.", PURPLE);
}
// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 11 — SECTION DIVIDER: BILIARY SYSTEM
// ═══════════════════════════════════════════════════════════════════════════
{ const s=addSlide(); sectionDivider(s,"06–08","Biliary System","Intrahepatic ducts, extrahepatic tree, gallbladder, bile flow",PURPLE); }
// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 12 — BILIARY SYSTEM OVERVIEW + IMAGE
// ═══════════════════════════════════════════════════════════════════════════
{
const s = addSlide();
titleBar(s, "06 — Biliary System Overview & Intrahepatic Ducts", PURPLE);
s.addText([
hd("Microscopic Origin", PURPLE),
bul("Hepatocytes → bile canaliculi (~1 µm, between hepatocyte membranes)",0,LGRAY),
bul("Canaliculi → bile ductules (canals of Hering, cholangiocytes)",0,LGRAY),
bul("Ductules → interlobular bile ducts in portal triads → segmental ducts",0,LGRAY),
hd("Segmental Intrahepatic Ducts", PURPLE),
bul("Right anterior sectoral duct — vertical; drains Segs V & VIII",0,LGRAY),
bul("Right posterior sectoral duct — horizontal; drains Segs VI & VII",0,LGRAY),
bul("Left hepatic duct — longer transverse extrahepatic course under Seg IVb; more surgically accessible",0,LGRAY),
bul("Caudate ducts (Seg I): small ducts entering BOTH R & L hepatic duct systems (dual drainage)",0,LGRAY),
hd("Critical Variant: R. Posterior Sectoral Duct (~20%)", ORANGE),
bul("Courses posterior to right anterior duct → joins LEFT hepatic duct (not right)",0,ORANGE,true),
bul("Small minority: even lower entry into CBD → mistaken for cystic duct during cholecystectomy",0,ORANGE,true),
], { x:0.28, y:0.98, w:5.8, h:4.5, fontFace:"Calibri", valign:"top" });
// Biliary system image
s.addImage({ path:"/home/daytona/workspace/hepato_ppt/images/biliary_system.png", x:6.3, y:0.98, w:6.8, h:4.3 });
s.addText("Fig: Biliary system showing hepatic ducts, CBD, gallbladder and pancreatic duct (Wikimedia Commons)", {
x:6.3, y:5.3, w:6.8, h:0.28, fontSize:8, color:MGRAY, fontFace:"Calibri", italic:true, align:"center"
});
}
// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 13 — EXTRAHEPATIC BILIARY TREE
// ═══════════════════════════════════════════════════════════════════════════
{
const s = addSlide();
titleBar(s, "07 — Extrahepatic Biliary Tree", PURPLE);
s.addText([
hd("Right & Left Hepatic Ducts", PURPLE),
bul("Unite 0.25–2.5 cm from liver surface; biliary bifurcation abuts base of Seg IVb",0,LGRAY),
bul("Left hepatic duct longer transverse extrahepatic course → more surgically accessible",0,LGRAY),
hd("Common Hepatic Duct (CHD)", PURPLE),
bul("Below biliary bifurcation, above cystic duct; length 1–4 cm; diameter 4–5 mm",0,LGRAY),
bul("Runs anterior to portal vein in hepatoduodenal ligament",0,LGRAY),
hd("Cystic Duct", PURPLE),
bul("Length 1–5 cm; normally joins lateral wall of CHD at acute angle",0,LGRAY),
bul("Valves of Heister (spiral mucosal folds): regulate flow; complicate intraoperative cholangiography",0,LGRAY),
hd("CBD — 4 Segments", ORANGE),
bul("Supraduodenal (~2–3 cm): hepatoduodenal ligament; site of choledochotomy",0,LGRAY),
bul("Retroduodenal (~2 cm): posterior to 1st part duodenum; at-risk in duodenal surgery",0,LGRAY),
bul("Intrapancreatic (~3 cm): compressed in pancreatic cancer; narrowest/longest portion",0,LGRAY),
bul("Intramural (~1–2 cm): oblique through 2nd duodenum; narrows 10→5→2 mm",0,LGRAY),
bul("Gallstones lodge just proximal to ampulla at intramural narrowing — anatomical choke point",0,ORANGE,true),
], { x:0.28, y:0.98, w:6.0, h:4.5, fontFace:"Calibri", valign:"top" });
// Bile ducts image
s.addImage({ path:"/home/daytona/workspace/hepato_ppt/images/bile_ducts.jpg", x:6.3, y:0.98, w:4.0, h:3.0 });
s.addText("Fig: Pancreatic & Common Bile Ducts (Wikimedia Commons)", {
x:6.3, y:4.0, w:4.0, h:0.28, fontSize:8, color:MGRAY, fontFace:"Calibri", italic:true, align:"center"
});
// Cystic duct variants mini-table
s.addText("Cystic Duct Variants (~30%)", { x:6.3, y:4.35, w:6.8, h:0.32, fontSize:11, bold:true, color:ORANGE, fontFace:"Calibri" });
const cdv=[["Variant","Risk"],["Long parallel — runs alongside CHD","Mimics CHD; ductal injury"],["Short — GB nearly drains into CHD","Difficult clip placement"],["Medial insertion","Anomalous; at-risk in dissection"],["Low insertion near duodenum","Extends into distal CBD"],["Into right hepatic duct","Major injury risk"],["Spiral course around CHD","Misidentification at lap chole"]];
cdv.forEach((row,ri) => {
const cy=4.72+ri*0.24;
s.addShape(prs.ShapeType.rect,{x:6.3,y:cy,w:3.9,h:0.22,fill:{color:ri===0?PURPLE:CARD},line:{color:ri===0?PURPLE:CARDBDR,pt:0.4}});
s.addShape(prs.ShapeType.rect,{x:10.22,y:cy,w:2.9,h:0.22,fill:{color:ri===0?PURPLE:CARD},line:{color:ri===0?PURPLE:CARDBDR,pt:0.4}});
s.addText(row[0],{x:6.35,y:cy+0.03,w:3.78,h:0.16,fontSize:ri===0?9.5:9.5, bold:ri===0, color:ri===0?"FFFFFF":LGRAY,fontFace:"Calibri"});
s.addText(row[1],{x:10.28,y:cy+0.03,w:2.78,h:0.16,fontSize:ri===0?9.5:9.5, bold:ri===0, color:ri===0?"FFFFFF":ORANGE,fontFace:"Calibri"});
});
}
// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 14 — GALLBLADDER + CALOT'S + SPHINCTER + IMAGE
// ═══════════════════════════════════════════════════════════════════════════
{
const s = addSlide();
titleBar(s, "07b — Gallbladder, Calot's Triangle & Sphincter of Oddi", PURPLE);
s.addText([
hd("Gallbladder Anatomy", PURPLE),
bul("Pear-shaped; gallbladder fossa (Segs IVb & V); length 7–10 cm; capacity 30–60 mL",0,LGRAY),
bul("Hepatic surface: NO peritoneum — replaced by fibrous cystic plate",0,LGRAY),
bul("Fundus — projects beyond inferior liver; easily palpable",0,LGRAY),
bul("Body — contacts hepatic flexure and 1st part of duodenum",0,LGRAY),
bul("Infundibulum (Hartmann's pouch) — stones lodge here; can abut CBD",0,LGRAY),
bul("Neck — narrows into cystic duct; valves of Heister; S-shaped",0,LGRAY),
bul("No submucosa (unlike rest of GI tract)",0,ORANGE,true),
hd("Calot's Triangle", PURPLE),
bul("Classic (1891): cystic duct (inf) + CHD (medial) + cystic artery (sup)",0,LGRAY),
bul("Modern hepatocystic triangle: cystic duct (inf) + CHD (medial) + liver undersurface (sup)",0,LGRAY),
bul("Critical View of Safety (CVS): dissect until only 2 structures enter GB before clipping",0,ORANGE,true),
], { x:0.28, y:0.98, w:5.8, h:4.5, fontFace:"Calibri", valign:"top" });
// Hepatic artery image (shows proper hepatic artery and cystic artery region)
s.addImage({ path:"/home/daytona/workspace/hepato_ppt/images/hepatic_artery.png", x:6.3, y:0.98, w:6.8, h:3.0 });
s.addText("Fig: Common and proper hepatic artery with cystic branch (Wikimedia Commons)", {
x:6.3, y:4.0, w:6.8, h:0.25, fontSize:8, color:MGRAY, fontFace:"Calibri", italic:true, align:"center"
});
s.addText([
hd("Sphincter of Oddi — Components", GREEN),
bul("Sphincter of bile duct (choledochal sphincter): primary controller; maintains high tonic contraction fasting",0,LGRAY),
bul("Sphincter of pancreatic duct: controls pancreatic juice outflow",0,LGRAY),
bul("Sphincter of hepatopancreatic ampulla: surrounds entire ampulla",0,LGRAY),
bul("Location: posteromedial wall of 2nd part duodenum, ~7–10 cm distal to pylorus",0,LGRAY),
bul("Pancreaticobiliary malunion: common channel >6 mm → associated with choledochal cysts",0,ORANGE,true),
], { x:6.3, y:4.35, w:6.8, h:1.3, fontFace:"Calibri", valign:"top" });
}
// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 15 — BILE FLOW & ENTEROHEPATIC CIRCULATION
// ═══════════════════════════════════════════════════════════════════════════
{
const s = addSlide();
titleBar(s, "08 — Bile Flow, CCK & Enterohepatic Circulation", GREEN);
card(s, 0.28, 0.98, 4.05, 2.1, "Fasting State", [
"Sphincter of Oddi: high tonic contraction",
"Bile flows CHD → cystic duct → gallbladder",
"Gallbladder epithelium absorbs Na+ and water → 5–10x concentration",
"Concentrated bile → promotes gallstone nucleation (↑cholesterol, ↑calcium)",
], GREEN);
card(s, 4.55, 0.98, 4.05, 2.1, "Postprandial (CCK-Driven) State", [
"Fat/protein in duodenum → CCK released",
"CCK: stimulates GB smooth muscle contraction",
"CCK: relaxes Sphincter of Oddi → bile into duodenum",
"CCK: stimulates pancreatic enzyme secretion",
"Secretin → bicarbonate-rich fluid from cholangiocytes",
], ORANGE);
card(s, 9.05, 0.98, 4.05, 2.1, "Enterohepatic Circulation", [
"Bile acids emulsify dietary fats in duodenum",
"Active reabsorption in terminal ileum (>95%)",
"Returned to liver via portal vein (bound to albumin)",
"Bile acid pool ~3 g; cycles 4–12×/day → 12–36 g/day biliary secretion",
"Only 0.2–0.6 g/day lost in feces → replaced from cholesterol",
], PURPLE);
// Accessory/aberrant ducts
s.addShape(prs.ShapeType.roundRect, {x:0.28,y:3.22,w:12.82,h:1.05,rectRadius:0.06,fill:{color:CARD},line:{color:GREEN,pt:1.2}});
s.addText("Accessory & Aberrant Hepatic Ducts", {x:0.42,y:3.3,w:5.0,h:0.35,fontSize:11.5,bold:true,color:GREEN,fontFace:"Calibri"});
s.addText([
{text:"True Accessory Ducts (~10%): ", options:{bold:true,color:GREEN,fontSize:10.5,fontFace:"Calibri"}},
{text:"extra bud from biliary anlage; drain into GB, hepatic ducts, cystic duct or CBD; more common on right. ", options:{color:LGRAY,fontSize:10.5,fontFace:"Calibri"}},
{text:"Aberrant Ducts (~10%): ", options:{bold:true,color:ORANGE,fontSize:10.5,fontFace:"Calibri"}},
{text:"extrahepatic course of normally intrahepatic duct; almost always right anterior sectoral duct; can be mistaken for cystic duct. ", options:{color:LGRAY,fontSize:10.5,fontFace:"Calibri"}},
{text:"Luschka (Subvesicular) Ducts: ", options:{bold:true,color:PURPLE,fontSize:10.5,fontFace:"Calibri"}},
{text:"drain liver bed directly into GB; source of post-cholecystectomy bile leak — stay close to GB wall.", options:{color:LGRAY,fontSize:10.5,fontFace:"Calibri"}},
], {x:0.42,y:3.65,w:12.5,h:0.55,fontFace:"Calibri",valign:"top"});
// Biliary summary flow diagram
s.addText("Biliary Tree — Complete Flow", {x:0.28,y:4.38,w:13.0,h:0.32,fontSize:11.5,bold:true,color:PURPLE,fontFace:"Calibri",align:"center"});
const flow=["Bile Canaliculi","Bile Ductules (canals of Hering)","Interlobular Bile Ducts","Segmental Ducts (Couinaud)","R & L Hepatic Ducts","Common Hepatic Duct (CHD)","[+ Cystic Duct]","Common Bile Duct (CBD) → 4 segments","Hepatopancreatic Ampulla of Vater","Major Duodenal Papilla → DUODENUM"];
const cols_f=[PURPLE,GREEN,GREEN,ORANGE,ORANGE,PURPLE,MGRAY,PURPLE,ORANGE,GREEN];
flow.forEach((item,i) => {
const x=0.28+i*1.3;
s.addShape(prs.ShapeType.rect,{x,y:4.78,w:1.22,h:0.4,fill:{color:CARD},line:{color:cols_f[i],pt:1.0}});
s.addText(item,{x:x+0.04,y:4.81,w:1.14,h:0.34,fontSize:7.5,color:cols_f[i],fontFace:"Calibri",align:"center",valign:"middle",bold:i===7||i===9});
if(i<9) s.addText("→",{x:x+1.22,y:4.9,w:0.08,h:0.2,fontSize:8,color:MGRAY,fontFace:"Calibri",align:"center"});
});
}
// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 16 — SECTION DIVIDER: CONGENITAL ANOMALIES
// ═══════════════════════════════════════════════════════════════════════════
{ const s=addSlide(); sectionDivider(s,"09","Congenital Anomalies","Biliary atresia, choledochal cysts, Caroli disease, Alagille syndrome, gallbladder anomalies",ORANGE); }
// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 17 — BILIARY ATRESIA
// ═══════════════════════════════════════════════════════════════════════════
{
const s = addSlide();
titleBar(s, "09a — Biliary Atresia", ORANGE);
s.addText([
hd("Definition & Epidemiology"),
bul("Complete obstruction of bile flow due to destruction of extrahepatic bile ducts + concomitant intrahepatic injury",0,LGRAY),
bul("Incidence: 1 in 10,000–15,000 live births (USA); ~1/3 of neonatal cholestatic jaundice",0,LGRAY),
bul("Leading cause of death from liver disease in children — ~50% of pediatric liver transplants",0,ORANGE,true),
bul("NOT inherited — discordant in monozygotic twins",0,LGRAY),
hd("Etiology & Pathogenesis (Multifactorial)"),
bul("Injury occurs AFTER biliary morphogenesis (postnatal — not a morphogenetic failure)",0,LGRAY),
bul("Viral: CMV, rotavirus C, EBV, reovirus 3 — perinatal infection as initiator",0,LGRAY),
bul("Toxin: plant isoflavonoid ingestion (livestock/zebrafish models)",0,LGRAY),
bul("Immune/inflammatory: coordinated activation of lymphocyte differentiation genes",0,LGRAY),
bul("Genetics: GPC1 (glypican-1; regulates Hedgehog signaling) — reduced in cholangiocytes; susceptibility locus 10q24.2",0,LGRAY),
], { x:0.28, y:0.98, w:6.2, h:3.5, fontFace:"Calibri", valign:"top" });
// Types as cards
const types=[["Type I\n~5%","Atresia of CBD\nCorrectable",ORANGE],["Type II\n~2%","Atresia of hepatic duct\nCorrectable",GREEN],["Type III\n~93%","Atresia at porta hepatis\nNon-correctable",PURPLE]];
types.forEach((t,i) => {
const x=0.28+i*2.1;
s.addShape(prs.ShapeType.roundRect,{x,y:4.55,w:1.95,h:1.0,rectRadius:0.07,fill:{color:CARD},line:{color:t[2],pt:1.3}});
s.addShape(prs.ShapeType.rect,{x,y:4.55,w:1.95,h:0.06,fill:{color:t[2]},line:{color:t[2]}});
s.addText(t[0],{x:x+0.08,y:4.65,w:1.79,h:0.4,fontSize:11,bold:true,color:t[2],fontFace:"Calibri",align:"center"});
s.addText(t[1],{x:x+0.08,y:5.05,w:1.79,h:0.44,fontSize:10,color:LGRAY,fontFace:"Calibri",align:"center"});
});
s.addText([
hd("Clinical Features", GREEN),
bul("Neonatal jaundice persisting beyond 2 weeks",0,LGRAY),
bul("Acholic (clay-colored) stools, dark urine, hepatomegaly",0,LGRAY),
bul("Progressive biliary cirrhosis if untreated",0,LGRAY),
hd("Treatment", GREEN),
bul("Kasai Portoenterostomy: excise fibrous biliary remnant → Roux-en-Y jejunal anastomosis to hepatic parenchyma at portal plate",0,LGRAY),
bul("Best results if performed before 60 days of age",0,ORANGE,true),
bul("Liver transplantation if Kasai fails or delayed presentation",0,LGRAY),
], { x:7.0, y:0.98, w:6.1, h:4.5, fontFace:"Calibri", valign:"top" });
}
// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 18 — CHOLEDOCHAL CYSTS
// ═══════════════════════════════════════════════════════════════════════════
{
const s = addSlide();
titleBar(s, "09b — Choledochal Cysts: Todani Classification", PURPLE);
const todani=[
["Type I\n50–80%","Simple CBD cyst\n(Ia cystic / Ib segmental / Ic fusiform)",ORANGE],
["Type II\n~2%","Diverticulum off any portion\nof biliary tree",GREEN],
["Type III\n1.4–4.5%","Choledochocele —\ndistal intraduodenal CBD dilation",PURPLE],
["Type IV\n15–35%","Both intra- AND extrahepatic\nbile duct involvement",ORANGE],
["Type V\n~20%","Caroli disease —\nintrahepatic ducts only",GREEN],
];
todani.forEach((item,i) => {
const x=0.28+i*2.62;
s.addShape(prs.ShapeType.roundRect,{x,y:0.98,w:2.5,h:2.3,rectRadius:0.08,fill:{color:CARD},line:{color:item[2],pt:1.4}});
s.addShape(prs.ShapeType.rect,{x,y:0.98,w:2.5,h:0.06,fill:{color:item[2]},line:{color:item[2]}});
s.addText(item[0],{x:x+0.1,y:1.08,w:2.3,h:0.52,fontSize:12.5,bold:true,color:item[2],fontFace:"Calibri",align:"center"});
s.addShape(prs.ShapeType.rect,{x:x+0.2,y:1.62,w:2.1,h:0.02,fill:{color:CARDBDR},line:{color:CARDBDR}});
s.addText(item[1],{x:x+0.1,y:1.67,w:2.3,h:1.5,fontSize:10.5,color:LGRAY,fontFace:"Calibri",align:"center",valign:"top"});
});
s.addText([
hd("Pathogenesis", PURPLE),
bul("Pancreaticobiliary malunion: long common channel (>6 mm) → pancreatic enzyme reflux → duct wall inflammation & dilation",0,LGRAY),
bul("Elevated amylase + trypsinogen in cyst bile supports this mechanism",0,LGRAY),
hd("Epidemiology & Risk", PURPLE),
bul("Female:Male 3–4:1; more common in Asia",0,LGRAY),
bul("Associated with cholangiocarcinoma risk even after resection — Types IV and V highest risk",0,ORANGE,true),
], { x:0.28, y:3.4, w:6.4, h:2.2, fontFace:"Calibri", valign:"top" });
s.addShape(prs.ShapeType.roundRect,{x:7.0,y:3.4,w:6.1,h:2.2,rectRadius:0.06,fill:{color:CARD},line:{color:GREEN,pt:1.2}});
s.addShape(prs.ShapeType.rect,{x:7.0,y:3.4,w:6.1,h:0.06,fill:{color:GREEN},line:{color:GREEN}});
s.addText("Management",{x:7.12,y:3.5,w:5.8,h:0.38,fontSize:12,bold:true,color:GREEN,fontFace:"Calibri"});
s.addText([
bul("Complete cyst excision + Roux-en-Y hepaticojejunostomy",0,LGRAY),
bul("NOT internal drainage — leaves premalignant epithelium in situ",0,ORANGE,true),
bul("Type III (choledochocele): endoscopic sphincterotomy may suffice",0,LGRAY),
bul("Type V (Caroli): ursodeoxycholic acid; hepatectomy (unilobar); liver transplant (diffuse)",0,LGRAY),
], { x:7.12, y:3.92, w:5.8, h:1.6, fontFace:"Calibri", valign:"top" });
}
// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 19 — CAROLI + CHF + ALAGILLE
// ═══════════════════════════════════════════════════════════════════════════
{
const s = addSlide();
titleBar(s, "09c — Caroli Disease, Congenital Hepatic Fibrosis & Alagille Syndrome", GREEN);
card(s, 0.28, 0.98, 4.1, 4.45, "Caroli Disease (Type V Choledochal Cyst)", [
"Segmental, non-obstructive saccular dilation of intrahepatic biliary tree",
"Caroli syndrome = Caroli + CHF + cystic kidney disease (ARPKD/medullary sponge kidney)",
"CT/MRI: 'central dot sign' — portal radicle surrounded by dilated bile duct",
"Complications: recurrent cholangitis, intrahepatic stones, liver abscess, cholangiocarcinoma",
"Rx: ursodeoxycholic acid (symptoms); hepatectomy (unilobar); liver transplant (diffuse)",
], PURPLE);
card(s, 4.6, 0.98, 4.1, 4.45, "Congenital Hepatic Fibrosis", [
"Ductal plate malformation — arrested remodeling of embryonic ductal plate",
"Features: von Meyenburg complexes (biliary microhamartomas) + periportal fibrosis",
"Associated with ARPKD",
"Presents with portal hypertension (splenomegaly, varices, hypersplenism)",
"Preserved hepatocellular function (distinguishes from cirrhosis)",
"Co-exists with Caroli syndrome",
"Rx: manage complications; liver transplant",
], GREEN);
card(s, 8.92, 0.98, 4.18, 4.45, "Alagille Syndrome", [
"Autosomal dominant — JAG1 gene mutation (chr 20p12; Jagged-1, Notch ligand)",
"Paucity of intrahepatic bile ducts (bile duct:portal tract ratio < 0.5)",
"5 Features:",
" • Arteriohepatic dysplasia",
" • Absent/paucity bile ducts",
" • Abnormal facies (broad forehead, deep-set eyes, pointed chin)",
" • Anterior chamber eye defects (posterior embryotoxon)",
" • Aortic/CV defects (peripheral pulmonary artery stenosis)",
" • Butterfly vertebrae",
"Rx: symptomatic; biliary diversion; OLT",
], ORANGE);
}
// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 20 — GALLBLADDER ANOMALIES
// ═══════════════════════════════════════════════════════════════════════════
{
const s = addSlide();
titleBar(s, "09d — Gallbladder & Bile Duct Anomalies", ORANGE);
const anoms=[
["Agenesis","0.03%","Complete absence of GB; associated with extrahepatic biliary anomalies; increased risk of biliary calculi; avoid unnecessary surgical exploration",ORANGE],
["Duplication","Rare","Two separate GBs each with own cystic duct (true) or shared neck (bilobed/H-type); both can form stones; laparoscopic cholecystectomy may need modification",GREEN],
["Ectopic GB","Rare","Left-sided, retrohepatic, intrahepatic, or within falciform ligament; may present as incidental finding; altered surgical approach required",PURPLE],
["Phrygian Cap","~4%","Folding of fundus over body; most common GB variant; usually clinically insignificant; can mimic disease on ultrasound or CT",ORANGE],
["Multiseptate GB","Rare","Internal septa divide lumen into multiple compartments; bile stasis and stone formation; biliary-type pain, recurrent cholecystitis",GREEN],
["Floating GB","Rare","Suspended by long mesentery; predisposed to torsion (volvulus); presents acutely with severe RUQ pain; urgent cholecystectomy",PURPLE],
];
anoms.forEach((item,i) => {
const row=Math.floor(i/3), ci=i%3;
const x=0.28+ci*4.35, y=1.0+row*2.25;
s.addShape(prs.ShapeType.roundRect,{x,y,w:4.2,h:2.1,rectRadius:0.07,fill:{color:CARD},line:{color:item[3],pt:1.2}});
s.addShape(prs.ShapeType.rect,{x,y,w:4.2,h:0.06,fill:{color:item[3]},line:{color:item[3]}});
s.addText(item[0],{x:x+0.12,y:y+0.12,w:2.6,h:0.36,fontSize:13,bold:true,color:item[3],fontFace:"Calibri"});
s.addText(item[1],{x:x+2.8,y:y+0.12,w:1.28,h:0.36,fontSize:11,color:MGRAY,fontFace:"Calibri",align:"right"});
s.addShape(prs.ShapeType.rect,{x:x+0.12,y:y+0.52,w:3.96,h:0.015,fill:{color:CARDBDR},line:{color:CARDBDR}});
s.addText(item[2],{x:x+0.12,y:y+0.57,w:3.96,h:1.45,fontSize:10.5,color:LGRAY,fontFace:"Calibri",valign:"top"});
});
}
// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 21 — SUMMARY TABLE
// ═══════════════════════════════════════════════════════════════════════════
{
const s = addSlide();
titleBar(s, "Summary — Congenital Anomalies at a Glance", ORANGE);
const sumRows=[
["Anomaly","Key Feature","Complication","Treatment"],
["Biliary Atresia","Obliteration of extrahepatic bile ducts post-natally","Biliary cirrhosis, liver failure","Kasai portoenterostomy + liver transplant"],
["Choledochal Cyst (I–IV)","Cystic dilation of CBD ± intrahepatic ducts; pancreaticobiliary malunion","Cholangitis, pancreatitis, cholangiocarcinoma","Complete excision + Roux-en-Y hepaticojejunostomy"],
["Caroli Disease (V)","Saccular intrahepatic bile duct dilation; central dot sign","Recurrent cholangitis, stones, cholangiocarcinoma","UDCA; hepatectomy; OLT"],
["Congenital Hepatic Fibrosis","Ductal plate malformation; periportal fibrosis + ARPKD","Portal hypertension, varices","Manage complications; OLT"],
["Alagille Syndrome","JAG1 mutation; intrahepatic bile duct paucity; 5 hallmarks","Cholestasis, cirrhosis; cardiac disease","Symptomatic; biliary diversion; OLT"],
["GB Agenesis","Absent gallbladder (0.03%)","Biliary stones; surgical confusion","Awareness; avoid unnecessary exploration"],
];
const colW=[2.4,3.3,3.2,3.3], colX=[0.28,2.7,6.02,9.24];
const rowColors=[ORANGE,PURPLE,GREEN,GREEN,ORANGE,ORANGE];
sumRows.forEach((row,ri) => {
row.forEach((cell,ci) => {
const cy=0.98+ri*0.69;
s.addShape(prs.ShapeType.rect,{x:colX[ci],y:cy,w:colW[ci]-0.05,h:0.66,fill:{color:ri===0?ORANGE:CARD},line:{color:ri===0?ORANGE:CARDBDR,pt:0.5}});
s.addText(cell,{x:colX[ci]+0.08,y:cy+0.06,w:colW[ci]-0.2,h:0.54,fontSize:ri===0?11:10, bold:ri===0||ci===0, color:ri===0?"FFFFFF":(ci===0?rowColors[ri-1]||ORANGE:LGRAY),fontFace:"Calibri",valign:"top"});
});
});
}
// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 22 — REFERENCES
// ═══════════════════════════════════════════════════════════════════════════
{
const s = addSlide();
titleBar(s, "References", MGRAY);
const refs=[
"Wei AC. Hepatobiliary Anatomy. In: Mulholland & Greenfield's Surgery, 7th ed. Wolters Kluwer; 2022. Ch. 57, pp. 2772–2789.",
"Townsend CM et al. Sabiston Textbook of Surgery, 21st ed. Elsevier; 2022. Ch. 88–89, 117.",
"Fischer JE et al. Fischer's Mastery of Surgery, 8th ed. Wolters Kluwer; 2019. Ch. 165, pp. 4557–4560.",
"Yamada T et al. Yamada's Textbook of Gastroenterology, 7th ed. Wiley-Blackwell; 2016. Ch. 9, pp. 231–233.",
"Kumar V, Abbas AK. Robbins & Kumar Basic Pathology, 11th ed. Elsevier; 2023.",
"Blumgart LH, DeMatteo RP. Blumgart's Surgery of the Liver, Biliary Tract and Pancreas, 6th ed. Elsevier; 2017.",
"Drake RL, Vogl AW, Mitchell AWM. Gray's Anatomy for Students, 4th ed. Elsevier; 2019.",
"Bezerra JA. Biliary Atresia. In: Sleisenger & Fordtran's GI & Liver Disease, 11th ed. Elsevier; 2021. Ch. 62.",
];
const accents=[ORANGE,GREEN,PURPLE,ORANGE,GREEN,PURPLE,ORANGE,GREEN];
refs.forEach((ref,i) => {
s.addShape(prs.ShapeType.rect,{x:0.28,y:1.06+i*0.54,w:0.22,h:0.46,fill:{color:accents[i]},line:{color:accents[i]}});
s.addText(`${i+1}. ${ref}`,{x:0.62,y:1.08+i*0.54,w:12.5,h:0.46,fontSize:11,color:LGRAY,fontFace:"Calibri",valign:"top"});
});
}
// ── WRITE ─────────────────────────────────────────────────────────────────
prs.writeFile({ fileName: "/home/daytona/workspace/hepato_ppt/Hepatobiliary_Complete_v2.pptx" })
.then(() => console.log("DONE"))
.catch(e => console.error("ERROR:", e));
cd /home/daytona/workspace/hepato_ppt && node build_white.js 2>&1
ls -lh /home/daytona/workspace/hepato_ppt/Hepatobiliary_Complete_v2.pptx && python3 -c " from pptx import Presentation prs = Presentation('/home/daytona/workspace/hepato_ppt/Hepatobiliary_Complete_v2.pptx') print(f'Total slides: {len(prs.slides)}') for i, slide in enumerate(prs.slides): txts = [s.text_frame.paragraphs[0].text for s in slide.shapes if s.has_text_frame and s.text_frame.paragraphs[0].text.strip()] imgs = [s for s in slide.shapes if s.shape_type == 13] print(f' Slide {i+1}: {txts[0][:60] if txts else \"(no text)\"} | images: {len(imgs)}') "
Hepatobiliary Complete v2
Presentation · PPTX
#FFFFFF) backgrounds throughout#1A1A1A) main text, dark grey body text#D9660A) - anatomy, arterial, surgical callout accents#2E8B57) - Couinaud, portal/venous, biliary physiology accents#7B2FBE) - biliary tree, congenital anomaly accents#F4F4F4) with coloured top borders for content blocks| Slide | Image |
|---|---|
| Slide 6 - Couinaud Classification | Couinaud 8-segment map diagram |
| Slide 9 - Hepatic Arterial Supply | Celiac trunk and branch anatomy |
| Slide 12 - Intrahepatic Biliary Ducts | Full biliary system overview |
| Slide 13 - Extrahepatic Biliary Tree | Pancreatic & common bile ducts |
| Slide 14 - Gallbladder & Calot's | Proper hepatic artery with cystic branch |