The purpose of this work is to construct a model for the functional architecture of the primary visual cortex (V1), based on a structure of metric measure space induced by the underlying organization of receptive profiles (RPs) of visual cells. In order to account for the horizontal connectivity of V1 in such a context, a diffusion process compatible with the geometry of the space is defined following the classical approach of K.-T. Sturm [Ann. Probab., 26 (1998), pp. 1-55]. The construction of our distance function neither requires any group parameterization of the family of RPs nor involves any differential structure. As such, it adapts to nonparameterized sets of RPs, possibly obtained through numerical procedures; it also allows us to m...