With recent advances in diagnostic medical imaging, huge quantities of medical images are produced and stored in digital image repositories. While these repositories are difficult to be analyzed manually by medical experts, they can be evaluated using computer-based methods to enrich the process of decision making. For example, query by image methods can be used by medical experts for differential diagnosis by displaying previously evaluated cases that contain similar visual patterns. Also, less experienced practitioners can benefit from query-by-semantic methods in training processes especially for difficult-to-interpret cases with multiple pathologies. In this article we develop a methodology for ranking medical images based on Dirichlet process nonparametric distributions. Our approach uses natural groupings of images in a generated feature space to evaluate associative semantic mappings. Relevant semantic mappings are then used to generate additive computer models of semantic understanding of visual patterns found in images. We evaluate the performance of our method using mean average precision and precision-recall charts.