Cells in primary visual cortex show a remarkable variety of receptive-field structures. In spite of the extensive experimental and theoretical effort over the past 50 years, it has been difficult to establish how this diversity of functional-response properties emerges in the cortex. One of the reasons is that while functional studies in the early visual pathway have been usually carried out in vivo with extracellular recording techniques, investigations about the precise structure of the cortical network have mainly been conducted in vitro. Thus, the link between structure and function has rarely been explicitly established, remaining a well-known controversial issue. In this chapter, I review recent data that simultaneously combines anatomy with physiology at the intracellular level; trying to understand how the primary visual cortex transforms the information it receives from the thalamus to generate receptive-field structure, contrast-invariant orientation tuning and other functional-response properties.