Constrained optimization of nonparametric entropy-based segmentation of brain structures