We propose a novel method for voxel-based morphometry (VBM), which we call Graphical-Model-based Morphometric Analysis (GAMMA), to identify morphological abnormalities automatically, and to find complex probabilistic associations among voxels in magnetic-resonance images and clinical variables. GAMMA is a fully automatic, nonparametric morphometric-analysis algorithm, with high sensitivity and specificity. It uses a Bayesian network to represent the associations among voxels and the function variable, and uses a contextual-clustering method based on a Markov random field to find clusters in which all voxels have similar associations with the function variable. We use loopy belief propagation to infer the unobserved label field and belief map. As opposed to voxel-based morphometric methods based on general linear models, GAMMA is capable of identifying nonlinear associations among the function variable and voxels. Compared with our previous approach, a Bayesian morphometry algorithm, GAMMA has greater sensitivity, specificity, and computational efficiency.