We recently learnt about the concept of Form Constants - geometric patterns that regularly show up in vision during altered states of consciousness. According to various studies, these patterns reflect patterns existing in the physical structure of the brain. This would explain why some hallucinations (including the “light at the end of the tunnel”) are common to all cultures.
(the following may be imprecise and badly worded, improvements welcome)
Everything the eyes see maps neatly onto the visual cortex (this is also mentioned in the article about migraine auras shared here some time ago by @jimboburgess). However the visual field has a circular shape, while the visual cortex works as a plane, so this mapping is a polar coordinate mapping.
When we look to a spiral or a tunnel, neurons in the visual cortex get excited in patterns shaped not like a spiral, but like parallel stripes.
What happens when altered states of consciousness cause neurons in the visual cortex to get excited in parallel stripes, in absence of visual stimuli? We “see” spirals.
Striped and spotted patterns are common in nature (look up “Reaction Diffusion”, there are also many online simulators). In some cases neurons behave following such patterns, which would explain why spirals and other form constant are commonly visualized during hallucinated states.
Divulgative articles:
Uncoiling the spiral: Maths and hallucinations
A Math Theory for Why People Hallucinate
Form Constant Visualization – Type I
Form Constants and the Visual Cortex
Academic papers:
Spatial and color hallucinations in a mathematical model of primary visual cortex (PDF)
A Model for the Origin and Properties of Flicker-Induced Geometric Phosphenes
A Mathematical Theory of Visual Hallucination Patterns (PDF)
Quasicrystal patterns in a neural field model
Reproducing Sensory Induced Hallucinations Via Neural Fields (PDF)
Video of a talk with slides: