Here we proposed an automatic segmentation method based on a decision tree to classify the brain tissues in magnetic resonance (MR) images. Two types of data - phantom MR images obtained from IBSR (http://www.cma.mgh.harvard.edu/ibsr) and simulated brain MR images obtained from BrainWeb (http://www.bic.mni.mcgill.ca/brainweb) - were segmented using an automatic decision tree algorithm to obtain images with improved visual rendition. Spatial information on the general gray level (G), spatial gray level (S), and two-dimensional wavelet transform (W) was combined in-plane in two coordinate systems (Euclidean coordinates (x, y) or polar coordinates (r, theta)). The decision tree was constructed based on a binary tree with nodes created by splitting the distribution of input features of the tree. The spatial information obtained from MR images with different noise levels and inhomogeneities were segmented to compare whether the use of a decision tree improved the identification of human anatomical structures in a neuroimage. The average accuracy rates of segmentation for phantom images with a noise variation of 15 gray levels were 0.9999 and 0.9973 with spatial information (G, x, y, r, theta) and (S, x, y, r, theta), respectively, and 0.9999 and 0.9819 with spatial information (G, x, y, S, r, theta) and (W, x, y, G, r, theta). The average accuracy rates of segmentation for simulated MR images with a noise level of 5% were 0.9532 and 0.9439 with spatial information (G, x, y, r, theta) and (S, x, y, r, theta), respectively, and 0.9446 and 0.9287 with spatial information (G, x, y, S, r, theta) and (W, x, y, G, r, theta). The accuracy rates of segmentation were highest for both simulated phantom and brain MR images, having the lowest noise levels, from a reduction of overlapping gray levels in the images. The accuracies of segmentation were higher when the spatial information included the general gray level than when it included the spatial gray level, which in turn were higher than when it included the wavelet transform. Furthermore, the performance of segmentation was also evaluated with a boundary detection methodology that is based on the Hausdorff distance to compare with the mean computer to observer difference (COD) and mean interobserver difference (IOD) for gray matter (GM), white matter (WM), and all areas (ALL) from images segmented using the decision tree. The values of mean COD are similar and around 12mm for GM segmented using the decision tree. Our segmentation method based on a decision tree algorithm presented an easy way to perform automatic segmentation for both phantom and tissue regions in brain MR images.