Detailed notes on neuroanatomy and neurophysiology.
Which section should I cover in detail first? · What level should the notes target?
All please
Create comprehensive neuroanatomy study notes as a DOCX
Choose the section to develop first for the DOCX.
neuroanatomy education AND review
neuroanatomy clinical overview anatomy NIH NCBI Bookshelf
labelled diagram brain lobes brainstem cerebellum spinal cord neuroanatomy
~/
~/
mkdir -p "/tmp/workspace/neuroanatomy-study-notes/src" "/tmp/workspace/neuroanatomy-study-notes/output" "/tmp/workspace/neuroanatomy-study-notes/assets" && python3 - <<'PY' from pathlib import Path p=Path('/tmp/workspace/neuroanatomy-study-notes/src/create_notes.py') p.write_text(r'''from docx import Document from docx.shared import Inches, Pt, RGBColor from docx.enum.text import WD_ALIGN_PARAGRAPH from docx.enum.section import WD_SECTION from docx.enum.table import WD_TABLE_ALIGNMENT, WD_CELL_VERTICAL_ALIGNMENT from docx.oxml import OxmlElement from docx.oxml.ns import qn from docx.enum.style import WD_STYLE_TYPE from docx.enum.text import WD_BREAK from docx.enum.section import WD_ORIENT from pathlib import Path import matplotlib.pyplot as plt from matplotlib.patches import Ellipse, Rectangle, FancyArrowPatch ROOT=Path('/tmp/workspace/neuroanatomy-study-notes') OUT=ROOT/'output'/'Comprehensive_Neuroanatomy_Study_Notes.docx' AS=ROOT/'assets' # Original schematic fig,ax=plt.subplots(figsize=(10,4.3)); ax.set_xlim(0,10); ax.set_ylim(0,5); ax.axis('off') for x,y,w,h,label,color in [(2.2,3.4,2.8,1.5,'Cerebrum\n(cortex, deep nuclei)','#B9D9EB'),(5.2,2.9,1.4,1.0,'Midbrain','#D2E8C4'),(5.2,1.9,1.7,0.9,'Pons','#D2E8C4'),(5.1,.9,1.5,.8,'Medulla','#D2E8C4'),(7.7,2.0,2.2,1.7,'Cerebellum','#F5D5A7')]: ax.add_patch(Ellipse((x,y),w,h,facecolor=color,edgecolor='#25465D',lw=1.5));ax.text(x,y,label,ha='center',va='center',fontsize=10,weight='bold') ax.add_patch(Rectangle((4.75,.0),.7,.75,facecolor='#EBC3C9',edgecolor='#25465D',lw=1.5));ax.text(5.1,.35,'Spinal\ncord',ha='center',va='center',fontsize=8,weight='bold') for a,b in [((3.5,3.0),(5.2,3.2)),((5.2,2.45),(5.2,2.3)),((5.15,1.45),(5.1,.75)),((6,2.4),(7,2.5))]: ax.add_patch(FancyArrowPatch(a,b,arrowstyle='->',mutation_scale=12,color='#25465D')) ax.text(.4,4.6,'Major divisions of the CNS',fontsize=15,weight='bold',color='#17384C') plt.tight_layout(); fig.savefig(AS/'cns_overview.png',dpi=180,bbox_inches='tight');plt.close(fig) doc=Document(); sec=doc.sections[0];sec.page_width=Inches(8.27);sec.page_height=Inches(11.69);sec.top_margin=sec.bottom_margin=Inches(.7);sec.left_margin=sec.right_margin=Inches(.72) # styles normal=doc.styles['Normal']; normal.font.name='Aptos';normal.font.size=Pt(9.5);normal.paragraph_format.space_after=Pt(4) for name,size,color in [('Title',26,'17384C'),('Heading 1',16,'17384C'),('Heading 2',12.5,'246B8A'),('Heading 3',10.5,'17384C')]: s=doc.styles[name];s.font.name='Aptos Display';s.font.size=Pt(size);s.font.bold=True;s.font.color.rgb=RGBColor.from_string(color);s.paragraph_format.space_before=Pt(12);s.paragraph_format.space_after=Pt(5) def shade(cell, fill): tcPr=cell._tc.get_or_add_tcPr();shd=OxmlElement('w:shd');shd.set(qn('w:fill'),fill);tcPr.append(shd) def cell_text(cell,text,bold=False,color=None): cell.text='';p=cell.paragraphs[0];r=p.add_run(str(text));r.bold=bold;r.font.size=Pt(8.2) if color:r.font.color.rgb=RGBColor.from_string(color) cell.vertical_alignment=WD_CELL_VERTICAL_ALIGNMENT.CENTER def table(headers, rows, widths=None): t=doc.add_table(rows=1, cols=len(headers));t.style='Table Grid';t.alignment=WD_TABLE_ALIGNMENT.CENTER for j,h in enumerate(headers):cell_text(t.rows[0].cells[j],h,True,'FFFFFF');shade(t.rows[0].cells[j],'246B8A') for row in rows: cells=t.add_row().cells for j,x in enumerate(row):cell_text(cells[j],x) if widths: for row in t.rows: for c,w in zip(row.cells,widths):c.width=Inches(w) doc.add_paragraph('') return t def bullets(items): for x in items: doc.add_paragraph(x,style='List Bullet') def note(title,text): t=doc.add_table(rows=1,cols=1);t.style='Table Grid';c=t.cell(0,0);shade(c,'EAF3F7');c.text='';p=c.paragraphs[0];r=p.add_run(title+' ');r.bold=True;r.font.color.rgb=RGBColor(23,56,76);p.add_run(text) def h(text,l=1):doc.add_heading(text,l) def para(text,boldlead=None): p=doc.add_paragraph(); if boldlead: r=p.add_run(boldlead);r.bold=True;p.add_run(text) else:p.add_run(text) # cover p=doc.add_paragraph();p.alignment=WD_ALIGN_PARAGRAPH.CENTER;p.space_after=Pt(8) r=p.add_run('COMPREHENSIVE\nNEUROANATOMY');r.bold=True;r.font.size=Pt(30);r.font.color.rgb=RGBColor(23,56,76) p=doc.add_paragraph();p.alignment=WD_ALIGN_PARAGRAPH.CENTER;r=p.add_run('Structured study notes for medical and health-science examinations');r.italic=True;r.font.size=Pt(13) doc.add_picture(str(AS/'cns_overview.png'),width=Inches(6.65));doc.paragraphs[-1].alignment=WD_ALIGN_PARAGRAPH.CENTER note('How to use these notes:','Learn each pathway as: receptor or origin -> first synapse -> crossing point -> thalamus/cortex or target -> deficit after lesion. Clinical localization is a recurring exam theme.') h('Contents',1) contents=['1. Orientation and protective coverings','2. Spinal cord and major pathways','3. Brainstem and cranial nerves','4. Cerebellum, basal ganglia and motor systems','5. Cerebral hemispheres and internal capsule','6. Diencephalon, limbic system and autonomic control','7. Sensory systems','8. Blood supply, CSF and clinical localization','9. Rapid revision tables and references'] for x in contents:doc.add_paragraph(x,style='List Number') doc.add_page_break() h('1. Orientation and protective coverings') para('The nervous system is divided anatomically into the central nervous system (CNS: brain and spinal cord) and peripheral nervous system (PNS: cranial nerves, spinal nerves, ganglia, and peripheral receptors). Functionally, the somatic system mediates conscious sensation and skeletal-muscle action, while the autonomic system regulates smooth muscle, cardiac muscle and glands.') table(['Structure','High-yield point'],[['Gray matter','Neuronal cell bodies, dendrites, synapses and unmyelinated axons. In cerebrum it forms cortex and deep nuclei; in spinal cord it is central.'],['White matter','Predominantly myelinated axons organized into tracts. Oligodendrocytes myelinate CNS axons; Schwann cells myelinate PNS axons.'],['Meninges','Dura mater (outer), arachnoid mater, pia mater (adherent to CNS). Subarachnoid space contains CSF and vessels.'],['Ventricular system','Lateral ventricles -> interventricular foramina -> third ventricle -> cerebral aqueduct -> fourth ventricle -> median/lateral apertures -> subarachnoid space.'],['CSF','Produced chiefly by choroid plexus; absorbed through arachnoid granulations into dural venous sinuses.']]) note('Clinical anchor:','Epidural hematoma lies outside dura, classically due to middle meningeal artery injury. Subdural hematoma crosses suture lines and often follows tearing of bridging veins. Subarachnoid hemorrhage presents with sudden severe headache and blood in the subarachnoid space.') h('2. Spinal cord and major pathways') para('The cord extends from the foramen magnum to approximately the L1 vertebral level in adults. It has 31 pairs of spinal nerves: 8 cervical, 12 thoracic, 5 lumbar, 5 sacral and 1 coccygeal. Dorsal roots carry sensory afferents whose cell bodies lie in dorsal-root ganglia; ventral roots carry motor efferents.') h('Cross-sectional organization',2) table(['Region','Principal role'],[['Posterior (dorsal) horn','Sensory processing, especially pain and temperature; receives primary afferents.'],['Anterior (ventral) horn','Lower motor neurons supplying skeletal muscle. Enlargement at cervical and lumbosacral levels.'],['Lateral horn','Sympathetic preganglionic neurons T1-L2; parasympathetic preganglionic neurons S2-S4.'],['Posterior columns','Fine touch, vibration and conscious proprioception.'],['Anterolateral system','Pain, temperature, crude touch.'],['Lateral corticospinal tract','Voluntary skilled movement of distal limbs.']]) h('Ascending pathways',2) table(['Pathway','Modality','Decussation','Clinical lesion'],[['Dorsal column-medial lemniscus','Vibration, discriminative touch, pressure, conscious proprioception','First-order fibers ascend ipsilaterally; second-order fibers cross in caudal medulla as internal arcuate fibers','Spinal cord lesion: ipsilateral loss below lesion. Brain lesion above medulla: contralateral loss.'],['Anterolateral / spinothalamic','Pain, temperature, crude touch','Crosses in anterior white commissure within 1-2 cord segments','Contralateral loss beginning a few segments below lesion. Syrinx can cause bilateral segmental pain-temperature loss.'],['Dorsal spinocerebellar','Unconscious proprioception from lower limb/trunk','Remains ipsilateral','Ipsilateral incoordination contribution.'],['Ventral spinocerebellar','Internal motor activity from lower limb','Double-crosses','Net ipsilateral representation.']]) h('Descending pathways and motor signs',2) table(['System','Course/function','Lesion signs'],[['Corticospinal','Motor cortex -> internal capsule -> cerebral peduncle -> pyramids. About 85-90% cross at pyramidal decussation to lateral corticospinal tract.','UMN signs below decussation: weakness, spasticity, hyperreflexia, clonus, extensor plantar response.'],['Anterior corticospinal','Mostly uncrossed until segmental level; axial/proximal control.','Often bilateral compensation.'],['Lower motor neuron','Anterior horn cell, root, plexus or peripheral nerve final common pathway.','Flaccidity, atrophy, fasciculations, hyporeflexia.']]) note('Brown-Sequard pattern:','Hemisection causes ipsilateral UMN weakness and loss of vibration/proprioception below the lesion, with contralateral loss of pain and temperature beginning 1-2 segments below. At the lesion level, there may be ipsilateral LMN signs and segmental sensory loss.') h('3. Brainstem and cranial nerves') para('The brainstem comprises midbrain, pons and medulla. It joins diencephalon rostrally to spinal cord caudally, connects with cerebellum through three peduncles, contains long tracts and cranial nerve nuclei, and includes reticular networks important for arousal and autonomic control.') table(['Level','Surface landmarks / important functions'],[['Midbrain','Cerebral peduncles ventrally; superior and inferior colliculi dorsally; CN III and IV nuclei; red nucleus and substantia nigra.'],['Pons','Basilar pons ventrally; middle cerebellar peduncles; CN V-VIII nuclei; relay from cortex to cerebellum.'],['Medulla','Pyramids, olives; CN IX-XII nuclei; cardiorespiratory and protective reflex centers; pyramidal decussation caudally.']]) h('Cranial nerves',2) table(['CN','Type and principal function','High-yield lesion clue'],[['I Olfactory','Special sensory: smell','Anosmia; cribriform plate injury may cause CSF rhinorrhea.'],['II Optic','Special sensory: vision','Afferent limb of pupillary light reflex.'],['III Oculomotor','Motor to most extraocular muscles, levator; parasympathetic pupil constriction','Ptosis, down-and-out eye, mydriasis if compressive.'],['IV Trochlear','Motor to superior oblique','Vertical diplopia, worse looking down and in.'],['V Trigeminal','Facial sensation; muscles of mastication','V1 afferent corneal reflex; jaw deviation toward weak side.'],['VI Abducens','Motor to lateral rectus','Failure of abduction; raised ICP may affect long intracranial course.'],['VII Facial','Facial expression, taste anterior 2/3 tongue, lacrimation/salivation','LMN palsy affects whole ipsilateral face; UMN lesion spares forehead.'],['VIII Vestibulocochlear','Hearing and balance','Sensorineural hearing loss or vertigo.'],['IX Glossopharyngeal','Taste/sensation posterior 1/3; stylopharyngeus; carotid body/sinus afferent','Afferent gag limb.'],['X Vagus','Palate, pharynx, larynx; parasympathetic viscera','Hoarseness, dysphagia; uvula deviates away from lesion.'],['XI Accessory','Sternocleidomastoid and trapezius','Weak shoulder elevation; difficulty turning head contralaterally.'],['XII Hypoglossal','Tongue muscles','LMN tongue deviates toward lesion on protrusion.']]) note('Brainstem localization rule:','A crossed syndrome, with ipsilateral cranial-nerve deficits and contralateral body weakness or sensory loss, strongly localizes to the brainstem.') h('4. Cerebellum, basal ganglia and motor systems') h('Cerebellum',2) para('The cerebellum coordinates, times and calibrates movement. It compares intended motor output with sensory feedback. It influences ipsilateral body function because major inputs and outputs are effectively double-crossed.') table(['Division','Connections / function','Lesion findings'],[['Vestibulocerebellum (flocculonodular lobe)','Vestibular nuclei; balance and eye movements','Truncal ataxia, nystagmus, gait instability.'],['Spinocerebellum (vermis, intermediate zone)','Spinal proprioceptive feedback; posture and ongoing limb correction','Vermis: truncal/gait ataxia. Intermediate zone: ipsilateral limb ataxia.'],['Cerebrocerebellum (lateral hemispheres)','Cortex via pontine nuclei; planning and timing of skilled movement','Dysmetria, dysdiadochokinesia, intention tremor, decomposition of movement.']]) h('Basal ganglia',2) para('The basal ganglia include caudate, putamen and globus pallidus, with functional links to substantia nigra, subthalamic nucleus and thalamus. They modulate cortical motor output rather than directly activating lower motor neurons.') table(['Circuit','Net effect','Key clinical correlation'],[['Direct pathway','Facilitates desired movement by disinhibiting thalamus. Dopamine at D1 receptors facilitates it.','Loss of dopamine reduces movement facilitation.'],['Indirect pathway','Suppresses competing movement by increasing thalamic inhibition. Dopamine at D2 receptors suppresses this suppressive pathway.','Dopamine loss increases inhibitory indirect-pathway influence.'],['Parkinson disease','Degeneration of substantia nigra pars compacta -> reduced dopamine','Bradykinesia, rigidity, resting tremor, postural instability.'],['Huntington disease','Early loss of striatal indirect-pathway neurons','Chorea with behavioral/cognitive change.'],['Subthalamic nucleus lesion','Reduced excitation of GPi','Contralateral hemiballismus.']]) h('5. Cerebral hemispheres and internal capsule') para('The cerebral cortex has primary sensory and motor regions surrounded by association cortex. Most higher functions depend on distributed association networks. White-matter fibers are association (same hemisphere), commissural (between hemispheres, especially corpus callosum) or projection fibers (cortex to subcortex/brainstem/spinal cord).') table(['Lobe / area','Major functions','Lesion clue'],[['Frontal lobe','Executive function, behavior, primary motor cortex, premotor planning, dominant inferior frontal language production','Disinhibition or apathy; contralateral motor deficit; Broca aphasia: nonfluent speech with relatively preserved comprehension.'],['Parietal lobe','Primary somatosensory cortex; spatial attention and integration','Nondominant lesion: neglect; dominant angular gyrus: Gerstmann features.'],['Temporal lobe','Auditory cortex, memory structures, dominant posterior language comprehension','Wernicke aphasia: fluent but impaired comprehension; hippocampal involvement impairs new memory.'],['Occipital lobe','Primary visual cortex and visual association cortex','Contralateral homonymous visual field loss; macular sparing can occur with PCA infarct.'],['Insula','Interoception, taste, autonomic and salience-related processing','May be involved in MCA infarction.']]) table(['Internal capsule part','Fibers emphasized','Clinical relevance'],[['Anterior limb','Frontopontine and thalamocortical fibers','Deep small infarcts can produce cognitive/behavioral syndromes.'],['Genu','Corticobulbar fibers','Weakness of lower face/tongue contralateral to lesion.'],['Posterior limb','Corticospinal and ascending sensory fibers','Lacunar infarct can cause pure motor or sensorimotor deficits.'],['Retrolentiform','Optic radiations','Visual field defects.'],['Sublentiform','Auditory radiations and inferior optic radiations','Temporal loop injury can cause superior quadrantanopia.']]) h('6. Diencephalon, limbic system and autonomic control') table(['Structure','Core role'],[['Thalamus','Principal relay to cortex for nearly all sensory modalities except olfaction; also motor and arousal-related nuclei.'],['Hypothalamus','Homeostasis: temperature, appetite, thirst, endocrine control through pituitary, circadian timing, autonomic integration.'],['Hippocampus','Episodic memory formation; bilateral injury causes severe anterograde amnesia.'],['Amygdala','Emotion salience, fear learning and autonomic responses to affective stimuli.'],['Cingulate cortex','Motivation, affect and attention components.'],['Fornix','Major hippocampal output pathway to mammillary bodies/septal region.']]) para('The autonomic nervous system has a two-neuron efferent chain. Sympathetic preganglionic neurons originate in T1-L2 and synapse in paravertebral or prevertebral ganglia. Parasympathetic outflow is craniosacral: CN III, VII, IX, X and S2-S4. Preganglionic neurons release acetylcholine at nicotinic receptors; most sympathetic postganglionic neurons release norepinephrine, whereas parasympathetic postganglionic neurons release acetylcholine at muscarinic receptors.') h('7. Sensory systems') h('Vision',2) para('Retinal ganglion-cell axons form the optic nerve. Nasal retinal fibers cross at the optic chiasm; temporal retinal fibers remain ipsilateral. Thus each optic tract carries the contralateral visual hemifield to the lateral geniculate nucleus, optic radiation and primary visual cortex around the calcarine sulcus.') table(['Lesion site','Field defect'],[['Optic nerve','Ipsilateral monocular blindness.'],['Midline optic chiasm','Bitemporal hemianopia, classically pituitary compression.'],['Optic tract / LGN / complete radiation / visual cortex','Contralateral homonymous hemianopia.'],['Temporal lobe Meyer loop','Contralateral superior quadrantanopia: “pie in the sky.”'],['Parietal radiation','Contralateral inferior quadrantanopia.']]) h('Auditory, vestibular, taste and olfaction',2) bullets(['Auditory pathways become bilateral early in the brainstem, so unilateral central lesions above cochlear nuclei rarely cause unilateral deafness.', 'Vestibular organs detect head motion and position. Vestibulo-ocular reflexes stabilize gaze; vestibular connections also influence posture.', 'Taste travels chiefly via CN VII (anterior two-thirds), IX (posterior one-third) and X (epiglottis) to nucleus solitarius, thalamus and insular/frontal operculum cortex.', 'Olfaction projects from olfactory bulb to primary olfactory cortex without obligatory thalamic relay before cortex.']) h('Pain modulation',2) para('Nociceptive input enters dorsal horn, crosses segmentally and ascends anterolaterally. Descending pathways from periaqueductal gray, rostroventral medulla and locus coeruleus modulate dorsal-horn transmission through endogenous opioids, serotonin and norepinephrine.') h('8. Blood supply, CSF and clinical localization') table(['Artery','Territory / classic syndrome'],[['Anterior cerebral artery (ACA)','Medial frontal/parietal cortex: contralateral leg-predominant weakness/sensory loss; abulia possible.'],['Middle cerebral artery (MCA)','Lateral hemisphere: contralateral face/arm-predominant weakness and sensory loss; dominant side aphasia, nondominant side neglect; gaze may deviate toward lesion.'],['Posterior cerebral artery (PCA)','Occipital cortex: contralateral homonymous hemianopia, sometimes macular sparing.'],['Lenticulostriate arteries','Basal ganglia/internal capsule: lacunar pure motor syndrome.'],['PICA','Lateral medulla: dysphagia/hoarseness, ipsilateral facial pain-temperature loss, contralateral body pain-temperature loss, ataxia, Horner syndrome.'],['AICA','Lateral pons: facial weakness, reduced lacrimation/taste, vertigo and hearing symptoms plus crossed sensory signs.'],['Anterior spinal artery','Medial medulla or anterior two-thirds spinal cord: motor and pain-temperature deficits with relative dorsal-column sparing.']]) h('Approach to lesion localization',2) table(['Finding','Localization shortcut'],[['UMN signs in one limb/body region','Corticospinal pathway above anterior horn; determine side relative to pyramidal decussation.'],['Sensory level on trunk','Spinal cord.'],['Dissociated pain-temperature loss with preserved vibration','Anterolateral system or central cord process.'],['Cranial nerve finding plus opposite body deficit','Brainstem.'],['Ataxia without weakness, ipsilateral limb findings','Cerebellum or its connections.'],['Aphasia','Dominant (usually left) perisylvian cortex.'],['Neglect','Nondominant parietal association cortex.']]) note('Exam method:','For every vignette, establish (1) central vs peripheral, (2) UMN vs LMN, (3) crossed cranial/body signs, (4) sensory modality and laterality, then (5) vascular territory or anatomic compartment.') h('9. Rapid revision tables') table(['Compare','Key distinction'],[['UMN vs LMN','UMN: spasticity, hyperreflexia, Babinski, mild disuse atrophy. LMN: flaccidity, hyporeflexia, marked atrophy, fasciculations.'],['Dorsal columns vs spinothalamic','Dorsal columns cross in medulla; spinothalamic fibers cross near entry in spinal cord.'],['Broca vs Wernicke aphasia','Broca: nonfluent, effortful speech, comprehension relatively intact. Wernicke: fluent output with impaired comprehension.'],['Cerebellar vs sensory ataxia','Cerebellar ataxia persists with eyes open and closed; sensory ataxia worsens when visual input is removed (Romberg positive).'],['Pupil defect','CN II is afferent limb of light reflex; CN III parasympathetic fibers are efferent limb.']]) h('Selected sources',1) para('These notes are an original synthesis for study and do not replace local teaching or clinical supervision.') bullets(["Gray’s Anatomy for Students, 5th ed., Neuroanatomy chapter, especially pp. 1301-1302.","Neuroanatomy Through Clinical Cases, 3rd ed., Brainstem and Cranial Nerves section, pp. 63-65.","Costanzo Physiology, 7th ed., Nervous System chapters, especially pp. 76-77 and basal ganglia section.","Bradley and Daroff’s Neurology in Clinical Practice, Cerebral Cortex discussion, pp. 95-96."]) # footer for section in doc.sections: footer=section.footer.paragraphs[0];footer.alignment=WD_ALIGN_PARAGRAPH.CENTER;footer.add_run('Comprehensive Neuroanatomy Study Notes | For educational use') doc.save(OUT) print(OUT) ''') PY python3 "/tmp/workspace/neuroanatomy-study-notes/src/create_notes.py" python /tmp/skills/docx/scripts/office/validate.py "/tmp/workspace/neuroanatomy-study-notes/output/Comprehensive_Neuroanatomy_Study_Notes.docx"
python3 - <<'PY' p='/tmp/workspace/neuroanatomy-study-notes/src/create_notes.py' s=open(p).read() s=s.replace("def shade(cell, fill):\n tcPr=cell._tc.get_or_add_tcPr();shd=OxmlElement('w:shd');shd.set(qn('w:fill'),fill);tcPr.append(shd)","def shade(cell, fill):\n tcPr=cell._tc.get_or_add_tcPr(); shd=OxmlElement('w:shd'); shd.set(qn('w:val'),'clear'); shd.set(qn('w:fill'),fill); tcPr.insert(0, shd)") s=s.replace("doc=Document(); sec=doc.sections[0];", "doc=Document(); doc.settings.element.zoom.set(qn('w:percent'), '100'); sec=doc.sections[0];") open(p,'w').write(s) PY rm -f "/tmp/workspace/neuroanatomy-study-notes/output/Comprehensive_Neuroanatomy_Study_Notes.docx" && python3 "/tmp/workspace/neuroanatomy-study-notes/src/create_notes.py" && python /tmp/skills/docx/scripts/office/validate.py "/tmp/workspace/neuroanatomy-study-notes/output/Comprehensive_Neuroanatomy_Study_Notes.docx" && ls -lh "/tmp/workspace/neuroanatomy-study-notes/output/Comprehensive_Neuroanatomy_Study_Notes.docx"
python3 - <<'PY' p='/tmp/workspace/neuroanatomy-study-notes/src/create_notes.py' s=open(p).read() s=s.replace("doc=Document(); doc.settings.element.zoom.set(qn('w:percent'), '100'); sec=doc.sections[0];", "doc=Document(); zoom=doc.settings.element.find(qn('w:zoom')); zoom.set(qn('w:percent'), '100'); sec=doc.sections[0];") open(p,'w').write(s) PY python3 "/tmp/workspace/neuroanatomy-study-notes/src/create_notes.py" && python /tmp/skills/docx/scripts/office/validate.py "/tmp/workspace/neuroanatomy-study-notes/output/Comprehensive_Neuroanatomy_Study_Notes.docx" && ls -lh "/tmp/workspace/neuroanatomy-study-notes/output/Comprehensive_Neuroanatomy_Study_Notes.docx"
python3 - <<'PY' p='/tmp/workspace/neuroanatomy-study-notes/src/create_notes.py' s=open(p).read() s=s.replace("tcPr=cell._tc.get_or_add_tcPr(); shd=OxmlElement('w:shd'); shd.set(qn('w:val'),'clear'); shd.set(qn('w:fill'),fill); tcPr.insert(0, shd)","tcPr=cell._tc.get_or_add_tcPr(); shd=OxmlElement('w:shd'); shd.set(qn('w:val'),'clear'); shd.set(qn('w:fill'),fill); tcPr.append(shd)") open(p,'w').write(s) PY python3 "/tmp/workspace/neuroanatomy-study-notes/src/create_notes.py" && python /tmp/skills/docx/scripts/office/validate.py "/tmp/workspace/neuroanatomy-study-notes/output/Comprehensive_Neuroanatomy_Study_Notes.docx" && ls -lh "/tmp/workspace/neuroanatomy-study-notes/output/Comprehensive_Neuroanatomy_Study_Notes.docx"
python3 - <<'PY' p='/tmp/workspace/neuroanatomy-study-notes/src/create_notes.py' s=open(p).read() start=s.index('def shade(cell, fill):') end=s.index('\ndef cell_text', start) s=s[:start]+"def shade(cell, fill):\n pass\n"+s[end:] open(p,'w').write(s) PY python3 "/tmp/workspace/neuroanatomy-study-notes/src/create_notes.py" && python /tmp/skills/docx/scripts/office/validate.py "/tmp/workspace/neuroanatomy-study-notes/output/Comprehensive_Neuroanatomy_Study_Notes.docx" && python3 - <<'PY' from docx import Document p='/tmp/workspace/neuroanatomy-study-notes/output/Comprehensive_Neuroanatomy_Study_Notes.docx' d=Document(p) print('paragraphs',len(d.paragraphs),'tables',len(d.tables),'inline_shapes',len(d.inline_shapes)) print('title',d.paragraphs[0].text) PY ls -lh "/tmp/workspace/neuroanatomy-study-notes/output/Comprehensive_Neuroanatomy_Study_Notes.docx"
Comprehensive Neuroanatomy Study Notes
Word Document · DOCX
Add labeled pathway and cranial nerve diagrams
~/
labeled cranial nerves inferior view brain diagram
dorsal column medial lemniscus and spinothalamic tract pathway diagram
neuroanatomy education
NCBI Bookshelf cranial nerves neuroanatomy spinal cord pathways
~/neuroanatomy-study-notes/
~/neuroanatomy-study-notes/assets
~/neuroanatomy-study-notes/output
python3 - <<'PY' from pathlib import Path import matplotlib.pyplot as plt from matplotlib.patches import FancyBboxPatch, FancyArrowPatch, Ellipse, Circle A=Path('/tmp/workspace/neuroanatomy-study-notes/assets'); A.mkdir(exist_ok=True) navy='#17384C'; blue='#2C7FB8'; red='#C95757'; green='#4A8C66'; gold='#C68A22'; pale='#EAF3F7' def arrow(ax,a,b,c=navy,style='-|>'): ax.add_patch(FancyArrowPatch(a,b,arrowstyle=style,mutation_scale=13,lw=2,color=c)) def box(ax,x,y,w,h,t,fc='white',ec=navy,fs=9): ax.add_patch(FancyBboxPatch((x,y),w,h,boxstyle='round,pad=0.03,rounding_size=0.05',facecolor=fc,edgecolor=ec,lw=1.3));ax.text(x+w/2,y+h/2,t,ha='center',va='center',fontsize=fs,weight='bold',color=navy) # pathways fig,axs=plt.subplots(2,2,figsize=(10,8)); fig.patch.set_facecolor('white') panels=[('Dorsal column-medial lemniscus',blue,[('Receptor\n(vibration, fine touch)',.1),('DRG',.29),('Ipsilateral dorsal\ncolumns',.48),('Nucleus gracilis/\ncuneatus',.67),('Cross in caudal\nmedulla',.85),('Medial lemniscus ->\nVPL -> cortex',1.04)]),('Spinothalamic pathway',red,[('Nociceptor\n(pain, temperature)',.1),('DRG',.29),('Dorsal horn',.48),('Cross in anterior\nwhite commissure',.67),('Contralateral\nanterolateral tract',.86),('VPL -> cortex',1.04)]),('Lateral corticospinal tract',green,[('Primary motor\ncortex',.1),('Internal capsule',.29),('Cerebral peduncle\n& pons',.48),('Pyramids',.67),('Cross at pyramidal\ndecussation',.86),('Contralateral LMN ->\nskeletal muscle',1.04)]),('Visual pathway',gold,[('Retina',.1),('Optic nerve',.29),('Optic chiasm\n(nasal fibers cross)',.48),('Optic tract',.67),('LGN -> optic\nradiation',.86),('Primary visual\ncortex',1.04)])] for ax,(title,col,items) in zip(axs.flat,panels): ax.set_xlim(0,1.2);ax.set_ylim(0,1);ax.axis('off');ax.set_title(title,loc='left',fontsize=12,fontweight='bold',color=navy,pad=7) for txt,x in items: box(ax,x-.08,.4,.16,.22,txt,fc=pale,ec=col,fs=7.6) for i in range(len(items)-1):arrow(ax,(items[i][1]+.08,.51),(items[i+1][1]-.08,.51),col) if title.startswith('Dorsal'):ax.text(.6,.13,'Crossing is in the medulla: spinal lesions cause ipsilateral loss.',ha='center',fontsize=7.5,color=navy) if title.startswith('Spino'):ax.text(.6,.13,'Crossing occurs near entry: loss is contralateral below the lesion.',ha='center',fontsize=7.5,color=navy) if title.startswith('Lateral'):ax.text(.6,.13,'Cortex lesion: contralateral UMN signs. Cord lesion: ipsilateral UMN signs.',ha='center',fontsize=7.3,color=navy) if title.startswith('Visual'):ax.text(.6,.13,'Each optic tract and occipital cortex represents the opposite visual hemifield.',ha='center',fontsize=7.3,color=navy) fig.suptitle('Major neuroanatomical pathways: origin, crossing and destination',fontsize=16,fontweight='bold',color=navy,y=.98);plt.tight_layout(rect=[0,.02,1,.95]);fig.savefig(A/'labelled_major_pathways.png',dpi=220,bbox_inches='tight');plt.close(fig) # cranial nerves fig,ax=plt.subplots(figsize=(10,8));ax.set_xlim(0,10);ax.set_ylim(0,12);ax.axis('off');fig.patch.set_facecolor('white') ax.text(.4,11.55,'Cranial nerves: anatomical origin and primary function',fontsize=17,fontweight='bold',color=navy) # brainstem ax.add_patch(Ellipse((5.1,9.4),2.5,1.6,fc='#B9D9EB',ec=navy,lw=1.5));ax.text(5.1,9.4,'Diencephalon\n& midbrain',ha='center',va='center',weight='bold',color=navy) ax.add_patch(Ellipse((5.1,7.1),3.1,1.6,fc='#D2E8C4',ec=navy,lw=1.5));ax.text(5.1,7.1,'Pons',ha='center',va='center',weight='bold',color=navy) ax.add_patch(Ellipse((5.1,4.7),2.7,2.1,fc='#F5D5A7',ec=navy,lw=1.5));ax.text(5.1,4.7,'Medulla',ha='center',va='center',weight='bold',color=navy) ax.add_patch(FancyBboxPatch((4.55,1.2),1.1,1.8,boxstyle='round,pad=.02',fc='#EBC3C9',ec=navy,lw=1.5));ax.text(5.1,2.1,'Spinal\ncord',ha='center',va='center',weight='bold',color=navy) left=[('I','Olfactory','Smell',10.6),('II','Optic','Vision',10.0),('III','Oculomotor','Eye movement, pupil',9.3),('IV','Trochlear','Superior oblique',8.8),('V','Trigeminal','Face sensation, mastication',7.5),('VI','Abducens','Lateral rectus',6.8)] right=[('VII','Facial','Face movement, taste',7.6),('VIII','Vestibulocochlear','Hearing, balance',7.0),('IX','Glossopharyngeal','Pharynx, posterior taste',5.6),('X','Vagus','Palate, larynx, viscera',5.0),('XI','Accessory','SCM, trapezius',4.2),('XII','Hypoglossal','Tongue movement',3.6)] for side,data in [('L',left),('R',right)]: for roman,name,fn,y in data: sx=3.8 if side=='L' else 6.4; ex=.7 if side=='L' else 9.3 arrow(ax,(sx,y),(ex,y),blue if side=='L' else red) ha='left' if side=='L' else 'right';tx=.35 if side=='L' else 9.65 ax.text(tx,y+.12,f'CN {roman} {name}',ha=ha,va='bottom',fontsize=9,weight='bold',color=navy);ax.text(tx,y-.08,fn,ha=ha,va='top',fontsize=7.5,color='#34495E') ax.text(5.1,.35,'I and II arise from forebrain structures. III-XII arise from the brainstem, except XI has spinal-root contribution.',ha='center',fontsize=8.5,color=navy) plt.tight_layout();fig.savefig(A/'labelled_cranial_nerves.png',dpi=220,bbox_inches='tight');plt.close(fig) PY python3 - <<'PY' from docx import Document from docx.shared import Inches, Pt, RGBColor from docx.enum.text import WD_ALIGN_PARAGRAPH from pathlib import Path p=Path('/tmp/workspace/neuroanatomy-study-notes/output/Comprehensive_Neuroanatomy_Study_Notes.docx') a=Path('/tmp/workspace/neuroanatomy-study-notes/assets') d=Document(p) d.add_page_break() h=d.add_heading('Labelled pathway and cranial nerve diagrams',level=1) h.runs[0].font.color.rgb=RGBColor(23,56,76) para=d.add_paragraph('Original schematic diagrams for rapid revision. Follow every arrow in the pathway figures, then state the main modality, crossing point, and expected laterality of a lesion.') para.paragraph_format.space_after=Pt(8) d.add_heading('Major pathways',level=2) d.add_picture(str(a/'labelled_major_pathways.png'),width=Inches(6.65));d.paragraphs[-1].alignment=WD_ALIGN_PARAGRAPH.CENTER cap=d.add_paragraph('Figure 1. High-yield pathway schematics. DCML = dorsal column-medial lemniscus; DRG = dorsal root ganglion; VPL = ventral posterolateral thalamic nucleus; LGN = lateral geniculate nucleus; LMN = lower motor neuron; UMN = upper motor neuron.') cap.runs[0].italic=True;cap.runs[0].font.size=Pt(8) d.add_heading('Cranial nerves',level=2) d.add_picture(str(a/'labelled_cranial_nerves.png'),width=Inches(6.55));d.paragraphs[-1].alignment=WD_ALIGN_PARAGRAPH.CENTER cap=d.add_paragraph('Figure 2. Schematic distribution and main functions of the 12 cranial nerves. The diagram emphasizes approximate brainstem level and examination-focused function, not the full peripheral course.') cap.runs[0].italic=True;cap.runs[0].font.size=Pt(8) d.save(p) print(p) PY python /tmp/skills/docx/scripts/office/validate.py "/tmp/workspace/neuroanatomy-study-notes/output/Comprehensive_Neuroanatomy_Study_Notes.docx" && ls -lh "/tmp/workspace/neuroanatomy-study-notes/output/Comprehensive_Neuroanatomy_Study_Notes.docx"
Comprehensive Neuroanatomy Study Notes
Word Document · DOCX
Add labeled brainstem cross-sections and cranial nerve nuclei
~/
midbrain pons medulla cross section cranial nerve nuclei labeled diagram
neuroanatomy education
NCBI Bookshelf cranial nerve nuclei brainstem neuroanatomy
python3 - <<'PY' from pathlib import Path import matplotlib.pyplot as plt from matplotlib.patches import Ellipse, Circle, FancyBboxPatch, Rectangle A=Path('/tmp/workspace/neuroanatomy-study-notes/assets') navy='#17384C'; blue='#2C7FB8'; teal='#3A8C8C'; red='#C95757'; gold='#C68A22'; violet='#8064A2'; pale='#F7FBFD' def label(ax,x,y,s,dx=0,dy=0,fs=7.2,ha='center'): ax.plot([x,x+dx],[y,y+dy],color='#51616D',lw=.8); ax.text(x+dx,y+dy,s,ha=ha,va='center',fontsize=fs,color=navy) def section(ax,title,level): ax.set_xlim(-5,5); ax.set_ylim(-3.8,3.8); ax.axis('off'); ax.set_title(title,fontsize=12,fontweight='bold',color=navy,pad=3) # dorsal top, ventral below ax.add_patch(Ellipse((0,0),8.2,5.8,facecolor=pale,edgecolor=navy,lw=1.6)) if level=='midbrain': ax.add_patch(Ellipse((0,2.3),1.2,.55,fc='white',ec=navy,lw=1)); ax.text(0,2.3,'Cerebral\naqueduct',ha='center',va='center',fontsize=6) for x in [-1.1,1.1]: ax.add_patch(Circle((x,.65),.43,fc='#E9C7A6',ec=gold));ax.text(x,.65,'Red\nnucleus',ha='center',va='center',fontsize=6) for x in [-2.2,2.2]: ax.add_patch(Ellipse((x,-1.25),1.65,.58,fc='#B9D9EB',ec=blue));ax.text(x,-1.25,'Cerebral\npeduncle',ha='center',va='center',fontsize=6.4) ax.add_patch(Rectangle((-3.2,-.45),6.4,.35,fc='#777777',ec='#555555'));ax.text(0,-.28,'Substantia nigra',ha='center',va='center',fontsize=6,color='white') for x,t in [(-.45,'III nucleus\n(+ Edinger-Westphal)'),(.45,'III nucleus\n(+ Edinger-Westphal)')]: ax.add_patch(Circle((x,1.45),.22,fc=red,ec='#8B3434'));ax.text(x,1.85,t,ha='center',fontsize=5.8,color=red) ax.text(0,-3.35,'Representative rostral midbrain level. Tectum is dorsal to the aqueduct.',ha='center',fontsize=6.8,color=navy) elif level=='pons': ax.add_patch(FancyBboxPatch((-1.45,1.95),2.9,.75,boxstyle='round,pad=.03',fc='white',ec=navy,lw=1));ax.text(0,2.32,'Fourth ventricle',ha='center',va='center',fontsize=7) nuclei=[(-1.65,1.1,'VI\nnucleus',red),(0,1.25,'VII\nfacial colliculus',red),(1.35,1.05,'Vestibular\nnuclei',teal),(-2.55,.35,'V motor\nnucleus',red),(-1.95,-.25,'V sensory\nnucleus',teal)] for x,y,t,c in nuclei: ax.add_patch(Circle((x,y),.28,fc=c,ec=navy,lw=.8));ax.text(x,y,t,ha='center',va='center',fontsize=5.4,color='white') ax.add_patch(Ellipse((0,-1.35),5.9,1.55,fc='#D2E8C4',ec=teal,lw=1));ax.text(0,-1.35,'Basilar pons\n(pontine nuclei + transverse fibers)',ha='center',va='center',fontsize=7,weight='bold',color=navy) ax.text(0,-3.35,'Representative caudal pons level. Motor nuclei are relatively medial/ventral; sensory nuclei more lateral/dorsal.',ha='center',fontsize=6.5,color=navy) else: ax.add_patch(FancyBboxPatch((-1.45,2),2.9,.75,boxstyle='round,pad=.03',fc='white',ec=navy,lw=1));ax.text(0,2.37,'Fourth ventricle',ha='center',va='center',fontsize=7) nuclei=[(-.5,1.05,'XII\nnucleus',red),(.48,1.05,'Dorsal motor\nnucleus X',red),(-1.55,.55,'Nucleus\nambiguus',red),(1.55,.4,'Solitary\nnucleus',teal),(-2.65,-.35,'Spinal V\nnucleus',teal)] for x,y,t,c in nuclei: ax.add_patch(Circle((x,y),.28,fc=c,ec=navy,lw=.8));ax.text(x,y,t,ha='center',va='center',fontsize=5.5,color='white') for x in [-2.05,2.05]: ax.add_patch(Ellipse((x,-1.35),1.35,.72,fc='#E9C7A6',ec=gold));ax.text(x,-1.35,'Inferior\nolive',ha='center',va='center',fontsize=6.2) ax.add_patch(FancyBboxPatch((-1.15,-2.35),2.3,.7,boxstyle='round,pad=.04',fc='#B9D9EB',ec=blue));ax.text(0,-2,'Pyramids\n(corticospinal)',ha='center',va='center',fontsize=6.5) ax.text(0,-3.35,'Representative open medulla level. Nucleus ambiguus supplies motor fibers of IX and X.',ha='center',fontsize=6.6,color=navy) fig,axs=plt.subplots(1,3,figsize=(12,5)); fig.patch.set_facecolor('white') section(axs[0],'Midbrain cross-section','midbrain');section(axs[1],'Pons cross-section','pons');section(axs[2],'Medulla cross-section','medulla') fig.suptitle('Simplified labelled brainstem cross-sections',fontsize=16,fontweight='bold',color=navy,y=.98) fig.text(.5,.01,'Schematic, not to scale. Dorsal is at the top in each section. Colored circles mark selected cranial-nerve nuclei.',ha='center',fontsize=8,color=navy) plt.tight_layout(rect=[0,.05,1,.92]);fig.savefig(A/'labelled_brainstem_cross_sections.png',dpi=230,bbox_inches='tight');plt.close(fig) # Longitudinal nuclei columns fig,ax=plt.subplots(figsize=(10,8));ax.set_xlim(0,11);ax.set_ylim(0,13);ax.axis('off');fig.patch.set_facecolor('white') ax.text(.45,12.5,'Cranial nerve nuclei: longitudinal organization',fontsize=17,fontweight='bold',color=navy) # brainstem outline ax.add_patch(FancyBboxPatch((3.4,.9),4.2,10.8,boxstyle='round,pad=.15,rounding_size=.45',fc='#F7FBFD',ec=navy,lw=1.7)) ax.text(5.5,11.3,'MIDBRAIN',ha='center',weight='bold',fontsize=10,color=navy); ax.text(5.5,7.5,'PONS',ha='center',weight='bold',fontsize=10,color=navy);ax.text(5.5,3.4,'MEDULLA',ha='center',weight='bold',fontsize=10,color=navy) for y in [9.8,5.4]:ax.plot([3.55,7.45],[y,y],ls='--',lw=.8,color='#9AAAB5') cols=[(4.05,'Somatic\nmotor',red),(4.9,'Branchial\nmotor','#D9803E'),(5.75,'Visceral\nmotor',violet),(6.6,'Visceral\nsensory',teal),(7.35,'Somatic\nsensory',blue)] for x,t,c in cols: ax.add_patch(Rectangle((x-.31,1.25),.62,10.1,fc=c,alpha=.20,ec=c,lw=1));ax.text(x,11.75,t,ha='center',va='bottom',fontsize=7.1,rotation=0,color=c,weight='bold') # nucleus labels: x,y,text,color items=[(4.05,10.65,'III, IV',red),(4.9,8.75,'V motor', '#D9803E'),(5.75,10.6,'Edinger-\nWestphal',violet),(6.6,4.3,'Solitary\nnucleus',teal),(7.35,8.1,'V principal\nsensory',blue),(7.35,7.1,'Vestibular\n& cochlear',blue),(4.05,7.75,'VI',red),(4.9,7.75,'VII', '#D9803E'),(5.75,4.65,'Dorsal\nmotor X',violet),(4.05,4.8,'XII',red),(4.9,4.0,'Nucleus\nambiguus\n(IX, X, XI)', '#D9803E'),(7.35,3.4,'Spinal V',blue)] for x,y,t,c in items: ax.add_patch(Circle((x,y),.31,fc=c,ec='white',lw=1));ax.text(x,y,t,ha='center',va='center',fontsize=5.6,color='white',weight='bold') ax.annotate('Medial',xy=(4.0,.7),xytext=(3.1,.35),arrowprops={'arrowstyle':'->','color':navy},color=navy,fontsize=8) ax.annotate('Lateral',xy=(7.4,.7),xytext=(8.1,.35),arrowprops={'arrowstyle':'->','color':navy},color=navy,fontsize=8) ax.text(5.5,.05,'Developmental rule: motor columns lie medially; sensory columns lie laterally. In cross-section, motor nuclei are generally ventral to sensory nuclei.',ha='center',fontsize=8,color=navy) plt.tight_layout();fig.savefig(A/'cranial_nerve_nuclei_columns.png',dpi=230,bbox_inches='tight');plt.close(fig) PY python3 - <<'PY' from docx import Document from docx.shared import Inches, Pt from docx.enum.text import WD_ALIGN_PARAGRAPH from pathlib import Path p=Path('/tmp/workspace/neuroanatomy-study-notes/output/Comprehensive_Neuroanatomy_Study_Notes.docx');a=Path('/tmp/workspace/neuroanatomy-study-notes/assets') d=Document(p); d.add_page_break(); d.add_heading('Brainstem cross-sections and cranial nerve nuclei',level=1) p1=d.add_paragraph('These diagrams use a dorsal-to-ventral orientation and show selected, high-yield structures. They are simplified for localization practice rather than histological detail.') p1.paragraph_format.space_after=Pt(7) d.add_heading('Representative brainstem cross-sections',level=2) d.add_picture(str(a/'labelled_brainstem_cross_sections.png'),width=Inches(6.65));d.paragraphs[-1].alignment=WD_ALIGN_PARAGRAPH.CENTER p2=d.add_paragraph('Figure 3. Simplified transverse sections through the midbrain, pons and open medulla. Red circles indicate somatic motor nuclei; orange circles, branchial motor nuclei; teal or blue circles, sensory nuclei. Use these landmarks with long-tract signs to localize brainstem lesions.') p2.runs[0].italic=True;p2.runs[0].font.size=Pt(8) d.add_heading('Longitudinal organization of cranial nerve nuclei',level=2) d.add_picture(str(a/'cranial_nerve_nuclei_columns.png'),width=Inches(6.35));d.paragraphs[-1].alignment=WD_ALIGN_PARAGRAPH.CENTER p3=d.add_paragraph('Figure 4. Columnar organization of selected cranial-nerve nuclei. The medial-to-lateral arrangement reflects the separation of motor and sensory regions during embryonic development. Nucleus ambiguus contains branchial motor neurons for CN IX and X, with a cranial XI contribution.') p3.runs[0].italic=True;p3.runs[0].font.size=Pt(8) d.add_heading('Cross-section localization cues',level=2) for t in ['Midbrain: III palsy with contralateral weakness suggests involvement of the oculomotor fascicles and cerebral peduncle.','Pons: facial weakness, abducens palsy, and a crossed body deficit point to the caudal pons. Lateral pontine symptoms can include hearing or vestibular findings.','Medulla: nucleus ambiguus involvement produces dysphagia and hoarseness. A combination of ipsilateral facial pain-temperature loss, contralateral body pain-temperature loss and ataxia suggests lateral medulla.']: d.add_paragraph(t,style='List Bullet') d.save(p) print(p) PY python /tmp/skills/docx/scripts/office/validate.py "/tmp/workspace/neuroanatomy-study-notes/output/Comprehensive_Neuroanatomy_Study_Notes.docx" && python3 - <<'PY' from docx import Document p='/tmp/workspace/neuroanatomy-study-notes/output/Comprehensive_Neuroanatomy_Study_Notes.docx';d=Document(p);print('tables:',len(d.tables),'images:',len(d.inline_shapes),'paragraphs:',len(d.paragraphs)) PY ls -lh "/tmp/workspace/neuroanatomy-study-notes/output/Comprehensive_Neuroanatomy_Study_Notes.docx"
Comprehensive Neuroanatomy Study Notes
Word Document · DOCX
Add labeled ventricular system and CSF circulation diagrams
~/
labeled ventricular system cerebrospinal fluid circulation diagram

An anatomical diagram of the human brain in sagittal section, illustrating the classical theory of cerebrospinal fluid (CSF) circulation. The ventricular system is highlighted in light blue, and yellow arrows indicate the directional flow of CSF. Labeled structures include the lateral ventricle, choroid plexus (site of CSF secretion), third ventricle, interventricular foramen, cerebral aqueduct, fourth ventricle, and the subarachnoid space. The diagram depicts the sequential pathway starting from the lateral ventricles, passing through the foramen to the third ventricle, continuing through the narrow aqueduct into the fourth ventricle, and finally exiting into the subarachnoid space surrounding the central nervous system. This educational illustration serves to teach the physiological movement of CSF and the anatomical relationships within the brain's ventricular system, relevant to clinical topics such as obstructive and communicating hydrocephalus.

Anatomical diagram of the brain in coronal cross-section, illustrating the primary physiological interfaces between the blood and central nervous system (CNS). The diagram identifies the Blood-Brain Barrier (BBB) and the Blood-CSF Barrier (BCB). The brain parenchyma is shown in gray, containing cerebral microvessels (red lines) that form the BBB, separating the systemic circulation from neurons and glia. Centrally, the ventricular system is depicted in blue (labeled 'CSF') and outlined by a green border. Within the ventricle, the choroid plexus is represented by a yellow epithelial layer and purple capillaries. The BCB is specifically localized to this choroid plexus epithelium, which regulates the transport of materials from the fenestrated choroid plexus capillaries into the cerebrospinal fluid. This schematic serves as an educational resource for neuroanatomy and neurophysiology, highlighting how different cellular interfaces protect the brain's microenvironment and facilitate selective solute exchange.

This medical illustration depicts the production, circulation, and absorption of cerebrospinal fluid (CSF) within the human central nervous system. The primary anatomical diagram shows a sagittal section of the brain, highlighting the ventricular system (lateral, third, and fourth ventricles) and the choroid plexus as the site of CSF production. White arrows indicate the flow from the ventricles into the brain cisterns and the subarachnoid space, where it is labeled as extra-axial CSF. A detailed inset focuses on the glymphatic-like interaction within the brain parenchyma. This close-up view shows the perivascular space surrounding a blood vessel, illustrating the movement of interstitial fluid and CSF exchange adjacent to neurons and astrocytes. The diagram further illustrates the primary drainage pathways into the superior sagittal sinus via arachnoid granulations and into the meningeal lymphatic vessels. This visual resource is designed for neurological and physiological education, emphasizing the dynamic nature of CSF and its critical role in metabolic waste clearance and intracranial pressure regulation.

This medical anatomical diagram illustrates the production, circulation, and resorption of cerebrospinal fluid (CSF) within the human central nervous system. The illustration is a sagittal cross-section of the brain and upper spinal cord, highlighting the ventricular system and meningeal layers. Key anatomical structures labeled include the lateral ventricle, choroid plexus (the primary site of CSF production), the Foramen of Monro, third ventricle, Aqueduct of Sylvius, and fourth ventricle. The pathway of CSF flow is indicated by directional arrows, tracing the fluid's movement from the ventricles through the Foramen of Magendie into the subarachnoid space and the central canal. The diagram also depicts the three meningeal layers: the outermost dura mater, the arachnoid mater, and the innermost pia mater, with the subarachnoid space clearly delineated between the arachnoid and pia. Educational focus is placed on CSF resorption via the arachnoid villi (granulations) into the superior sagittal sinus. Supporting landmarks such as the corpus callosum, fornix, and cerebellum provide spatial context for neuroanatomical study.

This medical illustration is an anatomical diagram of the human brain in sagittal section, specifically highlighting the ventricular system and cerebrospinal fluid (CSF) flow. The ventricles are colored light blue, while the choroid plexuses are depicted in red. Key anatomical structures labeled include the body, anterior, posterior, and inferior horns of the lateral ventricles. The pathway of CSF is shown starting from the lateral ventricles, passing through the foramen of Monro into the third ventricle, then descending through the cerebral aqueduct into the fourth ventricle. Surrounding landmarks include the cortex, cerebellum, spinal cord, superior medullary velum, and cisterna magna. The diagram also illustrates the relationship between the brain and protective layers, including the skull, subarachnoid space, and venous sinuses such as the superior sagittal sinus. This educational visual is designed to teach the internal macro-anatomy of the central nervous system, focusing on the production and circulation of CSF.
cerebrospinal fluid circulation
NCBI Bookshelf cerebrospinal fluid circulation ventricular system anatomy
python3 - <<'PY' from pathlib import Path import matplotlib.pyplot as plt from matplotlib.patches import FancyBboxPatch, FancyArrowPatch, Ellipse, Circle, Polygon A=Path('/tmp/workspace/neuroanatomy-study-notes/assets'); navy='#17384C';blue='#55A9D8';darkblue='#2378A6';red='#C95757';gray='#EAF3F7';gold='#D69B2D' def box(ax,x,y,w,h,t,fc='white',ec=navy,fs=8): ax.add_patch(FancyBboxPatch((x,y),w,h,boxstyle='round,pad=.04,rounding_size=.08',fc=fc,ec=ec,lw=1.3));ax.text(x+w/2,y+h/2,t,ha='center',va='center',fontsize=fs,color=navy,weight='bold') def arrow(ax,a,b,c=darkblue): ax.add_patch(FancyArrowPatch(a,b,arrowstyle='-|>',mutation_scale=14,lw=2,color=c)) # Ventricular anatomy fig,axs=plt.subplots(1,2,figsize=(11,5.6));fig.patch.set_facecolor('white') # coronal view ax=axs[0];ax.set_xlim(-5,5);ax.set_ylim(-4,5);ax.axis('off');ax.set_title('Coronal view: paired lateral ventricles',fontsize=12,fontweight='bold',color=navy) ax.add_patch(Ellipse((0,.5),8.5,7.6,fc='#F7FBFD',ec=navy,lw=1.5));ax.plot([0,0],[-3.1,4.1],color='#A9BBC7',lw=1,ls='--');ax.text(0,4.25,'Midline',ha='center',fontsize=7,color=navy) for x in [-1.7,1.7]: ax.add_patch(Ellipse((x,1.4),1.5,3.4,fc=blue,ec=darkblue,lw=1.2)); ax.text(x,1.4,'Lateral\nventricle',ha='center',va='center',fontsize=7,color='white',weight='bold') ax.add_patch(Circle((x,.05),.2,fc=red,ec='#8B3434'));ax.text(x,.05,'CP',ha='center',va='center',fontsize=5.5,color='white',weight='bold') ax.add_patch(FancyBboxPatch((-.33,-2.2),.66,2.0,boxstyle='round,pad=.04',fc=blue,ec=darkblue));ax.text(0,-1.2,'Third\nventricle',ha='center',va='center',fontsize=6.5,color='white',weight='bold') for x in [-1.0,1.0]: arrow(ax,(x,.0),(-.28,-.15) if x<0 else (.28,-.15)) ax.text(0,-3.2,'Foramina of Monro',ha='center',fontsize=7.5,color=navy);ax.annotate('',xy=(0,-2.15),xytext=(0,-2.85),arrowprops={'arrowstyle':'->','color':darkblue,'lw':1.5}) ax.text(-4.7,-3.7,'CP = choroid plexus',fontsize=7,color=red) # sagittal view ax=axs[1];ax.set_xlim(-4.8,5);ax.set_ylim(-4,5);ax.axis('off');ax.set_title('Mid-sagittal view: ventricular connections',fontsize=12,fontweight='bold',color=navy) ax.add_patch(Ellipse((.2,.4),8.6,7.3,fc='#F7FBFD',ec=navy,lw=1.5));ax.add_patch(Ellipse((-1.2,2.0),3.6,1.0,fc=blue,ec=darkblue,lw=1.2));ax.text(-1.2,2.0,'Lateral ventricle',ha='center',va='center',fontsize=7,color='white',weight='bold') ax.add_patch(Circle((1.0,1.65),.16,fc=blue,ec=darkblue));ax.annotate('Foramen of Monro',xy=(1,1.65),xytext=(2.4,2.5),fontsize=7,color=navy,arrowprops={'arrowstyle':'-','color':navy}) ax.add_patch(FancyBboxPatch((.75,.3),.52,1.25,boxstyle='round,pad=.02',fc=blue,ec=darkblue));ax.text(1.01,.93,'Third\nventricle',ha='center',va='center',fontsize=6,color='white',weight='bold') arrow(ax,(1.0,.3),(1.0,-.5));ax.add_patch(FancyBboxPatch((.82,-1.35),.35,.85,boxstyle='round,pad=.02',fc=blue,ec=darkblue));ax.annotate('Cerebral aqueduct',xy=(1,-.9),xytext=(2.05,-.5),fontsize=7,color=navy,arrowprops={'arrowstyle':'-','color':navy}) arrow(ax,(1,-1.35),(1,-1.7));ax.add_patch(Ellipse((.85,-2.15),2.7,.9,fc=blue,ec=darkblue));ax.text(.85,-2.15,'Fourth ventricle',ha='center',va='center',fontsize=7,color='white',weight='bold') ax.add_patch(Ellipse((3,-1.9),2,2.6,fc='#F5D5A7',ec=navy,lw=1));ax.text(3,-1.9,'Cerebellum',ha='center',va='center',fontsize=8,color=navy,weight='bold') ax.annotate('Median aperture\n(Magendie)',xy=(.85,-2.65),xytext=(-2.8,-2.8),fontsize=7,color=navy,arrowprops={'arrowstyle':'->','color':darkblue}) ax.annotate('Lateral aperture\n(Luschka)',xy=(-.5,-2.15),xytext=(-3.7,-1.4),fontsize=7,color=navy,arrowprops={'arrowstyle':'->','color':darkblue}) fig.suptitle('Ventricular system: anatomy and connections',fontsize=16,fontweight='bold',color=navy,y=.98);fig.text(.5,.02,'Blue spaces represent CSF-filled ventricles. Diagram is schematic and not to scale.',ha='center',fontsize=8,color=navy);plt.tight_layout(rect=[0,.06,1,.92]);fig.savefig(A/'labelled_ventricular_system.png',dpi=230,bbox_inches='tight');plt.close(fig) # CSF flow fig,ax=plt.subplots(figsize=(10,7));ax.set_xlim(0,10);ax.set_ylim(0,12);ax.axis('off');fig.patch.set_facecolor('white');ax.text(.4,11.5,'CSF production, circulation and absorption',fontsize=17,fontweight='bold',color=navy) steps=[(4.0,10.1,2.0,.7,'Choroid plexus\nCSF production', '#E6F4FA'),(4.0,8.75,2.0,.7,'Lateral ventricles', '#D9EFFA'),(4.0,7.35,2.0,.7,'Foramina of Monro', '#D9EFFA'),(4.0,5.95,2.0,.7,'Third ventricle', '#D9EFFA'),(4.0,4.55,2.0,.7,'Cerebral aqueduct', '#D9EFFA'),(4.0,3.15,2.0,.7,'Fourth ventricle', '#D9EFFA'),(1.1,1.45,2.45,.85,'Median & lateral\napertures', '#D9EFFA'),(4.0,1.45,2.0,.85,'Subarachnoid\nspace & cisterns', '#D9EFFA'),(7.0,1.45,2.25,.85,'Arachnoid\ngranulations', '#E6F4FA')] for x,y,w,h,t,c in steps:box(ax,x,y,w,h,t,c,fs=8) for a,b in [((5,10.1),(5,9.45)),((5,8.75),(5,8.05)),((5,7.35),(5,6.65)),((5,5.95),(5,5.25)),((5,4.55),(5,3.85)),((5,3.15),(2.35,2.3)),((2.35,1.45),(4,1.88)),((6,1.88),(7,1.88))]:arrow(ax,a,b) box(ax,7.0,.1,2.25,.7,'Dural venous sinus\n(systemic venous blood)','#FBE7E7',ec=red,fs=7.5);arrow(ax,(8.1,1.45),(8.1,.8),red) # obstruction callouts for x,y,t in [(6.55,4.9,'Aqueduct stenosis\n-> upstream ventricular enlargement'),(6.55,2.65,'Fourth-ventricle outlet\nobstruction'),(.35,3.15,'Impaired arachnoid\nresorption -> communicating\nhydrocephalus')]: box(ax,x,y,2.55,.75,t,'#FFF6DF',ec=gold,fs=6.7) ax.text(5,.5,'CSF is chiefly produced by choroid plexus and is absorbed into venous sinuses through arachnoid granulations.',ha='center',fontsize=8,color=navy) plt.tight_layout();fig.savefig(A/'labelled_csf_circulation.png',dpi=230,bbox_inches='tight');plt.close(fig) PY python3 - <<'PY' from docx import Document from docx.shared import Inches,Pt from docx.enum.text import WD_ALIGN_PARAGRAPH from pathlib import Path p=Path('/tmp/workspace/neuroanatomy-study-notes/output/Comprehensive_Neuroanatomy_Study_Notes.docx');a=Path('/tmp/workspace/neuroanatomy-study-notes/assets') d=Document(p);d.add_page_break();d.add_heading('Ventricular system and cerebrospinal fluid circulation',level=1) p0=d.add_paragraph('The ventricular system contains CSF and is continuous with the subarachnoid space. Choroid plexus produces most CSF in the lateral, third, and fourth ventricles. This section focuses on the anatomical route and the points at which obstruction produces hydrocephalus.') p0.paragraph_format.space_after=Pt(7) d.add_heading('Ventricular anatomy',level=2);d.add_picture(str(a/'labelled_ventricular_system.png'),width=Inches(6.65));d.paragraphs[-1].alignment=WD_ALIGN_PARAGRAPH.CENTER p1=d.add_paragraph('Figure 5. Labelled ventricular system in coronal and sagittal schematic views. The paired lateral ventricles communicate with the third ventricle through the interventricular foramina (of Monro). The third ventricle connects to the fourth ventricle via the cerebral aqueduct.') p1.runs[0].italic=True;p1.runs[0].font.size=Pt(8) d.add_heading('CSF circulation',level=2);d.add_picture(str(a/'labelled_csf_circulation.png'),width=Inches(6.35));d.paragraphs[-1].alignment=WD_ALIGN_PARAGRAPH.CENTER p2=d.add_paragraph('Figure 6. CSF circulation from choroid plexus through the ventricular system, fourth-ventricle apertures, subarachnoid space, arachnoid granulations and dural venous sinuses. The clinical callouts distinguish obstructive from communicating hydrocephalus.') p2.runs[0].italic=True;p2.runs[0].font.size=Pt(8) d.add_heading('Clinical correlation',level=2) for x in ['Non-communicating (obstructive) hydrocephalus results from blockage within the ventricular pathway, such as aqueductal stenosis. Ventricles upstream from the block enlarge.','Communicating hydrocephalus occurs when ventricular outflow is patent but CSF absorption is impaired, commonly after subarachnoid hemorrhage or meningitis.','Raised intracranial pressure can cause headache, vomiting, reduced consciousness and papilledema. Acute suspected hydrocephalus needs urgent clinical assessment.']: d.add_paragraph(x,style='List Bullet') d.save(p) print(p) PY python /tmp/skills/docx/scripts/office/validate.py "/tmp/workspace/neuroanatomy-study-notes/output/Comprehensive_Neuroanatomy_Study_Notes.docx" && python3 - <<'PY' from docx import Document p='/tmp/workspace/neuroanatomy-study-notes/output/Comprehensive_Neuroanatomy_Study_Notes.docx';d=Document(p);print('images',len(d.inline_shapes),'tables',len(d.tables),'paragraphs',len(d.paragraphs)) PY ls -lh "/tmp/workspace/neuroanatomy-study-notes/output/Comprehensive_Neuroanatomy_Study_Notes.docx"
Comprehensive Neuroanatomy Study Notes
Word Document · DOCX
Create a cranial nerve lesion-localization table
cranial nerve palsy diagnosis
NCBI Bookshelf cranial nerve lesion examination localization
~/neuroanatomy-study-notes/output
python3 - <<'PY' from docx import Document p='/tmp/workspace/neuroanatomy-study-notes/output/Comprehensive_Neuroanatomy_Study_Notes.docx' d=Document(p) print('Existing document:', len(d.paragraphs), 'paragraphs,', len(d.tables), 'tables,', len(d.inline_shapes), 'images') for para in d.paragraphs[-8:]: if para.text.strip(): print(para.text[:120]) PY
python3 - <<'PY' from docx import Document from docx.shared import Inches, Pt, RGBColor from docx.enum.section import WD_SECTION, WD_ORIENT from docx.enum.table import WD_TABLE_ALIGNMENT, WD_CELL_VERTICAL_ALIGNMENT from docx.enum.text import WD_ALIGN_PARAGRAPH from docx.oxml import OxmlElement from docx.oxml.ns import qn path='/tmp/workspace/neuroanatomy-study-notes/output/Comprehensive_Neuroanatomy_Study_Notes.docx' doc=Document(path) # Start a landscape section for legible localization table sec=doc.add_section(WD_SECTION.NEW_PAGE) sec.orientation=WD_ORIENT.LANDSCAPE sec.page_width=Inches(11.69); sec.page_height=Inches(8.27) sec.top_margin=Inches(.55); sec.bottom_margin=Inches(.55); sec.left_margin=Inches(.55); sec.right_margin=Inches(.55) h=doc.add_heading('Cranial nerve lesion-localization table',level=1) h.runs[0].font.color.rgb=RGBColor(23,56,76) p=doc.add_paragraph('Use this table with the cranial-nerve diagrams. An isolated deficit may arise from the nerve, fascicle, nucleus, skull base, orbit, cavernous sinus, or neuromuscular target. Multiple ipsilateral cranial-nerve deficits, especially with contralateral limb signs, localize more strongly to the brainstem.') p.paragraph_format.space_after=Pt(6) def cell_shade(cell, fill): tcPr=cell._tc.get_or_add_tcPr() shd=OxmlElement('w:shd'); shd.set(qn('w:val'),'clear'); shd.set(qn('w:fill'),fill) # insert before tcW for Word XML element ordering tcPr.insert(0, shd) def set_text(cell,text,bold=False,color=None,size=7.1): cell.text=''; p=cell.paragraphs[0]; p.paragraph_format.space_after=Pt(0); p.paragraph_format.space_before=Pt(0) r=p.add_run(text);r.bold=bold;r.font.name='Aptos';r.font.size=Pt(size) if color:r.font.color.rgb=RGBColor.from_string(color) cell.vertical_alignment=WD_CELL_VERTICAL_ALIGNMENT.CENTER headers=['CN','Key bedside finding','Deficit pattern','Most useful localization clue','Common anatomical site / syndrome','Reflex or exam anchor'] rows=[ ['I Olfactory','Test each nostril with a familiar non-irritant odor.','Anosmia, sometimes reduced flavour perception.','Isolated anosmia after head trauma suggests olfactory fila/cribriform injury; unilateral progressive deficit may be anterior cranial fossa or olfactory-groove pathology.','Olfactory epithelium, cribriform plate, olfactory bulb/tract, orbitofrontal cortex.','Avoid ammonia, which stimulates trigeminal endings rather than CN I.'], ['II Optic','Visual acuity, fields, pupils and fundus.','Monocular visual loss, visual-field defect, or relative afferent pupillary defect (RAPD).','Pre-chiasmal lesion gives monocular findings. Chiasmal lesion gives bitemporal hemianopia. Retrochiasmal lesion gives contralateral homonymous defect.','Optic nerve, chiasm, optic tract/radiations, occipital cortex.','Afferent limb of pupillary light reflex.'], ['III Oculomotor','Check ptosis, eye position, adduction/elevation/depression, pupil.','Ptosis; eye “down and out”; diplopia; impaired adduction/elevation/depression. Dilated pupil suggests parasympathetic involvement.','Pupil-involving painful III palsy raises concern for a compressive lesion. III palsy plus contralateral weakness suggests midbrain fascicle/peduncle involvement.','Midbrain nucleus/fascicle; subarachnoid space near posterior communicating artery; cavernous sinus; orbital apex.','Efferent limb of direct and consensual light reflex.'], ['IV Trochlear','Ask patient to look down while eye is adducted.','Vertical or torsional diplopia, worse descending stairs or reading; compensatory head tilt away from affected side.','Peripheral/fascicular lesion causes ipsilateral superior-oblique weakness. A nuclear lesion produces contralateral weakness because fibers decussate dorsally.','Dorsal caudal midbrain, subarachnoid course, cavernous sinus, superior orbital fissure.','Failure to depress the adducted eye.'], ['V Trigeminal','Test V1/V2/V3 facial sensation; corneal response; jaw clench and opening.','Facial sensory loss or pain; weak mastication; jaw deviates toward weak pterygoid.','V1 sensory loss with III, IV or VI deficits suggests cavernous sinus/orbital apex. Facial sensory loss with crossed body signs suggests brainstem pathway involvement.','Trigeminal ganglion/Meckel cave, cavernous sinus (V1/V2), pons, cerebellopontine angle.','Corneal reflex: V1 afferent, VII efferent.'], ['VI Abducens','Test abduction of each eye.','Horizontal diplopia, worse looking toward affected side; failure of abduction.','VI palsy with ipsilateral facial weakness points to caudal pontine fascicle/nucleus region. Isolated VI palsy may be a false-localizing sign in raised ICP.','Caudal pons, clivus/Dorello canal, cavernous sinus, orbit.','Lateral rectus moves eye laterally.'], ['VII Facial','Raise eyebrows, close eyes tightly, smile, puff cheeks; ask taste or hyperacusis when relevant.','LMN lesion: ipsilateral weakness of entire face. UMN lesion: contralateral lower-face weakness with forehead sparing.','Facial palsy plus ipsilateral abduction deficit localizes to caudal pons. Hyperacusis, taste loss or reduced lacrimation can help localize along intratemporal course.','Facial nucleus/fascicle, cerebellopontine angle, internal acoustic meatus, facial canal, stylomastoid foramen.','Corneal reflex: VII efferent.'], ['VIII Vestibulocochlear','Whisper/finger-rub, Weber/Rinne when indicated; assess nystagmus and vestibular symptoms.','Sensorineural hearing loss, vertigo, imbalance, nystagmus.','VIII symptoms with VII involvement suggest cerebellopontine angle or internal acoustic meatus. Central vestibular signs often have other brainstem/cerebellar findings.','Vestibulocochlear nuclei, cerebellopontine angle, internal acoustic meatus, labyrinth.','Rinne/Weber distinguish conductive from sensorineural patterns.'], ['IX Glossopharyngeal','Assess posterior pharyngeal sensation and gag response in context.','Dysphagia; reduced posterior-third tongue taste/sensation; impaired afferent gag limb.','Usually coexists with X deficits. Combined IX-X-XI involvement suggests jugular foramen region.','Nucleus ambiguus/solitary nucleus, jugular foramen, upper neck.','Gag reflex afferent: IX.'], ['X Vagus','Listen for voice quality; inspect palate; assess cough and swallowing safely.','Hoarseness, dysphagia, palatal droop; uvula deviates away from the weak side.','IX-X-XI deficits point to jugular foramen. Dysphagia/hoarseness with ipsilateral facial pain-temperature loss and contralateral body pain-temperature loss suggests lateral medulla.','Nucleus ambiguus, dorsal motor nucleus, jugular foramen, recurrent laryngeal nerve.','Gag reflex efferent: X.'], ['XI Accessory','Shoulder elevation against resistance; turn head against resistance.','Weak ipsilateral trapezius and sternocleidomastoid.','Peripheral lesion commonly follows posterior-triangle neck injury. With IX, X and XII findings, consider skull base/jugular-foramen or medullary process.','Spinal accessory nucleus (C1-C5), jugular foramen, posterior cervical triangle.','Trapezius elevates ipsilateral shoulder; SCM turns face to opposite side.'], ['XII Hypoglossal','Protrude tongue, inspect for atrophy/fasciculations, assess articulation.','LMN lesion: ipsilateral atrophy/fasciculations and tongue deviates toward lesion on protrusion. UMN lesion: usually mild contralateral weakness.','XII palsy with contralateral hemiparesis suggests medial medulla. Isolated lower CN XII can arise near hypoglossal canal.','Medial medulla/nucleus/fascicle, hypoglossal canal, carotid space/skull base.','The tongue points toward a weak genioglossus.'] ] t=doc.add_table(rows=1,cols=len(headers));t.style='Table Grid';t.alignment=WD_TABLE_ALIGNMENT.CENTER t.autofit=False widths=[.55,1.48,1.75,2.0,2.25,1.45] for c,w,hdr in zip(t.rows[0].cells,widths,headers): c.width=Inches(w);set_text(c,hdr,True,'FFFFFF',7.1);cell_shade(c,'246B8A') for i,row in enumerate(rows): cells=t.add_row().cells for c,w,text in zip(cells,widths,row): c.width=Inches(w);set_text(c,text,size=6.65) if i%2==1: cell_shade(c,'EAF3F7') p=doc.add_paragraph();p.paragraph_format.space_before=Pt(4) r=p.add_run('Pattern shortcuts: ');r.bold=True;r.font.size=Pt(8) p.add_run('III + IV + V1/V2 + VI suggests cavernous sinus or orbital-apex disease. VII + VIII suggests cerebellopontine angle/internal acoustic meatus. IX + X + XI suggests jugular foramen. Ipsilateral cranial-nerve findings plus contralateral body signs suggest a brainstem lesion.').font.size=Pt(8) p=doc.add_paragraph();p.paragraph_format.space_after=Pt(0) r=p.add_run('Clinical note: ');r.bold=True;r.font.size=Pt(8) p.add_run('New painful pupil-involving third-nerve palsy, acute diplopia with neurological deficits, acute dysphagia, or new facial weakness with other focal signs requires urgent medical evaluation.').font.size=Pt(8) doc.save(path) print(path) PY python /tmp/skills/docx/scripts/office/validate.py "/tmp/workspace/neuroanatomy-study-notes/output/Comprehensive_Neuroanatomy_Study_Notes.docx" && python3 - <<'PY' from docx import Document p='/tmp/workspace/neuroanatomy-study-notes/output/Comprehensive_Neuroanatomy_Study_Notes.docx';d=Document(p) print('tables',len(d.tables),'paragraphs',len(d.paragraphs),'images',len(d.inline_shapes)) print('last heading/table header:',d.paragraphs[-3].text[:70],d.tables[-1].rows[0].cells[0].text) PY ls -lh "/tmp/workspace/neuroanatomy-study-notes/output/Comprehensive_Neuroanatomy_Study_Notes.docx"
python3 - <<'PY' from docx import Document from docx.oxml.ns import qn p='/tmp/workspace/neuroanatomy-study-notes/output/Comprehensive_Neuroanatomy_Study_Notes.docx' d=Document(p) # Remove table-cell shading XML from the recently added table because its ordering conflicts with the validator. for cell in d.tables[-1]._cells: tcPr=cell._tc.tcPr if tcPr is not None: for el in list(tcPr): if el.tag == qn('w:shd'): tcPr.remove(el) d.save(p) print('saved') PY python /tmp/skills/docx/scripts/office/validate.py "/tmp/workspace/neuroanatomy-study-notes/output/Comprehensive_Neuroanatomy_Study_Notes.docx" && python3 - <<'PY' from docx import Document p='/tmp/workspace/neuroanatomy-study-notes/output/Comprehensive_Neuroanatomy_Study_Notes.docx';d=Document(p) print('tables',len(d.tables),'rows in lesion table',len(d.tables[-1].rows),'images',len(d.inline_shapes)) print(d.tables[-1].rows[0].cells[0].text, '|', d.tables[-1].rows[-1].cells[0].text) PY ls -lh "/tmp/workspace/neuroanatomy-study-notes/output/Comprehensive_Neuroanatomy_Study_Notes.docx"
Comprehensive Neuroanatomy Study Notes
Word Document · DOCX
Add a brainstem syndrome localization table and 2
Add a brainstem vascular-territory localization table
~/
brainstem stroke syndrome diagnosis
NCBI Bookshelf brainstem stroke syndromes PICA AICA basilar artery localization
~/neuroanatomy-study-notes/output
python3 - <<'PY' from docx import Document from docx.shared import Inches, Pt, RGBColor from docx.enum.table import WD_TABLE_ALIGNMENT, WD_CELL_VERTICAL_ALIGNMENT from docx.enum.text import WD_ALIGN_PARAGRAPH from pathlib import Path p=Path('/tmp/workspace/neuroanatomy-study-notes/output/Comprehensive_Neuroanatomy_Study_Notes.docx') doc=Document(p) # Existing final section is landscape, ideal for this table. h=doc.add_heading('Brainstem vascular-territory localization table', level=1) h.runs[0].font.color.rgb=RGBColor(23,56,76) intro=doc.add_paragraph('Use the vascular territory together with the “crossed” pattern of ipsilateral cranial-nerve signs and contralateral body findings. Vascular anatomy varies, so syndromes are clinical patterns rather than rigid maps.') intro.paragraph_format.space_after=Pt(6) def add_cell(cell,text,bold=False,size=6.75): cell.text='' para=cell.paragraphs[0]; para.paragraph_format.space_before=Pt(0);para.paragraph_format.space_after=Pt(0) r=para.add_run(text);r.font.name='Aptos';r.font.size=Pt(size);r.bold=bold cell.vertical_alignment=WD_CELL_VERTICAL_ALIGNMENT.CENTER headers=['Territory / vessel','Brainstem region','Key structures at risk','Expected ipsilateral signs','Expected contralateral signs','High-yield localization phrase'] rows=[ ['Paramedian branches of anterior spinal artery or vertebral artery','Medial medulla','Pyramid, medial lemniscus, hypoglossal nucleus/fascicle','CN XII LMN palsy: tongue atrophy and deviation toward lesion','Hemiparesis and loss of vibration/proprioception','Medial medullary (Dejerine): “tongue + pyramid + lemniscus.”'], ['PICA or vertebral artery','Lateral medulla','Nucleus ambiguus, vestibular nuclei, inferior cerebellar peduncle, spinal trigeminal nucleus/tract, spinothalamic tract, descending sympathetic fibers','Dysphagia, hoarseness, reduced gag; ipsilateral facial pain-temperature loss; vertigo/nystagmus; ipsilateral ataxia; Horner syndrome','Loss of pain and temperature from body','Lateral medullary (Wallenberg): “nucleus ambiguus + crossed pain-temperature.”'], ['Anterior inferior cerebellar artery (AICA), branch of basilar artery','Lateral caudal pons','Facial nucleus/fascicle, vestibular/cochlear nuclei, middle cerebellar peduncle, spinal trigeminal pathway, spinothalamic tract','LMN facial weakness; reduced lacrimation/taste; hyperacusis; vertigo, hearing loss; ipsilateral facial pain-temperature loss; ataxia','Loss of body pain and temperature','Lateral pontine: “facial weakness with auditory-vestibular symptoms.”'], ['Paramedian basilar perforators','Medial caudal pons','Corticospinal tract, medial lemniscus, abducens fascicle or nucleus','VI palsy; if nucleus/PPRF involved, horizontal gaze palsy toward lesion','Hemiparesis, sometimes impaired vibration/proprioception','Medial pontine: “abduction/gaze deficit plus long-tract signs.”'], ['Basilar artery ventral pontine branches, extensive bilateral involvement','Ventral pons','Bilateral corticospinal and corticobulbar tracts, often sparing tegmentum and reticular activating system','Facial, bulbar and eye-movement impairment may occur; consciousness can be preserved','Quadriplegia and anarthria with preserved awareness','Locked-in syndrome: communicate with vertical eye movements/blinking if pathways are spared.'], ['Superior cerebellar artery (SCA)','Rostral lateral pons / superior cerebellar peduncle and cerebellum','Superior cerebellar peduncle, cerebellar pathways, possible spinothalamic and trigeminal pathways','Ipsilateral limb ataxia, dysmetria, dysarthria; may have ipsilateral facial pain-temperature loss','May have body pain-temperature loss','SCA: marked ipsilateral cerebellar ataxia with fewer lower cranial-nerve signs than PICA/AICA.'], ['Paramedian branches of posterior cerebral artery (PCA) or basilar tip perforators','Medial midbrain','Oculomotor fascicle/nucleus, cerebral peduncle, red nucleus/substantia nigra depending on extent','III palsy: ptosis, “down-and-out” eye; possible dilated pupil','Hemiparesis from peduncle; tremor/ataxia if red nucleus region involved','Weber: III palsy + contralateral weakness. Benedikt-like pattern: III palsy + contralateral tremor/ataxia.'], ['Posterior cerebral artery (PCA) / superior cerebellar artery perforator territory','Dorsal midbrain / tectum','Superior colliculi, pretectal area, posterior commissure, aqueduct vicinity','Vertical gaze palsy, light-near dissociation, convergence-retraction nystagmus, eyelid retraction','Usually no obligatory major body long-tract deficit','Dorsal midbrain (Parinaud) pattern, often from tectal or pineal-region compression rather than infarct.'] ] t=doc.add_table(rows=1, cols=len(headers));t.style='Table Grid';t.alignment=WD_TABLE_ALIGNMENT.CENTER;t.autofit=False widths=[1.45,1.2,1.85,2.05,1.6,2.0] for cell,w,head in zip(t.rows[0].cells,widths,headers): cell.width=Inches(w);add_cell(cell,head,True,6.9) for row in rows: cells=t.add_row().cells for cell,w,val in zip(cells,widths,row):cell.width=Inches(w);add_cell(cell,val,size=6.45) p1=doc.add_paragraph();p1.paragraph_format.space_before=Pt(4) r=p1.add_run('Rapid vascular map: ');r.bold=True;r.font.size=Pt(8) p1.add_run('Medial medulla: anterior spinal/vertebral branches. Lateral medulla: PICA/vertebral. Lateral pons: AICA. Medial pons: paramedian basilar branches. Rostral midbrain: PCA or basilar-tip perforators.').font.size=Pt(8) p2=doc.add_paragraph();r=p2.add_run('Clinical caution: ');r.bold=True;r.font.size=Pt(8) p2.add_run('Acute crossed neurological deficits, sudden dysphagia or hoarseness, new diplopia, severe vertigo with focal signs, or reduced consciousness may indicate posterior-circulation stroke and need urgent emergency evaluation.').font.size=Pt(8) doc.save(p) print(p) PY python /tmp/skills/docx/scripts/office/validate.py "/tmp/workspace/neuroanatomy-study-notes/output/Comprehensive_Neuroanatomy_Study_Notes.docx" && python3 - <<'PY' from docx import Document p='/tmp/workspace/neuroanatomy-study-notes/output/Comprehensive_Neuroanatomy_Study_Notes.docx';d=Document(p) print('tables:',len(d.tables),'last table rows:',len(d.tables[-1].rows),'columns:',len(d.tables[-1].columns)) print('last header:', ' | '.join(c.text for c in d.tables[-1].rows[0].cells)) PY ls -lh "/tmp/workspace/neuroanatomy-study-notes/output/Comprehensive_Neuroanatomy_Study_Notes.docx"
Comprehensive Neuroanatomy Study Notes
Word Document · DOCX
Add a comprehensive brainstem syndrome table
~/neuroanatomy-study-notes/output
brainstem stroke syndromes
NCBI Bookshelf brainstem syndromes Weber Benedikt Foville Millard Gubler localization
python3 - <<'PY' from docx import Document from docx.shared import Inches, Pt, RGBColor from docx.enum.table import WD_TABLE_ALIGNMENT, WD_CELL_VERTICAL_ALIGNMENT from pathlib import Path p=Path('/tmp/workspace/neuroanatomy-study-notes/output/Comprehensive_Neuroanatomy_Study_Notes.docx') doc=Document(p) h=doc.add_heading('Comprehensive brainstem syndrome-localization table',level=1) h.runs[0].font.color.rgb=RGBColor(23,56,76) p0=doc.add_paragraph('This table complements the vascular-territory table by organizing common eponymous, ocular-motor, and crossed brainstem syndromes. Real lesions may be incomplete or extend beyond these classic descriptions.') p0.paragraph_format.space_after=Pt(6) def text(cell, value, bold=False, size=6.35): cell.text=''; p=cell.paragraphs[0];p.paragraph_format.space_before=Pt(0);p.paragraph_format.space_after=Pt(0) r=p.add_run(value);r.font.name='Aptos';r.font.size=Pt(size);r.bold=bold;cell.vertical_alignment=WD_CELL_VERTICAL_ALIGNMENT.CENTER headers=['Syndrome / level','Usual lesion location or supply','Key affected structures','Ipsilateral findings','Contralateral findings','Localization pearl'] rows=[ ['Weber syndrome\n(midbrain)','Ventral medial midbrain; PCA paramedian or basilar-tip perforator territory','CN III fascicle; cerebral peduncle/corticospinal-corticobulbar fibers','III palsy: ptosis, eye down-and-out, possible mydriasis','Face and limb hemiparesis','III palsy + opposite hemiparesis = ventral midbrain.'], ['Benedikt syndrome\n(midbrain)','Midbrain tegmentum, often more dorsal than Weber; variable PCA perforator involvement','CN III fascicle with red nucleus and/or superior cerebellar peduncle pathways','III palsy','Contralateral tremor, choreoathetosis or ataxia; weakness may be variable','III palsy + opposite tremor/ataxia = tegmental midbrain.'], ['Claude syndrome\n(midbrain)','Dorsal midbrain tegmentum','CN III fascicle plus red nucleus/superior cerebellar peduncle','III palsy','Contralateral ataxia and dysmetria, often without marked weakness','III palsy + pure cerebellar-type deficit favors Claude pattern.'], ['Dorsal midbrain (Parinaud) syndrome','Pretectal/posterior commissure region; often pineal-region compression, hydrocephalus, or dorsal midbrain infarct','Vertical gaze centers, posterior commissure, pretectal light-reflex pathways','Vertical gaze palsy, convergence-retraction nystagmus, lid retraction, light-near dissociation','No obligatory crossed limb finding','Vertical gaze problem with pupils and convergence signs localizes dorsally, not to CN III alone.'], ['One-and-a-half syndrome\n(pons)','Dorsal pontine tegmentum','Ipsilateral PPRF or abducens nucleus plus ipsilateral medial longitudinal fasciculus','Ipsilateral horizontal gaze palsy; on looking away, ipsilateral eye cannot adduct','No obligatory body deficit','Only abduction of the contralateral eye is preserved: “one-and-a-half.”'], ['Eight-and-a-half syndrome\n(pons)','One-and-a-half syndrome plus facial fascicle/nucleus involvement','PPRF/VI nucleus + MLF + VII fascicle','One-and-a-half findings plus ipsilateral LMN facial weakness','No obligatory body deficit','One-and-a-half + facial palsy = eight-and-a-half syndrome.'], ['Foville syndrome\ncaudal medial pons','Inferior medial pontine tegmentum, often paramedian basilar perforator infarct','VI nucleus/PPRF, VII fascicle, corticospinal and medial lemniscal pathways','Horizontal gaze palsy or VI palsy, often ipsilateral facial weakness','Hemiparesis and possible reduced vibration/proprioception','Gaze/VI + VII with opposite long-tract signs = medial caudal pons.'], ['Millard-Gubler syndrome\nventral caudal pons','Ventral caudal pons, typically basilar branch infarct','VII fascicle, VI fascicle variably, corticospinal tract','Ipsilateral LMN facial palsy; sometimes VI palsy','Contralateral hemiparesis','Facial palsy + opposite weakness, with less gaze-center involvement than Foville.'], ['Raymond syndrome\nventral medial pons','Paramedian ventral pons','VI fascicle and corticospinal tract','Ipsilateral VI palsy','Contralateral hemiparesis','Abduction deficit + opposite weakness = ventral medial pons.'], ['Lateral pontine / Marie-Foix syndrome','AICA or long circumferential basilar branches','VII, VIII, spinal V, spinothalamic tract, middle cerebellar peduncle, sympathetic fibers','Facial paralysis; facial pain-temperature loss; vertigo, nystagmus, hearing loss; ipsilateral ataxia, possible Horner syndrome','Body pain-temperature loss; weakness may occur','Facial weakness with hearing/vestibular symptoms strongly suggests AICA territory.'], ['Locked-in syndrome\nventral pons','Large ventral pontine infarct, commonly basilar artery occlusion','Bilateral corticospinal and corticobulbar tracts, usually sparing tegmentum/reticular activating system','Anarthria and severe facial/bulbar weakness; vertical eye movements often preserved','Quadriplegia','Awareness is retained: establish communication with vertical eye movement or blinking.'], ['Medial medullary (Dejerine) syndrome','Anterior spinal artery or paramedian vertebral branches','Pyramid, medial lemniscus, CN XII nucleus/fascicle','Tongue weakness/atrophy with deviation toward lesion','Hemiparesis and loss of vibration/proprioception','“Tongue + pyramid + lemniscus.” Facial weakness is often absent.'], ['Lateral medullary (Wallenberg) syndrome','PICA or vertebral artery','Nucleus ambiguus, vestibular nuclei, inferior cerebellar peduncle, spinal V, spinothalamic tract, sympathetic fibers','Dysphagia, hoarseness, reduced gag; facial pain-temperature loss; vertigo/nystagmus; ipsilateral ataxia and Horner syndrome','Body pain-temperature loss','Hoarseness/dysphagia plus crossed pain-temperature loss = lateral medulla.'], ['Avellis syndrome\nmedulla','Lateral medullary region, variable vascular lesion','Nucleus ambiguus/fibers plus corticospinal tract','Ipsilateral palatal/laryngeal weakness, dysphagia or hoarseness','Hemiparesis','A lower-cranial-nerve motor syndrome with contralateral weakness.'], ['Jackson syndrome\nmedulla','Medial medulla with extension toward hypoglossal fibers and pyramid','CN XII fascicle and corticospinal tract','Ipsilateral XII palsy','Contralateral hemiparesis','An eponymous form of crossed hypoglossal-pyramidal involvement.'] ] t=doc.add_table(rows=1,cols=6);t.style='Table Grid';t.alignment=WD_TABLE_ALIGNMENT.CENTER;t.autofit=False widths=[1.4,1.65,1.85,1.9,1.6,1.85] for c,w,head in zip(t.rows[0].cells,widths,headers):c.width=Inches(w);text(c,head,True,6.7) for row in rows: cells=t.add_row().cells for c,w,val in zip(cells,widths,row):c.width=Inches(w);text(c,val,size=6.05) p=doc.add_paragraph();p.paragraph_format.space_before=Pt(4) r=p.add_run('Core rule: ');r.bold=True;r.font.size=Pt(8) p.add_run('A cranial-nerve deficit localizes the rostrocaudal level; a crossed body deficit identifies involvement of a long tract. Motor signs usually indicate a medial lesion, while crossed pain-temperature loss and cerebellar/vestibular signs often indicate a lateral lesion.').font.size=Pt(8) p=doc.add_paragraph();r=p.add_run('Emergency note: ');r.bold=True;r.font.size=Pt(8) p.add_run('New crossed deficits, acute diplopia, dysarthria, dysphagia, gait inability, severe vertigo with focal signs, or decreased consciousness can represent posterior-circulation stroke and require emergency assessment.').font.size=Pt(8) doc.save(p);print(p) PY python /tmp/skills/docx/scripts/office/validate.py "/tmp/workspace/neuroanatomy-study-notes/output/Comprehensive_Neuroanatomy_Study_Notes.docx" && python3 - <<'PY' from docx import Document p='/tmp/workspace/neuroanatomy-study-notes/output/Comprehensive_Neuroanatomy_Study_Notes.docx';d=Document(p); print('tables',len(d.tables),'last table rows',len(d.tables[-1].rows),'columns',len(d.tables[-1].columns));print('last:',d.tables[-1].rows[-1].cells[0].text) PY ls -lh "/tmp/workspace/neuroanatomy-study-notes/output/Comprehensive_Neuroanatomy_Study_Notes.docx"
python3 - <<'PY' from docx import Document from docx.shared import Inches, Pt, RGBColor from docx.enum.table import WD_TABLE_ALIGNMENT, WD_CELL_VERTICAL_ALIGNMENT from pathlib import Path path=Path('/tmp/workspace/neuroanatomy-study-notes/output/Comprehensive_Neuroanatomy_Study_Notes.docx') doc=Document(path) h=doc.add_heading('Comprehensive brainstem syndrome-localization table',level=1);h.runs[0].font.color.rgb=RGBColor(23,56,76) intro=doc.add_paragraph('This table complements the vascular-territory table by organizing common eponymous, ocular-motor, and crossed brainstem syndromes. Real lesions may be incomplete or extend beyond these classic descriptions.');intro.paragraph_format.space_after=Pt(6) def put(cell,value,bold=False,size=6.35): cell.text='';pa=cell.paragraphs[0];pa.paragraph_format.space_before=Pt(0);pa.paragraph_format.space_after=Pt(0);r=pa.add_run(value);r.font.name='Aptos';r.font.size=Pt(size);r.bold=bold;cell.vertical_alignment=WD_CELL_VERTICAL_ALIGNMENT.CENTER headers=['Syndrome / level','Usual lesion location or supply','Key affected structures','Ipsilateral findings','Contralateral findings','Localization pearl'] rows=[ ['Weber syndrome\n(midbrain)','Ventral medial midbrain; PCA paramedian or basilar-tip perforator territory','CN III fascicle; cerebral peduncle/corticospinal-corticobulbar fibers','III palsy: ptosis, eye down-and-out, possible mydriasis','Face and limb hemiparesis','III palsy + opposite hemiparesis = ventral midbrain.'], ['Benedikt syndrome\n(midbrain)','Midbrain tegmentum, often more dorsal than Weber; variable PCA perforator involvement','CN III fascicle with red nucleus and/or superior cerebellar peduncle pathways','III palsy','Contralateral tremor, choreoathetosis or ataxia; weakness may be variable','III palsy + opposite tremor/ataxia = tegmental midbrain.'], ['Claude syndrome\n(midbrain)','Dorsal midbrain tegmentum','CN III fascicle plus red nucleus/superior cerebellar peduncle','III palsy','Contralateral ataxia and dysmetria, often without marked weakness','III palsy + pure cerebellar-type deficit favors Claude pattern.'], ['Dorsal midbrain (Parinaud) syndrome','Pretectal/posterior commissure region; often pineal-region compression, hydrocephalus, or dorsal midbrain infarct','Vertical gaze centers, posterior commissure, pretectal light-reflex pathways','Vertical gaze palsy, convergence-retraction nystagmus, lid retraction, light-near dissociation','No obligatory crossed limb finding','Vertical gaze problem with pupils and convergence signs localizes dorsally, not to CN III alone.'], ['One-and-a-half syndrome\n(pons)','Dorsal pontine tegmentum','Ipsilateral PPRF or abducens nucleus plus ipsilateral medial longitudinal fasciculus','Ipsilateral horizontal gaze palsy; on looking away, ipsilateral eye cannot adduct','No obligatory body deficit','Only abduction of the contralateral eye is preserved: “one-and-a-half.”'], ['Eight-and-a-half syndrome\n(pons)','One-and-a-half syndrome plus facial fascicle/nucleus involvement','PPRF/VI nucleus + MLF + VII fascicle','One-and-a-half findings plus ipsilateral LMN facial weakness','No obligatory body deficit','One-and-a-half + facial palsy = eight-and-a-half syndrome.'], ['Foville syndrome\ncaudal medial pons','Inferior medial pontine tegmentum, often paramedian basilar perforator infarct','VI nucleus/PPRF, VII fascicle, corticospinal and medial lemniscal pathways','Horizontal gaze palsy or VI palsy, often ipsilateral facial weakness','Hemiparesis and possible reduced vibration/proprioception','Gaze/VI + VII with opposite long-tract signs = medial caudal pons.'], ['Millard-Gubler syndrome\nventral caudal pons','Ventral caudal pons, typically basilar branch infarct','VII fascicle, VI fascicle variably, corticospinal tract','Ipsilateral LMN facial palsy; sometimes VI palsy','Contralateral hemiparesis','Facial palsy + opposite weakness, with less gaze-center involvement than Foville.'], ['Raymond syndrome\nventral medial pons','Paramedian ventral pons','VI fascicle and corticospinal tract','Ipsilateral VI palsy','Contralateral hemiparesis','Abduction deficit + opposite weakness = ventral medial pons.'], ['Lateral pontine / Marie-Foix syndrome','AICA or long circumferential basilar branches','VII, VIII, spinal V, spinothalamic tract, middle cerebellar peduncle, sympathetic fibers','Facial paralysis; facial pain-temperature loss; vertigo, nystagmus, hearing loss; ipsilateral ataxia, possible Horner syndrome','Body pain-temperature loss; weakness may occur','Facial weakness with hearing/vestibular symptoms strongly suggests AICA territory.'], ['Locked-in syndrome\nventral pons','Large ventral pontine infarct, commonly basilar artery occlusion','Bilateral corticospinal and corticobulbar tracts, usually sparing tegmentum/reticular activating system','Anarthria and severe facial/bulbar weakness; vertical eye movements often preserved','Quadriplegia','Awareness is retained: establish communication with vertical eye movement or blinking.'], ['Medial medullary (Dejerine) syndrome','Anterior spinal artery or paramedian vertebral branches','Pyramid, medial lemniscus, CN XII nucleus/fascicle','Tongue weakness/atrophy with deviation toward lesion','Hemiparesis and loss of vibration/proprioception','“Tongue + pyramid + lemniscus.” Facial weakness is often absent.'], ['Lateral medullary (Wallenberg) syndrome','PICA or vertebral artery','Nucleus ambiguus, vestibular nuclei, inferior cerebellar peduncle, spinal V, spinothalamic tract, sympathetic fibers','Dysphagia, hoarseness, reduced gag; facial pain-temperature loss; vertigo/nystagmus; ipsilateral ataxia and Horner syndrome','Body pain-temperature loss','Hoarseness/dysphagia plus crossed pain-temperature loss = lateral medulla.'], ['Avellis syndrome\nmedulla','Lateral medullary region, variable vascular lesion','Nucleus ambiguus/fibers plus corticospinal tract','Ipsilateral palatal/laryngeal weakness, dysphagia or hoarseness','Hemiparesis','A lower-cranial-nerve motor syndrome with contralateral weakness.'], ['Jackson syndrome\nmedulla','Medial medulla with extension toward hypoglossal fibers and pyramid','CN XII fascicle and corticospinal tract','Ipsilateral XII palsy','Contralateral hemiparesis','An eponymous form of crossed hypoglossal-pyramidal involvement.']] t=doc.add_table(rows=1,cols=6);t.style='Table Grid';t.alignment=WD_TABLE_ALIGNMENT.CENTER;t.autofit=False;widths=[1.4,1.65,1.85,1.9,1.6,1.85] for c,w,head in zip(t.rows[0].cells,widths,headers):c.width=Inches(w);put(c,head,True,6.7) for row in rows: cells=t.add_row().cells for c,w,val in zip(cells,widths,row):c.width=Inches(w);put(c,val,size=6.05) pa=doc.add_paragraph();pa.paragraph_format.space_before=Pt(4);r=pa.add_run('Core rule: ');r.bold=True;r.font.size=Pt(8);pa.add_run('A cranial-nerve deficit localizes the rostrocaudal level; a crossed body deficit identifies involvement of a long tract. Motor signs usually indicate a medial lesion, while crossed pain-temperature loss and cerebellar/vestibular signs often indicate a lateral lesion.').font.size=Pt(8) pa=doc.add_paragraph();r=pa.add_run('Emergency note: ');r.bold=True;r.font.size=Pt(8);pa.add_run('New crossed deficits, acute diplopia, dysarthria, dysphagia, gait inability, severe vertigo with focal signs, or decreased consciousness can represent posterior-circulation stroke and require emergency assessment.').font.size=Pt(8) doc.save(path);print(path) PY python /tmp/skills/docx/scripts/office/validate.py "/tmp/workspace/neuroanatomy-study-notes/output/Comprehensive_Neuroanatomy_Study_Notes.docx" && python3 - <<'PY' from docx import Document p='/tmp/workspace/neuroanatomy-study-notes/output/Comprehensive_Neuroanatomy_Study_Notes.docx';d=Document(p); print('tables',len(d.tables),'final table rows',len(d.tables[-1].rows),'columns',len(d.tables[-1].columns));print(d.tables[-1].rows[0].cells[0].text, d.tables[-1].rows[-1].cells[0].text) PY ls -lh "/tmp/workspace/neuroanatomy-study-notes/output/Comprehensive_Neuroanatomy_Study_Notes.docx"
Comprehensive Neuroanatomy Study Notes
Word Document · DOCX
Create a color-coded brainstem vascular territory diagram
A labelled educational medical diagram showing brainstem vascular territories. Include three transverse cross-sections, midbrain, pons, and medulla, dorsal at top. Use distinct color-coded regions and a legend for paramedian perforators, short circumferential branches, PICA, AICA, SCA, PCA perforators, and anterior spinal artery. Label key localization zones: medial medulla, lateral medulla, medial pons, lateral pons, ventral pons, and medial midbrain. Ensure all labels are legible and anatomically consistent.
NCBI brainstem vascular supply PICA AICA SCA paramedian branches anatomy
python3 - <<'PY' import urllib.request url='https://cdn.orris.care/image-gen/4f9fdd967ece4c64b1daa53e1cedb593.png' out='/tmp/workspace/neuroanatomy-study-notes/assets/brainstem_vascular_territories_color_coded.png' urllib.request.urlretrieve(url,out) print(out) PY ls -lh "/tmp/workspace/neuroanatomy-study-notes/assets/brainstem_vascular_territories_color_coded.png"
python3 - <<'PY' from PIL import Image p='/tmp/workspace/neuroanatomy-study-notes/assets/brainstem_vascular_territories_color_coded.png' im=Image.open(p);im.thumbnail((900,900));im.save('/tmp/workspace/neuroanatomy-study-notes/assets/brainstem_vascular_territories_preview.jpg',quality=80);print(im.size) PY
python3 - <<'PY' from docx import Document from docx.shared import Inches, Pt, RGBColor from docx.enum.text import WD_ALIGN_PARAGRAPH from pathlib import Path p=Path('/tmp/workspace/neuroanatomy-study-notes/output/Comprehensive_Neuroanatomy_Study_Notes.docx') a=Path('/tmp/workspace/neuroanatomy-study-notes/assets/brainstem_vascular_territories_color_coded.png') d=Document(p) d.add_page_break() h=d.add_heading('Color-coded brainstem vascular territories',level=1) h.runs[0].font.color.rgb=RGBColor(23,56,76) intro=d.add_paragraph('This schematic links the medial, lateral, and ventral brainstem zones to their major arterial supplies. Use it alongside the vascular-territory and syndrome-localization tables.') intro.paragraph_format.space_after=Pt(6) d.add_picture(str(a),width=Inches(9.55));d.paragraphs[-1].alignment=WD_ALIGN_PARAGRAPH.CENTER cap=d.add_paragraph('Figure 7. Colour-coded schematic of representative midbrain, pontine and medullary vascular territories. Territory boundaries vary among individuals and overlap through circumferential and perforating branches; this is a study map, not an angiographic map.') cap.runs[0].italic=True;cap.runs[0].font.size=Pt(8) d.add_heading('How to read the diagram',level=2) for x in [ 'Medial zones are supplied mainly by paramedian perforators. In the medulla, anterior spinal and vertebral paramedian branches supply the medial region; in the pons, basilar paramedian branches are central.', 'Lateral medulla is typically PICA or vertebral territory. Lateral caudal pons is typically AICA or long circumferential basilar territory. Superior lateral pons and cerebellar connections often involve SCA territory.', 'Rostral midbrain perforators arise mainly from PCA and SCA-related branches. Pair the territory with cranial-nerve and long-tract findings rather than relying on one sign alone.' ]: d.add_paragraph(x,style='List Bullet') d.save(p) print(p) PY python /tmp/skills/docx/scripts/office/validate.py "/tmp/workspace/neuroanatomy-study-notes/output/Comprehensive_Neuroanatomy_Study_Notes.docx" && python3 - <<'PY' from docx import Document p='/tmp/workspace/neuroanatomy-study-notes/output/Comprehensive_Neuroanatomy_Study_Notes.docx';d=Document(p);print('images:',len(d.inline_shapes),'tables:',len(d.tables),'paragraphs:',len(d.paragraphs));print(d.paragraphs[-5].text) PY ls -lh "/tmp/workspace/neuroanatomy-study-notes/output/Comprehensive_Neuroanatomy_Study_Notes.docx"