Give me all the important triangles of skull base in neurosurgery along with images in a pdf format

Reading File
Reading File
Finding Sources
Finding Sources
Searching Images

skull base surgical triangles cavernous sinus approach anatomy diagram

Searching PubMed

skull base surgical triangles anatomy

Searching the Web

skull base surgical triangles anatomy neurosurgery cavernous sinus triangle diagram

Reading File
Reading File
Reading File
Reading Web Page

https://www.barrowneuro.org/for-physicians-researchers/educa…

Loading Image
Loading Image
Browsing Directory

~/

Reading Web Page

https://www.barrowneuro.org/for-physicians-researchers/educa…

Finding Sources
Loading Image
Loading Image
Browsing Directory

~/

Running Command

mkdir -p "/tmp/workspace/skull-base-triangles-pdf/src" "/tmp/workspace/skull-base-triangles-pdf/output" "/tmp/workspace/skull-base-triangles-pdf/assets"

Running Command

python - <<'PY' from pathlib import Path p=Path('/tmp/workspace/skull-base-triangles-pdf/src/create_pdf.py') p.write_text(r'''from reportlab.lib.pagesizes import A4, landscape from reportlab.lib import colors from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle from reportlab.lib.enums import TA_CENTER from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, PageBreak, Table, TableStyle, Image, KeepTogether from reportlab.lib.units import cm from reportlab.pdfbase.pdfmetrics import stringWidth import matplotlib.pyplot as plt from matplotlib.patches import Polygon from pathlib import Path ROOT=Path('/tmp/workspace/skull-base-triangles-pdf') AS=ROOT/'assets'; OUT=ROOT/'output' AS.mkdir(exist_ok=True); OUT.mkdir(exist_ok=True) # Original educational schematics: deliberately not to scale, designed to clarify relationships. def fig_parasellar(): fig,ax=plt.subplots(figsize=(12,7),dpi=170); ax.set_xlim(0,12); ax.set_ylim(0,8); ax.axis('off') pts={'ON':(2,6.8),'III':(5,5.5),'IV':(6,4.3),'V1':(7,3.0),'V2':(7.7,1.6),'ACP':(4,7.25),'PCP':(8.5,6.0),'Tent':(8.8,4.5),'SOF':(9.5,2.4)} # triangles [points,color,name, short] shapes=[(['ON','III','ACP'],'#90caf9','Clinoidal / Dolenc','optic nerve - III - clinoid/tentorial dura'), (['ACP','III','PCP'],'#a5d6a7','Oculomotor / Hakuba','anterior and posterior petroclinoid folds'), (['III','IV','Tent'],'#ffe082','Supratrochlear','III - IV - intervening tentorial edge'), (['IV','V1','Tent'],'#ffccbc','Infratrochlear / Parkinson','IV - V1 - posterior dural base')] for names,c,n,s in shapes: xy=[pts[x] for x in names]; ax.add_patch(Polygon(xy,closed=True,facecolor=c,edgecolor='#263238',lw=1.7,alpha=.85)); x=sum(a for a,b in xy)/3;y=sum(b for a,b in xy)/3;ax.text(x,y,n,ha='center',va='center',fontsize=9,weight='bold',wrap=True) # nerves for a,b in [('III','Tent'),('IV','Tent'),('V1','SOF'),('V2','SOF'),('ACP','PCP')]: ax.plot([pts[a][0],pts[b][0]],[pts[a][1],pts[b][1]],color='#37474f',lw=2) for k,(x,y) in pts.items(): ax.plot(x,y,'o',color='#263238',ms=4); ax.text(x+.12,y+.12,k,fontsize=9,weight='bold') ax.text(6,7.75,'PARASELLAR / CAVERNOUS-SINUS TRIANGLES (right side, schematic superior-lateral view)',ha='center',fontsize=14,weight='bold') ax.text(6,.35,'III = oculomotor; IV = trochlear; V1/V2 = trigeminal divisions; ON = optic nerve; ACP/PCP = anterior/posterior clinoid process.',ha='center',fontsize=9) fig.tight_layout(); path=AS/'parasellar.png';fig.savefig(path,transparent=False,bbox_inches='tight');plt.close(fig);return path def fig_middle(): fig,ax=plt.subplots(figsize=(12,7),dpi=170); ax.set_xlim(0,12); ax.set_ylim(0,8);ax.axis('off') # landmark coordinates P={'SOF':(2,6.2),'FR':(3.3,3.4),'FO':(5.1,1.7),'FS':(7.0,1.3),'GSPN':(7.2,5.3),'AE':(9.2,4.0),'PR/SPS':(9.4,6.5),'GG':(5.7,5.5)} sh=[(['SOF','FR','GG'],'#90caf9','Anterolateral','SOF, V1/V2 region, anterior trigeminal area'), (['FR','FO','GG'],'#a5d6a7','Lateral','V2-V3 / foramina rotundum-ovale region'), (['FO','FS','GSPN'],'#ffccbc','Posterolateral\nGlasscock','V3/foramen spinosum, GSPN, arcuate/hiatus line'), (['GSPN','AE','PR/SPS'],'#ffe082','Posteromedial\nKawase','GSPN, arcuate eminence, petrous ridge/SPS')] for names,c,n,s in sh: xy=[P[x] for x in names];ax.add_patch(Polygon(xy,closed=True,facecolor=c,edgecolor='#263238',lw=1.8,alpha=.86));x=sum(t[0] for t in xy)/3;y=sum(t[1] for t in xy)/3;ax.text(x,y,n,ha='center',va='center',fontsize=9,weight='bold') for k,(x,y) in P.items():ax.plot(x,y,'o',color='#263238',ms=4);ax.text(x+.1,y+.13,k,fontsize=9,weight='bold') ax.text(6,7.65,'MIDDLE-CRANIAL-FOSSA TRIANGLES (right side, extradural schematic)',ha='center',fontsize=14,weight='bold') ax.text(6,.28,'SOF = superior orbital fissure; FR/FO/FS = foramina rotundum/ovale/spinosum; GSPN = greater superficial petrosal nerve; AE = arcuate eminence; PR/SPS = petrous ridge/superior petrosal sinus; GG = Gasserian ganglion.',ha='center',fontsize=8.5) fig.tight_layout();path=AS/'middle.png';fig.savefig(path,bbox_inches='tight');plt.close(fig);return path def fig_paraclival(): fig,ax=plt.subplots(figsize=(12,5.5),dpi=170);ax.set_xlim(0,12);ax.set_ylim(0,7);ax.axis('off') P={'IV':(4,5.7),'VI':(5.8,1.4),'PV/SPS':(8.5,2.4),'Apex':(6.9,.7),'Tent':(8.2,5.4)} tris=[(['IV','VI','Apex'],'#ffe082','Inferomedial','CN IV/tentorial edge - CN VI at Dorello canal - petrous apex'),(['IV','VI','PV/SPS'],'#ffccbc','Inferolateral\n(trigeminal)','CN IV/tentorial edge - CN VI at Dorello canal - petrosal-vein/SPS point')] for names,c,n,s in tris: xy=[P[x] for x in names];ax.add_patch(Polygon(xy,closed=True,facecolor=c,edgecolor='#263238',lw=1.8,alpha=.88));x=sum(t[0] for t in xy)/3;y=sum(t[1] for t in xy)/3;ax.text(x,y,n,ha='center',va='center',fontsize=10,weight='bold') for k,(x,y) in P.items():ax.plot(x,y,'o',color='#263238',ms=4);ax.text(x+.12,y+.12,k,fontsize=9,weight='bold') ax.text(6,6.5,'PARACLIVAL TRIANGLES (posterior view schematic)',ha='center',fontsize=14,weight='bold') ax.text(6,.15,'VI enters at Dorello canal. The literature differs in the exact lateral apex and naming; use the operative definition adopted by your approach.',ha='center',fontsize=9) fig.tight_layout();path=AS/'paraclival.png';fig.savefig(path,bbox_inches='tight');plt.close(fig);return path parasellar,middle,paraclival=fig_parasellar(),fig_middle(),fig_paraclival() styles=getSampleStyleSheet() styles.add(ParagraphStyle(name='TitleX',parent=styles['Title'],fontName='Helvetica-Bold',fontSize=24,leading=29,alignment=TA_CENTER,textColor=colors.HexColor('#102a43'),spaceAfter=12)) styles.add(ParagraphStyle(name='Sub',parent=styles['Normal'],fontSize=11,leading=15,alignment=TA_CENTER,textColor=colors.HexColor('#486581'))) styles.add(ParagraphStyle(name='H1x',parent=styles['Heading1'],fontName='Helvetica-Bold',fontSize=16,leading=20,textColor=colors.HexColor('#0b4f6c'),spaceBefore=5,spaceAfter=8)) styles.add(ParagraphStyle(name='H2x',parent=styles['Heading2'],fontName='Helvetica-Bold',fontSize=12,leading=15,textColor=colors.HexColor('#102a43'),spaceBefore=5,spaceAfter=4)) styles.add(ParagraphStyle(name='Bodyx',parent=styles['BodyText'],fontSize=9.4,leading=12.7,spaceAfter=5)) styles.add(ParagraphStyle(name='Small',parent=styles['BodyText'],fontSize=7.7,leading=10)) story=[] story += [Spacer(1,1.0*cm),Paragraph('Important Skull-Base Triangles<br/>for Neurosurgical Anatomy',styles['TitleX']),Paragraph('A high-yield operative atlas of the classic parasellar, middle-fossa, and paraclival corridors',styles['Sub']),Spacer(1,.65*cm)] intro='''<b>Scope.</b> This guide uses the commonly taught <b>10-triangle skull-base classification</b>: 4 parasellar, 4 middle-cranial-fossa, and 2 paraclival triangles. These are geometric surgical corridors, not independent compartments. Their borders change slightly with the dural layer exposed, approach, and author. Therefore, learn both the landmarks and the target, rather than an eponym alone.<br/><br/><b>Safety frame.</b> This document is an anatomy study aid, not a surgical manual. Work in this region requires formal skull-base training, imaging review, cadaveric dissection, neurophysiologic monitoring where applicable, and a plan for vascular control and cavernous-sinus bleeding.''' story += [Table([[Paragraph(intro,styles['Bodyx'])]],colWidths=[16.5*cm],style=[('BACKGROUND',(0,0),(-1,-1),colors.HexColor('#eaf4f4')),('BOX',(0,0),(-1,-1),.7,colors.HexColor('#86b5b5')),('LEFTPADDING',(0,0),(-1,-1),12),('RIGHTPADDING',(0,0),(-1,-1),12),('TOPPADDING',(0,0),(-1,-1),10),('BOTTOMPADDING',(0,0),(-1,-1),10)]),Spacer(1,.45*cm)] key=[['Group','Classic triangles','Practical orientation'],['Parasellar / cavernous sinus','Clinoidal (Dolenc), oculomotor (Hakuba), supratrochlear, infratrochlear (Parkinson)','Roof and lateral wall of cavernous sinus'],['Middle cranial fossa','Anterolateral, lateral, posterolateral (Glasscock), posteromedial (Kawase)','Extradural petrous apex and trigeminal foramina'],['Paraclival','Inferomedial, inferolateral (trigeminal)','Petroclival/Dorello-canal region']] t=Table([[Paragraph(c,styles['Small']) for c in r] for r in key],colWidths=[3.2*cm,7.2*cm,6.1*cm],repeatRows=1) t.setStyle(TableStyle([('BACKGROUND',(0,0),(-1,0),colors.HexColor('#0b4f6c')),('TEXTCOLOR',(0,0),(-1,0),colors.white),('GRID',(0,0),(-1,-1),.35,colors.HexColor('#9fb3c8')),('VALIGN',(0,0),(-1,-1),'TOP'),('ROWBACKGROUNDS',(0,1),(-1,-1),[colors.white,colors.HexColor('#f4f7fa')]),('LEFTPADDING',(0,0),(-1,-1),6),('RIGHTPADDING',(0,0),(-1,-1),6),('TOPPADDING',(0,0),(-1,-1),6),('BOTTOMPADDING',(0,0),(-1,-1),6)])) story += [t,Spacer(1,.35*cm),Paragraph('<b>Abbreviations:</b> ICA internal carotid artery; CN cranial nerve; GSPN greater superficial petrosal nerve; SPS superior petrosal sinus; ACP/PCP anterior/posterior clinoid process.',styles['Bodyx']),PageBreak()] def triangle_table(rows): data=[[Paragraph('<b>Triangle</b>',styles['Small']),Paragraph('<b>Defining borders / landmarks</b>',styles['Small']),Paragraph('<b>Operative relevance and key hazard</b>',styles['Small'])]] for a,b,c in rows:data.append([Paragraph(a,styles['Small']),Paragraph(b,styles['Small']),Paragraph(c,styles['Small'])]) T=Table(data,colWidths=[3.5*cm,7.0*cm,6.0*cm],repeatRows=1) T.setStyle(TableStyle([('BACKGROUND',(0,0),(-1,0),colors.HexColor('#0b4f6c')),('TEXTCOLOR',(0,0),(-1,0),colors.white),('GRID',(0,0),(-1,-1),.3,colors.HexColor('#9fb3c8')),('VALIGN',(0,0),(-1,-1),'TOP'),('ROWBACKGROUNDS',(0,1),(-1,-1),[colors.white,colors.HexColor('#f4f7fa')]),('LEFTPADDING',(0,0),(-1,-1),5),('RIGHTPADDING',(0,0),(-1,-1),5),('TOPPADDING',(0,0),(-1,-1),5),('BOTTOMPADDING',(0,0),(-1,-1),5)]));return T story += [Paragraph('1. Parasellar and cavernous-sinus triangles',styles['H1x']),Image(str(parasellar),width=16.4*cm,height=9.55*cm),Spacer(1,.15*cm)] rows=[('<b>Anteromedial / clinoidal (Dolenc)</b>','Optic nerve medially, CN III laterally, and intervening falciform/tentorial dura. Usually requires anterior clinoidectomy.','Exposes clinoid ICA and proximal/distal dural rings. Hazards: optic apparatus, ophthalmic artery, clinoid ICA.'),('<b>Oculomotor / Hakuba</b>','Dural triangle at the CN III entry: anterior and posterior petroclinoid folds with the interclinoid dural fold.','Route toward horizontal cavernous ICA and CN III entry. Hazard: CN III and cavernous ICA.'),('<b>Supratrochlear</b>','CN III medially, CN IV laterally, tentorial edge posteriorly.','A lateral-wall corridor above CN IV. Hazard: both ocular motor nerves and venous channels.'),('<b>Infratrochlear / Parkinson</b>','CN IV superiorly/medially, V1 inferiorly/laterally, posterior dural base at tentorial edge.','Classic direct entry to cavernous sinus, cavernous ICA, meningohypophyseal trunk and CN VI. Hazard: CN VI, ICA, cavernous bleeding.')] story += [triangle_table(rows),PageBreak()] story += [Paragraph('2. Middle-cranial-fossa triangles',styles['H1x']),Image(str(middle),width=16.4*cm,height=9.55*cm),Spacer(1,.15*cm)] rows=[('<b>Anterolateral</b>','Anterior trigeminal/superior orbital fissure region, typically framed by SOF and V1-V2 landmarks.','Orients dissection toward SOF, foramen rotundum and anterior lateral cavernous wall. Hazard: V1, V2, orbital apex.'),('<b>Lateral</b>','Trigeminal middle-fossa corridor centered on V2-V3 and foramina rotundum/ovale.','Useful geographic landmark toward Meckel cave and infratemporal connections. Hazard: trigeminal divisions and middle meningeal branches.'),('<b>Posterolateral / Glasscock</b>','GSPN medially, V3 anteriorly, and a lateral line from foramen spinosum toward arcuate eminence/facial hiatus.','Localizes petrous ICA below GSPN and posterior middle-fossa floor. Hazard: petrous ICA, GSPN, geniculate/facial nerve, middle meningeal artery.'),('<b>Posteromedial / Kawase</b>','GSPN laterally, petrous ridge/SPS medially, arcuate eminence posteriorly, with anterior relation to trigeminal ganglion/V3.','Petrous-apex drilling corridor to upper clivus, petroclival region and anterolateral pons. Hazard: cochlea posterolaterally, petrous ICA, GSPN, SPS.')] story += [triangle_table(rows),PageBreak()] story += [Paragraph('3. Paraclival triangles',styles['H1x']),Image(str(paraclival),width=16.4*cm,height=7.5*cm),Spacer(1,.2*cm)] rows=[('<b>Inferomedial</b>','CN IV/tentorial edge to CN VI at Dorello canal, with petrous apex as the inferior base.','Defines a petroclival corridor near the abducens entry and posterior cavernous sinus. Hazard: CN VI, dorsal clivus/basilar region and venous plexus.'),('<b>Inferolateral / trigeminal</b>','Lateral to inferomedial: CN IV-tentorial edge to CN VI at Dorello canal and a lateral petrosal-vein/SPS landmark.','A lateral petroclival working space. Hazard: petrosal venous complex, CN VI and trigeminal/petroclival structures.')] story += [triangle_table(rows),Spacer(1,.3*cm),Paragraph('<b>Nomenclature alert:</b> “Anteromedial,” “lateral,” and “trigeminal” are not used uniformly between atlases. The safest communication is to name the actual border structures, dural layer, and intended target.',styles['Bodyx']),PageBreak()] story += [Paragraph('Rapid recall and surgical orientation',styles['H1x'])] recall=[['If you see...','Think...','First safety question'],['Optic nerve + CN III','Clinoidal / Dolenc','Where are the optic canal, clinoid ICA, and dural rings?'],['CN III + CN IV','Supratrochlear','Which layer of lateral cavernous wall is open?'],['CN IV + V1','Parkinson','Where is CN VI relative to the ICA and venous sinus?'],['GSPN + petrous ridge + arcuate eminence','Kawase','Where are cochlea, petrous ICA and SPS?'],['Foramen spinosum + GSPN + V3','Glasscock','Where is petrous ICA beneath the GSPN?'],['Dorello canal / CN VI','Paraclival','How will the abducens and petrosal veins be protected?']] T=Table([[Paragraph('<b>'+c+'</b>',styles['Small']) for c in recall[0]]] + [[Paragraph(c,styles['Small']) for c in row] for row in recall[1:]],colWidths=[5.2*cm,4.3*cm,7.0*cm],repeatRows=1) T.setStyle(TableStyle([('BACKGROUND',(0,0),(-1,0),colors.HexColor('#0b4f6c')),('TEXTCOLOR',(0,0),(-1,0),colors.white),('GRID',(0,0),(-1,-1),.3,colors.HexColor('#9fb3c8')),('VALIGN',(0,0),(-1,-1),'TOP'),('ROWBACKGROUNDS',(0,1),(-1,-1),[colors.white,colors.HexColor('#f4f7fa')]),('LEFTPADDING',(0,0),(-1,-1),6),('RIGHTPADDING',(0,0),(-1,-1),6),('TOPPADDING',(0,0),(-1,-1),6),('BOTTOMPADDING',(0,0),(-1,-1),6)])) story += [T,Spacer(1,.4*cm),Paragraph('Selected sources',styles['H2x']),Paragraph('• Isolan GR, Krayenbühl N, de Oliveira E, Al-Mefty O. Microsurgical anatomy of the cavernous sinus: measurements of the triangles in and around it. <i>Skull Base</i>. 2007;17:357-367.<br/>• Gasco J, Nader R. Skull Base Triangles. Parasellar, middle-fossa and paraclival classification.<br/>• Barrow Neurological Institute. Microsurgical Anatomy of the Cavernous Sinus. 1996.<br/>• K J Lee’s Essential Otolaryngology, Middle Cranial Fossa, p. 887.<br/>• Shambaugh Surgery of the Ear, Surgical approach, pp. 741-742.<br/>• The figures in this PDF are original, not-to-scale educational schematics created for this guide.',styles['Bodyx']),Spacer(1,.25*cm),Paragraph('Evidence update: a 2026 systematic review of olfactory-fossa anatomy (PMID 41543618) concerns anterior skull-base morphology, not these cavernous-sinus triangle definitions. It does not alter this anatomy summary.',styles['Small'])] def footer(canvas,doc): canvas.saveState(); canvas.setFont('Helvetica',7.5);canvas.setFillColor(colors.HexColor('#486581'));canvas.drawString(1.4*cm,.7*cm,'Skull-Base Triangles for Neurosurgical Anatomy | Educational schematic guide');canvas.drawRightString(19.6*cm,.7*cm,f'Page {doc.page}');canvas.restoreState() pdf=OUT/'Skull_Base_Triangles_Neurosurgery.pdf' doc=SimpleDocTemplate(str(pdf),pagesize=A4,rightMargin=1.3*cm,leftMargin=1.3*cm,topMargin=1.1*cm,bottomMargin=1.2*cm,title='Skull-Base Triangles for Neurosurgical Anatomy',author='Orris') doc.build(story,onFirstPage=footer,onLaterPages=footer) print(pdf) ''') PY python "/tmp/workspace/skull-base-triangles-pdf/src/create_pdf.py" python - <<'PY' from pypdf import PdfReader p='/tmp/workspace/skull-base-triangles-pdf/output/Skull_Base_Triangles_Neurosurgery.pdf' r=PdfReader(p) print('pages',len(r.pages),'size',__import__('os').path.getsize(p)) for i,page in enumerate(r.pages): t=page.extract_text() or '' print(i+1,len(t),t[:70].replace('\n',' | ')) PY

Writing File

~/skull-base-triangles-pdf/src/create_pdf.py

from pathlib import Path
import os
import matplotlib.pyplot as plt
from matplotlib.patches import Polygon
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.styles import getSampleStyleSheet,ParagraphStyle
from reportlab.lib.enums import TA_CENTER
from reportlab.lib.units import cm
from reportlab.platypus import SimpleDocTemplate,Paragraph,Spacer,PageBreak,Table,TableStyle,Image

R=Path('/tmp/workspace/skull-base-triangles-pdf'); A=R/'assets'; O=R/'output'; A.mkdir(exist_ok=True); O.mkdir(exist_ok=True)
def diagram(name,title,pts,shapes,note):
 fig,ax=plt.subplots(figsize=(12,6),dpi=160);ax.set_xlim(0,12);ax.set_ylim(0,8);ax.axis('off')
 palette=['#90caf9','#a5d6a7','#ffe082','#ffccbc']
 for j,(labs,label) in enumerate(shapes):
  xy=[pts[x] for x in labs];ax.add_patch(Polygon(xy,closed=True,facecolor=palette[j],edgecolor='#263238',lw=1.7,alpha=.88));x=sum(q[0] for q in xy)/3;y=sum(q[1] for q in xy)/3;ax.text(x,y,label,ha='center',va='center',fontsize=9,weight='bold')
 for k,(x,y) in pts.items():ax.plot(x,y,'o',color='#263238',ms=4);ax.text(x+.12,y+.12,k,fontsize=8.5,weight='bold')
 ax.text(6,7.65,title,ha='center',fontsize=14,weight='bold');ax.text(6,.25,note,ha='center',fontsize=8.5)
 fig.tight_layout();p=A/name;fig.savefig(p,bbox_inches='tight');plt.close(fig);return p
p1=diagram('parasellar.png','PARASELLAR / CAVERNOUS-SINUS TRIANGLES (right, schematic)',{'ON':(2,6.6),'III':(5,5.4),'IV':(6,4.2),'V1':(7,2.8),'ACP':(4,7.15),'PCP':(8.4,5.9),'Tent':(8.5,4.5)},[(['ON','III','ACP'],'Clinoidal / Dolenc'),(['ACP','III','PCP'],'Oculomotor / Hakuba'),(['III','IV','Tent'],'Supratrochlear'),(['IV','V1','Tent'],'Infratrochlear\nParkinson')],'ON optic nerve; III/IV ocular motor nerves; V1 ophthalmic trigeminal division; ACP/PCP anterior/posterior clinoid; Tent tentorial edge.')
p2=diagram('middle.png','MIDDLE-CRANIAL-FOSSA TRIANGLES (right, extradural schematic)',{'SOF':(2,6.2),'FR':(3.4,3.5),'FO':(5.1,1.6),'FS':(7,1.3),'GSPN':(7.2,5.2),'AE':(9.1,4),'PR/SPS':(9.4,6.4),'GG':(5.7,5.5)},[(['SOF','FR','GG'],'Anterolateral'),(['FR','FO','GG'],'Lateral'),(['FO','FS','GSPN'],'Posterolateral\nGlasscock'),(['GSPN','AE','PR/SPS'],'Posteromedial\nKawase')],'SOF superior orbital fissure; FR/FO/FS foramina rotundum/ovale/spinosum; GSPN greater superficial petrosal nerve; AE arcuate eminence; PR/SPS petrous ridge/superior petrosal sinus; GG Gasserian ganglion.')
p3=diagram('paraclival.png','PARACLIVAL TRIANGLES (posterior schematic)',{'IV':(4,5.7),'VI':(5.8,1.4),'PV/SPS':(8.5,2.4),'Apex':(6.9,.8),'Tent':(8.2,5.4)},[(['IV','VI','Apex'],'Inferomedial'),(['IV','VI','PV/SPS'],'Inferolateral\n(trigeminal)')],'VI enters at Dorello canal. Definitions vary between authors: communicate actual borders, dural layer and target.')
S=getSampleStyleSheet();S.add(ParagraphStyle(name='T',parent=S['Title'],fontSize=23,leading=28,alignment=TA_CENTER,textColor=colors.HexColor('#102a43')));S.add(ParagraphStyle(name='H',parent=S['Heading1'],fontSize=16,leading=20,textColor=colors.HexColor('#0b4f6c')));S.add(ParagraphStyle(name='B',parent=S['BodyText'],fontSize=9.1,leading=12));S.add(ParagraphStyle(name='X',parent=S['BodyText'],fontSize=7.5,leading=9.5))
def P(x,style='B'):return Paragraph(x,S[style])
def tab(rows):
 data=[[P('<b>Triangle</b>','X'),P('<b>Defining borders / landmarks</b>','X'),P('<b>Operative relevance and key hazard</b>','X')]]+[[P(x,'X') for x in r] for r in rows]
 t=Table(data,colWidths=[3.5*cm,7*cm,6*cm],repeatRows=1);t.setStyle(TableStyle([('BACKGROUND',(0,0),(-1,0),colors.HexColor('#0b4f6c')),('TEXTCOLOR',(0,0),(-1,0),colors.white),('GRID',(0,0),(-1,-1),.3,colors.HexColor('#9fb3c8')),('VALIGN',(0,0),(-1,-1),'TOP'),('ROWBACKGROUNDS',(0,1),(-1,-1),[colors.white,colors.HexColor('#f4f7fa')]),('LEFTPADDING',(0,0),(-1,-1),5),('RIGHTPADDING',(0,0),(-1,-1),5),('TOPPADDING',(0,0),(-1,-1),5),('BOTTOMPADDING',(0,0),(-1,-1),5)]));return t
story=[Spacer(1,1*cm),P('Important Skull-Base Triangles<br/>for Neurosurgical Anatomy','T'),Spacer(1,.35*cm),P('A high-yield operative atlas of classic parasellar, middle-fossa and paraclival corridors','B'),Spacer(1,.3*cm),P('<b>Scope.</b> The commonly taught 10-triangle classification comprises four parasellar, four middle-cranial-fossa and two paraclival triangles. These are surgical corridors, not fixed compartments. Borders vary slightly with author, dural layer and approach. Learn landmarks and targets, not eponyms alone.<br/><br/><b>Safety frame.</b> This is an anatomy study aid, not an operative manual. Skull-base surgery requires specialized training, imaging review, cadaveric preparation and a vascular-control strategy.','B'),Spacer(1,.3*cm)]
over=[['Group','Classic triangles','Location'],['Parasellar','Clinoidal (Dolenc), oculomotor (Hakuba), supratrochlear, infratrochlear (Parkinson)','Cavernous sinus roof/lateral wall'],['Middle fossa','Anterolateral, lateral, posterolateral (Glasscock), posteromedial (Kawase)','Petrous apex/trigeminal foramina'],['Paraclival','Inferomedial, inferolateral (trigeminal)','Petroclival/Dorello-canal region']]
t=Table([[P('<b>'+a+'</b>','X') for a in over[0]]]+[[P(a,'X') for a in r] for r in over[1:]],colWidths=[3*cm,8*cm,5.5*cm]);t.setStyle(TableStyle([('BACKGROUND',(0,0),(-1,0),colors.HexColor('#0b4f6c')),('TEXTCOLOR',(0,0),(-1,0),colors.white),('GRID',(0,0),(-1,-1),.3,colors.HexColor('#9fb3c8')),('VALIGN',(0,0),(-1,-1),'TOP'),('ROWBACKGROUNDS',(0,1),(-1,-1),[colors.white,colors.HexColor('#f4f7fa')]),('PADDING',(0,0),(-1,-1),6)]));story += [t,PageBreak()]
story += [P('1. Parasellar and cavernous-sinus triangles','H'),Image(str(p1),width=16.4*cm,height=8.2*cm),tab([('<b>Clinoidal / Dolenc</b>','Optic nerve medially, CN III laterally, intervening falciform/tentorial dura. Anterior clinoidectomy exposes it.','Clinoid ICA and proximal/distal dural rings. Hazards: optic apparatus, ophthalmic artery, ICA.'),('<b>Oculomotor / Hakuba</b>','CN III entry with anterior/posterior petroclinoid and interclinoid dural folds.','Horizontal cavernous ICA. Hazards: CN III and ICA.'),('<b>Supratrochlear</b>','CN III medially, CN IV laterally, intervening tentorial edge.','Lateral-wall corridor. Hazards: III/IV and venous channels.'),('<b>Infratrochlear / Parkinson</b>','CN IV superiorly, V1 inferiorly, posterior dural base.','Cavernous ICA, meningohypophyseal trunk, CN VI. Hazards: VI, ICA, venous bleeding.')]),PageBreak()]
story += [P('2. Middle-cranial-fossa triangles','H'),Image(str(p2),width=16.4*cm,height=8.2*cm),tab([('<b>Anterolateral</b>','SOF and anterior trigeminal (V1-V2) landmarks.','Orients to SOF, foramen rotundum and anterior lateral cavernous wall. Hazards: V1/V2/orbital apex.'),('<b>Lateral</b>','Middle-fossa trigeminal corridor around V2-V3, foramina rotundum and ovale.','Orientation to Meckel cave/infratemporal connections. Hazards: trigeminal divisions, middle meningeal branches.'),('<b>Posterolateral / Glasscock</b>','GSPN medially, V3 anteriorly, lateral line from foramen spinosum toward arcuate eminence/facial hiatus.','Localizes petrous ICA beneath GSPN. Hazards: petrous ICA, GSPN, facial nerve, middle meningeal artery.'),('<b>Posteromedial / Kawase</b>','GSPN laterally, petrous ridge/SPS medially, arcuate eminence posteriorly; anterior relation to trigeminal ganglion/V3.','Petrous-apex route toward upper clivus, petroclival region, anterolateral pons. Hazards: cochlea, petrous ICA, GSPN, SPS.')]),PageBreak()]
story += [P('3. Paraclival triangles','H'),Image(str(p3),width=16.4*cm,height=7.6*cm),tab([('<b>Inferomedial</b>','CN IV/tentorial edge to CN VI at Dorello canal, with petrous apex base.','Petroclival corridor near abducens entry. Hazards: CN VI, venous plexus, dorsal clivus/basilar region.'),('<b>Inferolateral / trigeminal</b>','Lateral to inferomedial: CN IV-tentorial edge to CN VI at Dorello canal and lateral petrosal-vein/SPS landmark.','Lateral petroclival working space. Hazards: petrosal veins, CN VI and trigeminal/petroclival structures.')]),Spacer(1,.25*cm),P('<b>Rapid recall:</b> optic nerve + III = clinoidal; III + IV = supratrochlear; IV + V1 = Parkinson; GSPN + petrous ridge + arcuate eminence = Kawase; foramen spinosum + GSPN + V3 = Glasscock; Dorello canal/CN VI = paraclival.','B'),Spacer(1,.25*cm),P('<b>Sources:</b> Isolan GR et al. <i>Skull Base</i>. 2007;17:357-367. Barrow Neurological Institute, <i>Microsurgical Anatomy of the Cavernous Sinus</i>, 1996. Gasco J, Nader R, <i>Skull Base Triangles</i>. K J Lee’s Essential Otolaryngology, Middle Cranial Fossa, p. 887. Shambaugh Surgery of the Ear, Surgical approach, pp. 741-742. Figures are original, not-to-scale educational schematics created for this guide.','X')]
def foot(c,d):c.saveState();c.setFont('Helvetica',7);c.setFillColor(colors.HexColor('#486581'));c.drawString(1.3*cm,.65*cm,'Skull-Base Triangles | Educational schematic guide');c.drawRightString(19.6*cm,.65*cm,'Page '+str(d.page));c.restoreState()
out=O/'Skull_Base_Triangles_Neurosurgery.pdf';SimpleDocTemplate(str(out),pagesize=A4,leftMargin=1.3*cm,rightMargin=1.3*cm,topMargin=1.1*cm,bottomMargin=1.1*cm).build(story,onFirstPage=foot,onLaterPages=foot);print(out)
Running Command

python "/tmp/workspace/skull-base-triangles-pdf/src/create_pdf.py" && python - <<'PY' from pypdf import PdfReader from pathlib import Path p=Path('/tmp/workspace/skull-base-triangles-pdf/output/Skull_Base_Triangles_Neurosurgery.pdf') r=PdfReader(str(p)) print('exists',p.exists(),'bytes',p.stat().st_size,'pages',len(r.pages)) for n,page in enumerate(r.pages,1): t=page.extract_text() or '' print(n,len(t),t[:90].replace('\n',' | ')) PY

Created a 4-page illustrated PDF covering the 10 high-yield skull-base triangles:
  • Parasellar/cavernous sinus: Dolenc, Hakuba, supratrochlear, Parkinson
  • Middle cranial fossa: anterolateral, lateral, Glasscock, Kawase
  • Paraclival: inferomedial and inferolateral
  • Borders, operative relevance, major hazards, rapid-recall summary
  • Original labeled schematic images

Skull Base Triangles Neurosurgery

PDF Document · PDF

Create a higher-resolution labeled triangle anatomy PDF

Reading File
Reading File
Browsing Directory

~/

Searching Images

cavernous sinus skull base surgical triangles labeled anatomical diagram

Searching the Web

cavernous sinus surgical triangles labeled anatomy Dolenc Parkinson Kawase Glasscock diagram

Finding Sources
Browsing Directory

~/skull-base-triangles-pdf

Reading File
Reading Web Page

https://pmc.ncbi.nlm.nih.gov/articles/PMC4974189

Loading Image
Loading Image
Reading File
Running Command

python - <<'PY' import requests from pathlib import Path A=Path('/tmp/workspace/skull-base-triangles-pdf/assets');A.mkdir(exist_ok=True) urls={'reference_cavernous.jpg':'https://cdn.ncbi.nlm.nih.gov/pmc/blobs/bb16/2117623/535efa902d38/sbs17357-1.jpg','reference_ten_triangles.jpg':'https://pmc-oa-opendata.s3.amazonaws.com/PMC4974189.1/jkms-31-1455-g001.jpg','reference_paraclival.jpg':'https://cdn.ncbi.nlm.nih.gov/pmc/blobs/bb16/2117623/bd3bcc2e8854/sbs17357-3.jpg'} for n,u in urls.items(): r=requests.get(u,timeout=30);r.raise_for_status();(A/n).write_bytes(r.content);print(n,len(r.content)) PY python - <<'PY' from PIL import Image from pathlib import Path for p in Path('/tmp/workspace/skull-base-triangles-pdf/assets').glob('reference_*'): im=Image.open(p);print(p.name,im.size) PY

Running Command

python - <<'PY' from pathlib import Path p=Path('/tmp/workspace/skull-base-triangles-pdf/src/create_highres_pdf.py') code='''from pathlib import Path from reportlab.pdfgen import canvas from reportlab.lib.pagesizes import landscape,A4 from reportlab.lib import colors from reportlab.lib.units import cm from reportlab.pdfbase.pdfmetrics import stringWidth from reportlab.lib.utils import ImageReader from pypdf import PdfReader ROOT=Path("/tmp/workspace/skull-base-triangles-pdf") OUT=ROOT/"output"; OUT.mkdir(exist_ok=True) PDF=OUT/"High_Resolution_Skull_Base_Triangle_Anatomy.pdf" W,H=landscape(A4) NAVY=colors.HexColor('#073B4C'); INK=colors.HexColor('#162B36'); MUTED=colors.HexColor('#476A78') COLS=[colors.HexColor('#A8DADC'),colors.HexColor('#FFD166'),colors.HexColor('#F4A6A6'),colors.HexColor('#B8E0A5')] def title(c,heading,sub): c.setFillColor(NAVY);c.rect(0,H-2.1*cm,W,2.1*cm,fill=1,stroke=0) c.setFillColor(colors.white);c.setFont('Helvetica-Bold',20);c.drawString(1.25*cm,H-1.15*cm,heading) c.setFont('Helvetica',9.5);c.drawString(1.25*cm,H-1.67*cm,sub) def footer(c,n): c.setStrokeColor(colors.HexColor('#A7BBC3'));c.line(1.1*cm,.9*cm,W-1.1*cm,.9*cm) c.setFillColor(MUTED);c.setFont('Helvetica',7.7);c.drawString(1.15*cm,.57*cm,'High-resolution vector study atlas | Educational anatomy, not for operative instruction') c.drawRightString(W-1.15*cm,.57*cm,f'{n} / 6') def label(c,text,x,y,tx,ty,align='left'): c.setStrokeColor(MUTED);c.setLineWidth(.8);c.line(x,y,tx,ty) c.setFillColor(INK);c.setFont('Helvetica-Bold',9) if align=='right': c.drawRightString(x-3,y+2,text) else: c.drawString(x+3,y+2,text) def tri(c,pts,fill,name,fs=11): p=c.beginPath();p.moveTo(*pts[0]);[p.lineTo(*q) for q in pts[1:]];p.close() c.setFillColor(fill);c.setStrokeColor(NAVY);c.setLineWidth(1.5);c.drawPath(p,fill=1,stroke=1) cx=sum(x for x,y in pts)/3;cy=sum(y for x,y in pts)/3 c.setFillColor(INK);c.setFont('Helvetica-Bold',fs) lines=name.split('\\n'); for i,line in enumerate(lines): c.drawCentredString(cx,cy+(len(lines)-1-i)*fs-fs/2,line) def dot(c,x,y): c.setFillColor(NAVY);c.circle(x,y,2.4,fill=1,stroke=0) def note(c,x,y,w,head,body): c.setFillColor(colors.HexColor('#EDF6F7'));c.setStrokeColor(colors.HexColor('#88AEB8'));c.roundRect(x,y,w,1.65*cm,7,fill=1,stroke=1) c.setFillColor(NAVY);c.setFont('Helvetica-Bold',9);c.drawString(x+10,y+1.15*cm,head) c.setFillColor(INK);c.setFont('Helvetica',8.4) # primitive wrap words=body.split();line='';yy=y+.8*cm for word in words: if stringWidth(line+' '+word,'Helvetica',8.4)>w-18: c.drawString(x+10,yy,line);yy-=.34*cm;line=word else: line=(line+' '+word).strip() if line:c.drawString(x+10,yy,line) def page_parasellar(c): title(c,'Parasellar and cavernous-sinus triangles','Right-sided schematic, superior-lateral perspective. Colored fields are vector graphics and are not to scale.') # points p={'ON':(185,405),'ACP':(300,465),'III':(365,375),'PCP':(530,430),'IV':(460,292),'V1':(545,195),'T':(610,325)} tri(c,[p['ON'],p['ACP'],p['III']],COLS[0],'CLINOIDAL\\nDOLENC') tri(c,[p['ACP'],p['PCP'],p['III']],COLS[1],'OCULOMOTOR\\nHAKUBA') tri(c,[p['III'],p['T'],p['IV']],COLS[2],'SUPRATROCHLEAR') tri(c,[p['IV'],p['T'],p['V1']],COLS[3],'INFRATROCHLEAR\\nPARKINSON') for k,(x,y) in p.items(): dot(c,x,y) label(c,'Optic nerve (CN II)',100,445,*p['ON']);label(c,'Anterior clinoid process',220,500,*p['ACP']) label(c,'CN III',320,330,*p['III']);label(c,'Posterior clinoid process',540,490,*p['PCP']) label(c,'CN IV',420,245,*p['IV']);label(c,'V1',610,175,*p['V1']);label(c,'Tentorial edge',665,350,*p['T']) note(c,75,75,220,'Key relationship','Dolenc: CN II to CN III. Parkinson: CN IV to V1. The ICA, CN VI and venous spaces lie deep to these dural corridors.') note(c,320,75,255,'Remember','Drill the anterior clinoid for clinoidal exposure. In the cavernous sinus, use actual neural borders and dural layer in operative communication.') note(c,605,75,150,'Abbreviations','CN = cranial nerve. V1 = ophthalmic trigeminal division. ICA = internal carotid artery.') footer(c,1) def page_middle(c): title(c,'Middle-cranial-fossa triangles','Right-sided extradural schematic. The GSPN is the main divider of the posterior middle-fossa corridors.') p={'SOF':(150,430),'V1/V2':(280,300),'V3/FO':(370,180),'FS':(510,170),'GSPN':(525,360),'AE':(680,290),'PR/SPS':(690,455),'GG':(380,430),'FR':(255,230)} tri(c,[p['SOF'],p['FR'],p['GG']],COLS[0],'ANTEROMEDIAL\\nMIDDLE FOSSA',9) tri(c,[p['FR'],p['V3/FO'],p['GG']],COLS[1],'ANTEROLATERAL\\nMIDDLE FOSSA',9) tri(c,[p['V3/FO'],p['FS'],p['GSPN']],COLS[2],'POSTEROLATERAL\\nGLASSCOCK',9) tri(c,[p['GSPN'],p['AE'],p['PR/SPS']],COLS[3],'POSTEROMEDIAL\\nKAWASE',9) for k,(x,y) in p.items():dot(c,x,y) label(c,'Superior orbital fissure',65,465,*p['SOF']);label(c,'V1/V2 region',210,300,*p['V1/V2']);label(c,'Foramen rotundum',155,205,*p['FR']) label(c,'V3 / foramen ovale',315,125,*p['V3/FO']);label(c,'Foramen spinosum',495,125,*p['FS']);label(c,'GSPN',545,390,*p['GSPN']) label(c,'Arcuate eminence',720,260,*p['AE']);label(c,'Petrous ridge / SPS',690,500,*p['PR/SPS']);label(c,'Gasserian ganglion',335,475,*p['GG']) note(c,65,65,250,'Glasscock triangle','GSPN medially, V3 anteriorly, and the foramen-spinosum to arcuate-eminence/hiatus line laterally. It localizes petrous ICA beneath the GSPN.') note(c,340,65,250,'Kawase triangle','GSPN laterally, petrous ridge/SPS medially, and arcuate eminence posteriorly. Think petrous apex, cochlea, petrous ICA and SPS.') note(c,615,65,145,'Exam cue','The four middle-fossa triangles are arranged from anterior trigeminal corridors to posterior petrous-apex corridors.') footer(c,2) def page_paraclival(c): title(c,'Paraclival triangles','Posterior petroclival schematic. Definitions may vary slightly in published atlases; name borders explicitly.') p={'PCP':(310,450),'IV':(385,360),'VI/DC':(425,185),'Apex':(525,125),'PV/SPS':(680,215),'T':(625,390)} tri(c,[p['IV'],p['VI/DC'],p['Apex']],COLS[1],'INFEROMEDIAL',12) tri(c,[p['IV'],p['VI/DC'],p['PV/SPS']],COLS[2],'INFEROLATERAL\\nTRIGEMINAL',11) for k,(x,y) in p.items():dot(c,x,y) label(c,'CN IV at tentorial edge',245,385,*p['IV']);label(c,'CN VI at Dorello canal',295,160,*p['VI/DC']);label(c,'Petrous apex',515,80,*p['Apex']) label(c,'Petrosal vein / SPS point',710,205,*p['PV/SPS']);label(c,'Tentorial edge',670,415,*p['T']);label(c,'Posterior clinoid process',195,480,*p['PCP']) note(c,80,75,280,'Inferomedial','Bounded by a CN IV-tentorial edge line, CN VI at Dorello canal and the petrous apex. Primary concern: abducens nerve and venous plexus.') note(c,385,75,290,'Inferolateral','Lateral counterpart using CN IV, CN VI at Dorello canal and a petrosal vein/SPS landmark. Primary concern: petrosal venous complex and CN VI.') footer(c,3) def page_all(c): title(c,'All ten triangles at a glance','A color-coded index. Color grouping follows the high-resolution atlas pages, not an operative classification.') names=[('1','Clinoidal / Dolenc','CN II - CN III'),('2','Oculomotor / Hakuba','Petroclinoid folds'),('3','Supratrochlear','CN III - CN IV'),('4','Infratrochlear / Parkinson','CN IV - V1'),('5','Anteromedial middle fossa','V1 - V2'),('6','Anterolateral middle fossa','V2 - V3'),('7','Posterolateral / Glasscock','V3 - GSPN'),('8','Posteromedial / Kawase','GSPN - petrous ridge'),('9','Inferomedial paraclival','CN IV - CN VI'),('10','Inferolateral paraclival','CN IV - CN VI - petrosal point')] y=460 for i,(n,a,b) in enumerate(names): x=75+(i%2)*360; yy=y-(i//2)*70;c.setFillColor(COLS[i%4]);c.roundRect(x,yy,35,35,6,fill=1,stroke=0);c.setFillColor(NAVY);c.setFont('Helvetica-Bold',13);c.drawCentredString(x+17.5,yy+12,n) c.setFont('Helvetica-Bold',11);c.drawString(x+50,yy+20,a);c.setFont('Helvetica',9);c.setFillColor(MUTED);c.drawString(x+50,yy+6,b) note(c,75,78,295,'Orientation','Parasellar: 1-4. Middle fossa: 5-8. Paraclival: 9-10. Eponyms are useful memory tags, not a substitute for naming the surgical borders.') note(c,400,78,350,'High-yield risks','Optic apparatus and ICA anteriorly; CN III/IV/VI and cavernous venous spaces parasellarly; GSPN, cochlea, petrous ICA and SPS in the petrous apex.') footer(c,4) def page_reference(c): title(c,'Open-access anatomical reference images','These figures supplement the vector diagrams. Labels and captions are retained from the source publications.') A=ROOT/'assets' imgs=[(A/'reference_cavernous.jpg',65,250,300,238,'Figure 1. Isolan et al. View of right cavernous sinus and triangle identification.'),(A/'reference_ten_triangles.jpg',390,280,360,155,'Figure 1. Chung et al. Schematic and 3D models of reorganized triangles.'),(A/'reference_paraclival.jpg',420,90,290,180,'Figure 3. Isolan et al. Posterior view of paraclival triangles.')] for path,x,y,w,h,cap in imgs: c.drawImage(ImageReader(str(path)),x,y,width=w,height=h,preserveAspectRatio=True,mask='auto');c.setFillColor(INK);c.setFont('Helvetica',7.8);c.drawString(x,y-12,cap) note(c,65,85,300,'Source 1','Isolan GR et al. Microsurgical anatomy of the cavernous sinus: measurements of the triangles in and around it. Skull Base. 2007;17:357-367. PMCID: PMC2117623.') note(c,65,25,300,'Source 2','Chung BS et al. Ten triangles around cavernous sinus for surgical approach. J Korean Med Sci. 2016;31:1455-1463. PMCID: PMC4974189.') footer(c,5) def page_sources(c): title(c,'Label key, limitations and sources','Use this guide for revision alongside a dedicated microsurgical atlas and supervised laboratory teaching.') items=[('Terminology','This atlas follows the 10-triangle arrangement used by Isolan et al. Other authors use alternate names and slightly different vertices, particularly in the middle-fossa and paraclival groups.'),('Key abbreviations','ACP anterior clinoid process; PCP posterior clinoid process; GSPN greater superficial petrosal nerve; SPS superior petrosal sinus; SOF superior orbital fissure; CN cranial nerve.'),('Source anatomy','K J Lee’s Essential Otolaryngology, Middle Cranial Fossa, p. 887. Shambaugh Surgery of the Ear, Surgical Approach, pp. 741-742. Isolan GR et al., Skull Base, 2007. Chung BS et al., J Korean Med Sci, 2016.'),('Image statement','Pages 1-4 are original vector diagrams rendered in this PDF, so lines and labels remain sharp at any zoom. Page 5 includes open-access reference figures cited above.'),('Clinical caution','Anatomic corridors are not “safe zones.” Patient-specific neurovascular anatomy, lesion effect, imaging and surgical approach govern risk.')] y=455 for h,b in items: c.setFillColor(NAVY);c.setFont('Helvetica-Bold',12);c.drawString(85,y,h);c.setFillColor(INK);c.setFont('Helvetica',10) # wrap words=b.split();line='';yy=y-18 for word in words: if stringWidth(line+' '+word,'Helvetica',10)>640: c.drawString(100,yy,line); yy-=15; line=word else: line=(line+' '+word).strip() c.drawString(100,yy,line);y=yy-35 footer(c,6) c=canvas.Canvas(str(PDF),pagesize=landscape(A4),pageCompression=1) c.setTitle('High-Resolution Skull-Base Triangle Anatomy') for f in [page_parasellar,page_middle,page_paraclival,page_all,page_reference,page_sources]:f(c);c.showPage() c.save() r=PdfReader(str(PDF));assert len(r.pages)==6 print(PDF,PDF.stat().st_size,len(r.pages)) ''' p.write_text(code) PY python "/tmp/workspace/skull-base-triangles-pdf/src/create_highres_pdf.py"

Running Command

python - <<'PY' from pypdf import PdfReader from pathlib import Path p=Path('/tmp/workspace/skull-base-triangles-pdf/output/High_Resolution_Skull_Base_Triangle_Anatomy.pdf') r=PdfReader(str(p)); print('exists=',p.exists(),'pages=',len(r.pages),'bytes=',p.stat().st_size) for i,page in enumerate(r.pages,1): txt=page.extract_text() or '' print(i,len(txt),txt[:85].replace('\n',' | ')) PY python - <<'PY' import fitz from pathlib import Path p=Path('/tmp/workspace/skull-base-triangles-pdf/output/High_Resolution_Skull_Base_Triangle_Anatomy.pdf') doc=fitz.open(p) out=Path('/tmp/workspace/skull-base-triangles-pdf/assets/validation_page1.png') pix=doc[0].get_pixmap(matrix=fitz.Matrix(1.6,1.6),alpha=False); pix.save(out) print(out, out.stat().st_size) PY

Reading File
Created the revised 6-page high-resolution PDF with:
  • Sharp, scalable vector-labeled diagrams for all 10 skull-base triangles
  • Separate parasellar, middle-fossa, and paraclival anatomy pages
  • Label key, operative landmark summaries, and major hazard orientation
  • Open-access anatomical reference figures from the Isolan et al. study and Chung et al. study

High Resolution Skull Base Triangle Anatomy

PDF Document · PDF

Why it is taking so much time?

Because creating a custom anatomy PDF involves several time-consuming steps: researching accurate landmarks, generating high-resolution labelled diagrams, assembling the PDF, and checking that it opens correctly.
For a faster result, I can make a simpler PDF with fewer pages and diagrams.

No no do what u were doing I thought my phn hanged

No problem. Your phone likely was just loading the PDF generation and download link. The high-resolution PDF is already complete:

High Resolution Skull Base Triangle Anatomy

PDF Document · PDF

Add more detailed labels to the skull-base triangle diagrams And give me actual anatomical pictures of all ten triangles separately not schematically drawn diagrams

Reading File
Reading File
Browsing Directory

~/skull-base-triangles-pdf

Searching Images

cadaveric dissection skull base clinoidal oculomotor supratrochlear infratrochlear Parkinson triangle

Searching Images

cadaveric dissection middle cranial fossa anteromedial anterolateral Glasscock Kawase triangle

Searching Images

cadaveric dissection inferomedial inferolateral paraclival triangle skull base

Searching the Web

site:pmc.ncbi.nlm.nih.gov skull base triangles cadaveric dissection Kawase Glasscock Parkinson Dolenc images

Finding Sources
query_images_db
Reading Web Page

https://pmc.ncbi.nlm.nih.gov/articles/PMC5714398

query_images_db
query_images_db
Reading File
Running Command

python - <<'PY' import requests from pathlib import Path A=Path('/tmp/workspace/skull-base-triangles-pdf/assets/cadaveric');A.mkdir(parents=True,exist_ok=True) sets={ 'drazin':('https://pmc-oa-opendata.s3.amazonaws.com/PMC5714398.1/cureus-0009-00000001741-i{:02d}.jpg',range(1,10)), 'isolan':('https://cdn.ncbi.nlm.nih.gov/pmc/blobs/bb16/2117623/{}', ['535efa902d38/sbs17357-1.jpg','54f34353844f/sbs17357-2.jpg','bd3bcc2e8854/sbs17357-3.jpg']), 'ftoz':('https://cdn.ncbi.nlm.nih.gov/pmc/blobs/479d/11221901/{}',['4f6d1ec6cf33/10-1055-a-2082-5030-i23jan0006-6.jpg','392bb8947ecf/10-1055-a-2082-5030-i23jan0006-7.jpg']) } for group,(temp,ids) in sets.items(): for i,x in enumerate(ids,1): url=temp.format(x) if '{}' not in temp else temp.format(x) try: r=requests.get(url,timeout=30);r.raise_for_status();fp=A/f'{group}_{i}.jpg';fp.write_bytes(r.content);print(fp.name,len(r.content)) except Exception as e: print('ERR',url,e) PY python - <<'PY' from pathlib import Path from PIL import Image,ImageDraw A=Path('/tmp/workspace/skull-base-triangles-pdf/assets/cadaveric');files=sorted(A.glob('*.jpg')) thumbs=[] for f in files: im=Image.open(f).convert('RGB');print(f.name,im.size) im.thumbnail((300,200));thumbs.append((f.name,im.copy())) out=Image.new('RGB',(960,((len(thumbs)+2)//3)*240),'white');d=ImageDraw.Draw(out) for i,(n,im) in enumerate(thumbs): x=(i%3)*320;y=(i//3)*240;out.paste(im,(x,y));d.text((x,y+204),n,fill='black') out.save(A/'contact.jpg') PY

Reading File
Reading Web Page

https://pmc.ncbi.nlm.nih.gov/articles/PMC5714398

Reading Web Page

https://pmc.ncbi.nlm.nih.gov/articles/PMC11221901

!

Error code: 400 - {'error': {'message': 'Your input image may contain content that is not allowed by our content safety system.', 'type': 'invalid_request_error', 'param': None, 'code': 'content_policy_violation'}}

We encountered an error while processing your request. Please try again or reach out to us for help.

This is a shared conversation. Sign in to Orris to start your own chat.