Cognitive function relies on both molecular levels and cellular structures. However, systematic relationships between these two components of cognitive function, and their joint contribution to disease, are largely unknown. We utilize postmortem neuroimaging in tandem with gene expression and DNA methylation, from 222 deeply-phenotyped persons in a longitudinal aging cohort. Expression of hundreds of genes and methylation at thousands of loci are related to the microstructure of extensive regions of this same set of brains, as assessed by MRI. The genes linked to brain microstructure perform functions related to cell motility, transcriptional regulation and nuclear processes, and are selectively associated with Alzheimer's phenotypes. Similar methodology can be applied to other diseases to identify their joint molecular and structural basis, or to infer molecular levels in the brain on the basis of neuroimaging for precision medicine applications.