Bayesian method for MRI image segmentation