Fast histogram-based brain segmentation from T1-weighted MR images using morphological processing and geometric criteria