Automatic segmentation of EPI data