Chris Chatham has an excellent summary of a talk by University of Chicago neurologist / mathematician Jack Cowan, who has come up with a mathematical explanation of a variety of common hallucinations.

The development of orientation and spatial frequency maps in V1 [a region of the brain which maps images as they are transmitted from the eyes] can be simulated with some fairly “simple” (maybe simple to Jack Cowan, but not to me!) self-organizing functions, such that “orientation and spatial frequency are the zeroth and first order spherical harmonics” and “the coefficient of the first order representation is just the dot product of the vector of feature preferences with the vector of stimulus features, where the vectors have components given by the first order spherical harmonics. Similar representation can be found for directional motion, binocular disparity, and color.”