Previously, we described our implementation of a brain-image database (braid), based on the proprietary object relational database-management system (ORDBMS) Illustra [1]. In conjunction with our collaborators, we have used this database to manage and analyze image and clinical data from what we call image-based clinical trials (IBCTs). Herein we describe the results of redesigning braid using open-source components, and integrating support for mining image and clinical data from braid's user interface. We re-designed and re-implemented braid using open-source components, including PostgreSQL, gcc, and PHP. We integrated data-mining algorithms into braid, based on PL/R, a PostgreSQL package to support efficient communication between R and PostgreSQL. We present a sample clinical study to demonstrate how clinicians can perform queries for visualization, statistical analysis, and data mining, using a web-based interface. We have developed a database system with data-mining capabilities for managing, querying, analyzing and visualizing brain-MR images. We implemented this system using open-source components, with the express goal of wide dissemination throughout the neuroimaging research community.