BEaST: Brain extraction based on nonlocal segmentation technique