Diffusion Tensor Imaging (DTI) has become an important MRI procedure to investigate the integrity of white matter in brain in vivo. DTI is estimated from a series of acquired Diffusion Weighted Imaging (DWI) volumes. DWI data suffers from inherent low SNR, overall long scanning time of multiple directional encoding with correspondingly large risk to encounter several kinds of artifacts. These artifacts can be too severe for a correct and stable estimation of the diffusion tensor. Thus, a quality control (QC) procedure is absolutely necessary for DTI studies. Currently, routine DTI QC procedures are conducted manually by visually checking the DWI data set in a gradient by gradient and slice by slice way. The results often suffer from low consistence across different data sets, lack of agreement of different experts, and difficulty to judge motion artifacts by qualitative inspection. Additionally considerable manpower is needed for this step due to the large number of images to QC, which is common for group comparison and longitudinal studies, especially with increasing number of diffusion gradient directions. We present a framework for automatic DWI QC. We developed a tool called DTIPrep which pipelines the QC steps with a detailed protocoling and reporting facility. And it is fully open source. This framework/tool has been successfully applied to several DTI studies with several hundred DWIs in our lab as well as collaborating labs in Utah and Iowa. In our studies, the tool provides a crucial piece for robust DTI analysis in brain white matter study.