We present iCluster, a fast and efficient algorithm that clusters a set of images while co-registering them using a parameterized, nonlinear transformation model. The output is a small number of template images that represent different modes in a population. This is in contrast with traditional approaches that assume a single template to construct atlases. We validate and explore the algorithm in two experiments. First, we employ iCluster to partition a data set of 416 whole brain MR volumes of subjects aged 18-96 years into three sub-groups, which mainly correspond to age groups. The templates reveal significant structural differences across these age groups that confirm previous findings in aging research. In the second experiment, we run iCluster on a group of 30 patients with dementia and 30 age-matched healthy controls. The algorithm produced three modes that mainly corresponded to a sub-population of healthy controls, a sub-population of patients with dementia and a mixture group that contained both types. These results suggest that the algorithm can be used to discover sub-populations that correspond to interesting structural or functional "modes".